Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix SSRF in web_fetch#580

Open
mudcube wants to merge 1 commit into
mainfrom
sentinel-fix-ssrf-web-fetch-8098961338877017312
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix SSRF in web_fetch#580
mudcube wants to merge 1 commit into
mainfrom
sentinel-fix-ssrf-web-fetch-8098961338877017312

Conversation

@mudcube

@mudcube mudcube commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: The web_fetch tool in mill-plugin-system used reqwest::blocking::get directly 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 get with an iterative IP resolution and validation loop:

  • Resolves target hostname into all its IP addresses via std::net::ToSocketAddrs.
  • Validates every IP using a robust custom is_allowed_ip check, explicitly failing if loopback, private, unspecified, or local subnets (both IPv4 and IPv6 mapped) are returned.
  • Mitigates DNS Rebinding attacks by passing the validated IP directly to reqwest using .resolve(host, pinned_ip), pinning the connection without breaking SNI.
  • Mitigates indirect SSRF via HTTP redirects by disabling automatic redirects and implementing a secure tracking loop that resolves and validates redirect targets sequentially.
    βœ… Verification: Hand-tested with malicious local inputs (e.g., 127.0.0.1, 0.0.0.0), ran cargo check, cargo test -p mill-plugin-system, and linted cleanly. Added to .jules/sentinel.md journal.

PR created automatically by Jules for task 8098961338877017312 started by @mudcube

Co-authored-by: mudcube <101564+mudcube@users.noreply.github.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 3, 2026

Copy link
Copy Markdown

Deploying typemill with Β Cloudflare Pages Β Cloudflare Pages

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

View logs

@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 πŸ‘Β / πŸ‘Ž.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant