Skip to content

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

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

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

Conversation

@mudcube

@mudcube mudcube commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: The web_fetch tool used reqwest::blocking::get without 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_ip helper to block loopback, private, unspecified, multicast, broadcast, and link-local IPs. Configured the reqwest client to disable automatic redirects and used ClientBuilder::resolve() to pin the manually validated IP for each hop, preventing TOCTOU DNS rebinding without breaking SNI.
βœ… Verification: Ran cargo check -p mill-plugin-system and cargo test -p mill-plugin-system.


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

Co-authored-by: mudcube <101564+mudcube@users.noreply.github.com>
@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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying typemill with Β Cloudflare Pages Β Cloudflare Pages

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

View logs

@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: 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".

Comment on lines +345 to +349
// Block multicast (224.0.0.0/4)
if (224..=239).contains(&octets[0]) {
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 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 πŸ‘Β / πŸ‘Ž.

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