-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(application-generic): Modernize app generic #7424
base: next
Are you sure you want to change the base?
Conversation
Update Got to its latest version to get all fixes and use its timing reporting so as to investigate timeouts with Bridge endpoints
- Convert it to ESM module - Replace jest with vitest - Restore all failing unit tests
✅ Deploy Preview for dev-web-novu ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for dashboard-v2-novu-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
const res = await request(url, { | ||
...options, | ||
headers, | ||
}).json(); | ||
}); |
Check failure
Code scanning / CodeQL
Server-side request forgery Critical
URL
user-provided value
The
URL
user-provided value
The
URL
user-provided value
The
URL
user-provided value
The
URL
user-provided value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 19 days ago
To fix the SSRF vulnerability, we need to ensure that the bridgeUrl
is validated against a whitelist of allowed URLs or domains. This can be done by checking if the bridgeUrl
matches a predefined set of allowed URLs or domains before using it in the HTTP request.
- Introduce a whitelist of allowed URLs or domains.
- Validate the
bridgeUrl
against this whitelist. - If the
bridgeUrl
is not in the whitelist, throw an error.
-
Copy modified line R125 -
Copy modified lines R495-R509
@@ -124,3 +124,3 @@ | ||
command.workflowOrigin, | ||
command.statelessBridgeUrl, | ||
this.validateBridgeUrl(command.statelessBridgeUrl), | ||
command.action, | ||
@@ -494,2 +494,17 @@ | ||
} | ||
private validateBridgeUrl(url: string): string { | ||
const allowedUrls = [ | ||
'https://allowed-domain1.com', | ||
'https://allowed-domain2.com', | ||
// Add more allowed URLs or domains here | ||
]; | ||
|
||
const isValid = allowedUrls.some(allowedUrl => url.startsWith(allowedUrl)); | ||
|
||
if (!isValid) { | ||
throw new BadRequestException('Invalid bridge URL'); | ||
} | ||
|
||
return url; | ||
} | ||
} |
What changed? Why was the change needed?
Screenshots
Expand for optional sections
Related enterprise PR
Special notes for your reviewer