Skip to content
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

False positive - Java - Server-side request forgery - When type converted to File #16949

Open
JLLeitschuh opened this issue Jul 10, 2024 · 1 comment

Comments

@JLLeitschuh
Copy link
Contributor

JLLeitschuh commented Jul 10, 2024

Description of the false positive

If a URI or URL is created from a File it isn't a valid source of SSRF. This is because, AFAIK, opening a stream from a file will never create a socket request.

new File("untrusted-user-input.txt").toURI().toURL().openStream()

Code samples or links to source code

https://github.com/keycloak/keycloak/blob/0bfadacffd1112e6fa6fdce5b6662b08aeb15d79/services/src/main/java/org/keycloak/theme/FolderTheme.java#L101-L101

URL to the alert on GitHub code scanning (optional)

https://github.com/Chainguard-Wolfi-Bites-Back/keycloak__keycloak/security/code-scanning/18

Reasonable Fix

It should be simple to add any type conversion to a File as a simple sanitizer.

@ginsbach
Copy link
Contributor

Thank you for this false positive report.
I have added it to our tracking board for future consideration, as we are not actively prioritising false positives right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants