π‘οΈ Sentinel: [CRITICAL] Fix SSRF vulnerability in web_fetch tool#594
π‘οΈ Sentinel: [CRITICAL] Fix SSRF vulnerability in web_fetch tool#594mudcube wants to merge 1 commit into
Conversation
Co-authored-by: mudcube <101564+mudcube@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Deploying typemill with Β
|
| Latest commit: |
c18c3d0
|
| Status: | Β β Β Deploy successful! |
| Preview URL: | https://c0599560.typemill.pages.dev |
| Branch Preview URL: | https://sentinel-fix-ssrf-web-fetch-a45m.typemill.pages.dev |
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c18c3d06cd
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Block multicast (224.0.0.0/4) | ||
| if (224..=239).contains(&octets[0]) { | ||
| return false; | ||
| } | ||
| true |
There was a problem hiding this comment.
Block non-global IPv4 ranges in SSRF filter
This fallback allows any IPv4 address that is not RFC1918/loopback/link-local/multicast/broadcast, so web_fetch still accepts non-global ranges such as 100.64.0.0/10 and 198.18.0.0/15. In environments that place internal services on shared-address or benchmarking ranges, an attacker-controlled hostname resolving there will pass validation and the pinned request will still SSRF those internal endpoints; the filter should reject all non-global/special-use IPv4 ranges rather than returning true here.
Useful? React with πΒ / π.
π¨ Severity: CRITICAL
π‘ Vulnerability: The
web_fetchtool usedreqwest::blocking::getwithout validating the resolved IP address, which allows an attacker to make requests to internal services or private IP addresses via Server-Side Request Forgery (SSRF).π― Impact: Attackers could access internal services, read sensitive metadata endpoints (e.g., AWS IMDS), or scan internal networks.
π§ Fix: Implemented an IP pinning mechanism with manual redirect tracking. Created a custom
is_allowed_iphelper to block loopback, private, unspecified, multicast, broadcast, and link-local IPs. Configured thereqwestclient to disable automatic redirects and usedClientBuilder::resolve()to pin the manually validated IP for each hop, preventing TOCTOU DNS rebinding without breaking SNI.β Verification: Ran
cargo check -p mill-plugin-systemandcargo test -p mill-plugin-system.PR created automatically by Jules for task 11692208846023727398 started by @mudcube