-
Notifications
You must be signed in to change notification settings - Fork 0
Support tools that require oauth #32
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
base: main
Are you sure you want to change the base?
Conversation
token_response = requests.post( | ||
well_known_configuration.token_endpoint, data=token_data | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential user input in HTTP request may allow SSRF attack - medium severity
If an attacker can control the URL input leading into this HTTP request, the attack might be able to perform an SSRF attack. This kind of attack is even more dangerous if the application returns the response of the request to the user. It could allow them to retrieve information from higher privileged services within the network (such as the metadata service, which is commonly available in cloud services, and could allow them to retrieve credentials).
Remediation - medium confidence
This patch mitigates the opening of potentially unsafe URLs by implementing validation for URLs passed to urllib_urlopen
.
token_response = requests.post( | |
well_known_configuration.token_endpoint, data=token_data | |
) | |
token_endpoint = well_known_configuration.token_endpoint | |
if not token_endpoint.startswith(('https://', 'http://')): | |
raise ValueError("Invalid token endpoint URL") | |
token_response = requests.post(token_endpoint, data=token_data) |
No description provided.