π‘οΈ Sentinel: [CRITICAL] Fix SSRF in web_fetch#580
Conversation
Co-authored-by: mudcube <101564+mudcube@users.noreply.github.com>
Deploying typemill with Β
|
| Latest commit: |
6e81882
|
| Status: | Β β Β Deploy successful! |
| Preview URL: | https://c418a9dc.typemill.pages.dev |
| Branch Preview URL: | https://sentinel-fix-ssrf-web-fetch-8c7k.typemill.pages.dev |
|
π 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. |
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e81882680
βΉοΈ 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".
| if octets[0] == 169 && octets[1] == 254 { | ||
| return false; | ||
| } | ||
| true |
There was a problem hiding this comment.
Block shared internal IPv4 ranges
Because this fall-through allows every IPv4 address not explicitly listed, web_fetch still permits non-public ranges such as 100.64.0.0/10 and 198.18.0.0/15. In deployments that use those ranges for VPC/container/internal services, an attacker can fetch http://100.64.x.y/... and bypass the SSRF protection even though the address is not globally routable; the allowlist should reject all special-use/non-global ranges, not just RFC1918/link-local.
Useful? React with πΒ / π.
π¨ Severity: CRITICAL
π‘ Vulnerability: The
web_fetchtool inmill-plugin-systemusedreqwest::blocking::getdirectly without IP validation, allowing Server-Side Request Forgery (SSRF) where attackers could reach internal or private network services.π― Impact: Attackers could access internal infrastructure, query cloud metadata services, and scan internal networks from the TypeMill server.
π§ Fix: Replaced direct
getwith an iterative IP resolution and validation loop:std::net::ToSocketAddrs.is_allowed_ipcheck, explicitly failing if loopback, private, unspecified, or local subnets (both IPv4 and IPv6 mapped) are returned.reqwestusing.resolve(host, pinned_ip), pinning the connection without breaking SNI.β Verification: Hand-tested with malicious local inputs (e.g.,
127.0.0.1,0.0.0.0), rancargo check,cargo test -p mill-plugin-system, and linted cleanly. Added to.jules/sentinel.mdjournal.PR created automatically by Jules for task 8098961338877017312 started by @mudcube