By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
This pull request introduces stricter validation for organization and resource identifiers to improve security and consistency across API endpoints. The main changes add UUID format checks for organization IDs in license-related routes and type guard functions for resource and identity provider IDs in server-side actions, with corresponding input validation in proxy functions.
Validation improvements for organization IDs:
Added UUID v4 format validation for orgId in generateNewLicense.ts, ensuring only valid organization IDs are accepted when generating new licenses. [1][2]
Updated listGeneratedLicenses.ts to require orgId to match a UUID v4 pattern, rejecting invalid or missing organization IDs with a clear error message.
Security enhancements in server-side actions:
Introduced isValidResourceId and isValidIdpId type guard functions in server.ts to validate resource and identity provider IDs, restricting accepted formats.
Added input validation using these type guards in proxy functions (resourcePasswordProxy, resourcePincodeProxy, resourceWhitelistProxy, resourceAccessProxy, validateOidcUrlCallbackProxy, generateOidcUrlProxy), throwing errors for invalid IDs to prevent unsafe requests. [1][2][3][4][5][6]
Enforced alphanumeric, dash, and underscore restrictions for orgId in generateOidcUrlProxy to further strengthen input validation.
How to test?
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/fosrl/pangolin/pull/1948
**Author:** [@marcschaeferger](https://github.com/marcschaeferger)
**Created:** 11/29/2025
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `fix-security/js-request-forgery`
---
### 📝 Commits (4)
- [`5f66127`](https://github.com/fosrl/pangolin/commit/5f661277033ff367e05d971ad7245053046beb3f) Potential fix for code scanning alert no. 16: Server-side request forgery
- [`8c4a661`](https://github.com/fosrl/pangolin/commit/8c4a661cc1a675ab6ebeb5570102c9174f4a1fa5) Potential fix for code scanning alert no. 17: Server-side request forgery
- [`f0104e1`](https://github.com/fosrl/pangolin/commit/f0104e13cad1f7161d57185bd8c89400b50e7292) Potential fix for code scanning alert no. 18: Server-side request forgery
- [`ae3a2b9`](https://github.com/fosrl/pangolin/commit/ae3a2b9eeb6469fcfcc4f3a2e1ccda59f17d794b) fix(generatedLicense): enforce UUID v4 orgId validation
### 📊 Changes
**3 files changed** (+50 additions, -2 deletions)
<details>
<summary>View changed files</summary>
📝 `server/private/routers/generatedLicense/generateNewLicense.ts` (+10 -0)
📝 `server/private/routers/generatedLicense/listGeneratedLicenses.ts` (+4 -2)
📝 `src/actions/server.ts` (+36 -0)
</details>
### 📄 Description
## Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
## Description (generated by Copilot)
See https://codeql.github.com/codeql-query-help/javascript/js-request-forgery/
**Code generated by Copilot**
This pull request introduces stricter validation for organization and resource identifiers to improve security and consistency across API endpoints. The main changes add UUID format checks for organization IDs in license-related routes and type guard functions for resource and identity provider IDs in server-side actions, with corresponding input validation in proxy functions.
**Validation improvements for organization IDs:**
* Added UUID v4 format validation for `orgId` in `generateNewLicense.ts`, ensuring only valid organization IDs are accepted when generating new licenses. [[1]](diffhunk://#diff-6c08a641d462a22060ae3f4fdfd0ee0889f7f4ac9f3dfa255a4b1c0568065c47R56-R57) [[2]](diffhunk://#diff-6c08a641d462a22060ae3f4fdfd0ee0889f7f4ac9f3dfa255a4b1c0568065c47R66-R73)
* Updated `listGeneratedLicenses.ts` to require `orgId` to match a UUID v4 pattern, rejecting invalid or missing organization IDs with a clear error message.
**Security enhancements in server-side actions:**
* Introduced `isValidResourceId` and `isValidIdpId` type guard functions in `server.ts` to validate resource and identity provider IDs, restricting accepted formats.
* Added input validation using these type guards in proxy functions (`resourcePasswordProxy`, `resourcePincodeProxy`, `resourceWhitelistProxy`, `resourceAccessProxy`, `validateOidcUrlCallbackProxy`, `generateOidcUrlProxy`), throwing errors for invalid IDs to prevent unsafe requests. [[1]](diffhunk://#diff-e10bdddde4c48eed57a2e4ae3149c01574a9ae9fe8f19001704f360a13f579dbR334-R336) [[2]](diffhunk://#diff-e10bdddde4c48eed57a2e4ae3149c01574a9ae9fe8f19001704f360a13f579dbR349-R351) [[3]](diffhunk://#diff-e10bdddde4c48eed57a2e4ae3149c01574a9ae9fe8f19001704f360a13f579dbR364-R366) [[4]](diffhunk://#diff-e10bdddde4c48eed57a2e4ae3149c01574a9ae9fe8f19001704f360a13f579dbR382-R384) [[5]](diffhunk://#diff-e10bdddde4c48eed57a2e4ae3149c01574a9ae9fe8f19001704f360a13f579dbR422-R424) [[6]](diffhunk://#diff-e10bdddde4c48eed57a2e4ae3149c01574a9ae9fe8f19001704f360a13f579dbR442-R447)
* Enforced alphanumeric, dash, and underscore restrictions for `orgId` in `generateOidcUrlProxy` to further strengthen input validation.
## How to test?
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/1948
Author: @marcschaeferger
Created: 11/29/2025
Status: ❌ Closed
Base:
main← Head:fix-security/js-request-forgery📝 Commits (4)
5f66127Potential fix for code scanning alert no. 16: Server-side request forgery8c4a661Potential fix for code scanning alert no. 17: Server-side request forgeryf0104e1Potential fix for code scanning alert no. 18: Server-side request forgeryae3a2b9fix(generatedLicense): enforce UUID v4 orgId validation📊 Changes
3 files changed (+50 additions, -2 deletions)
View changed files
📝
server/private/routers/generatedLicense/generateNewLicense.ts(+10 -0)📝
server/private/routers/generatedLicense/listGeneratedLicenses.ts(+4 -2)📝
src/actions/server.ts(+36 -0)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description (generated by Copilot)
See https://codeql.github.com/codeql-query-help/javascript/js-request-forgery/
Code generated by Copilot
This pull request introduces stricter validation for organization and resource identifiers to improve security and consistency across API endpoints. The main changes add UUID format checks for organization IDs in license-related routes and type guard functions for resource and identity provider IDs in server-side actions, with corresponding input validation in proxy functions.
Validation improvements for organization IDs:
orgIdingenerateNewLicense.ts, ensuring only valid organization IDs are accepted when generating new licenses. [1] [2]listGeneratedLicenses.tsto requireorgIdto match a UUID v4 pattern, rejecting invalid or missing organization IDs with a clear error message.Security enhancements in server-side actions:
isValidResourceIdandisValidIdpIdtype guard functions inserver.tsto validate resource and identity provider IDs, restricting accepted formats.resourcePasswordProxy,resourcePincodeProxy,resourceWhitelistProxy,resourceAccessProxy,validateOidcUrlCallbackProxy,generateOidcUrlProxy), throwing errors for invalid IDs to prevent unsafe requests. [1] [2] [3] [4] [5] [6]orgIdingenerateOidcUrlProxyto further strengthen input validation.How to test?
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.