-
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
fix(application-generic): Bump got #7399
Conversation
✅ 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 29 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 implementing a validation function that checks if the bridgeUrl
matches any of the allowed patterns before using it to construct the final URL for the request.
- Implement a validation function that checks if the
bridgeUrl
is in a list of allowed URLs or matches a specific pattern. - Use this validation function in the
execute
method ofExecuteBridgeRequest
to validatecommand.statelessBridgeUrl
before constructing thebridgeUrl
. - If the URL is not valid, throw an appropriate exception.
-
Copy modified lines R121-R124 -
Copy modified lines R499-R507
@@ -120,2 +120,6 @@ | ||
|
||
if (!this.isValidBridgeUrl(command.statelessBridgeUrl)) { | ||
throw new BadRequestException('Invalid bridge URL'); | ||
} | ||
|
||
const bridgeUrl = this.getBridgeUrl( | ||
@@ -494,2 +498,11 @@ | ||
} | ||
private isValidBridgeUrl(url: string): boolean { | ||
const allowedUrls = [ | ||
'https://allowed-domain1.com', | ||
'https://allowed-domain2.com', | ||
// Add more allowed URLs or patterns here | ||
]; | ||
|
||
return allowedUrls.some((allowedUrl) => url.startsWith(allowedUrl)); | ||
} | ||
} |
Update Got to its latest version to get all fixes and use its timing reporting so as to investigate timeouts with Bridge endpoints
5aa45d3
to
c2feabd
Compare
commit: |
Got will be bumped as part of the #7424 |
What changed? Why was the change needed?
Update Got to its latest version to get all fixes and use its timing reporting so as to investigate timeouts with Bridge endpoints