Repository navigation
server side request forgery filter - #4
Conversation
There was a problem hiding this comment.
Note
Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| if (!isSafeHost(u.getHost())) { //check host of the URL object we actually connect to | ||
| throw new IOException("blocked request to non-public host " + u.getHost()); | ||
| } | ||
| HttpURLConnection c = (HttpURLConnection)u.openConnection(); |
There was a problem hiding this comment.
🟥 DNS rebinding reaches private hosts
With DNS caching disabled or expired, open can connect to a private address after validating a public one. HttpURLConnection resolves the hostname again for the socket, so an attacker-controlled DNS answer can change between resolutions.
Was this helpful? React with 👍 or 👎 to provide feedback.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
jl-0
left a comment
There was a problem hiding this comment.
Looks good, added one update for S3 urls
…service into feature/ssrf-filter # Conflicts: # src/main/java/jpl/mipl/mars/mis/MISParams.java
| int colon = host.indexOf(':'); | ||
| if (colon >= 0) { | ||
| host = host.substring(0, colon); //strip port |
There was a problem hiding this comment.
🟡 Explicit-port S3 images fail in CLI
For https://bucket.s3.amazonaws.com:443/image.IMG, isS3Url now selects S3 instead of HTTP. The CLI creates no S3 client for HTTPS inputs, so the image fails with S3 service required.
Learn more
The CLI builds an S3 client only for s3:// inputs in MISCLI. An HTTPS S3 address containing a port previously failed the old S3 hostname check and was read via HTTP. Stripping the port now makes it an S3 input, but MISTask rejects it because no S3 client exists.
Example: --image https://bucket.s3.amazonaws.com:443/image.IMG -l 1 -s 1 selects S3, then fails before reading the image. The same public HTTPS object was previously reachable through the HTTP reader.
Recommended fix: Align the CLI's client initialization with S3Helper.isS3Url for accepted S3 HTTPS addresses, or keep HTTPS addresses that the CLI cannot handle through S3 on the HTTP path. Check both explicit-port and ordinary S3 HTTPS URLs.
Was this helpful? React with 👍 or 👎 to provide feedback.
|



harden URL handling in server side requests