Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix Server-Side Request Forgery (SSRF) vulnerabilities - #232

Open
himattm wants to merge 1 commit into
mainfrom
sentinel/ssrf-prevention-10951292170685207095
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix Server-Side Request Forgery (SSRF) vulnerabilities#232
himattm wants to merge 1 commit into
mainfrom
sentinel/ssrf-prevention-10951292170685207095

Conversation

@himattm

@himattm himattm commented Aug 2, 2026

Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: internal/plugin/manager.go used http.Get() to fetch plugins from untrusted, user-provided URLs without restricting the resolved IP addresses, leading to potential Server-Side Request Forgery (SSRF). This could allow an attacker to bypass firewalls and access restricted internal networks, such as cloud metadata endpoints (e.g., 169.254.169.254).
🎯 Impact: Attackers could potentially extract sensitive credentials or enumerate internal infrastructure by tricking the application into making unauthorized HTTP requests.
πŸ”§ Fix: Replaced http.Get() with a custom http.Client initialized via newSafeClient(). This client utilizes a net.Dialer with a Control hook that evaluates the resolved IP address after DNS resolution but before the socket connection is made, effectively blocking restricted IPs like 169.254.169.254 and preventing DNS rebinding attacks. Also disabled KeepAlives on the custom transport since these clients are one-off.
βœ… Verification: Ensure the test suite passes (go test ./...) and that attempting to add a plugin from a prohibited IP (e.g., http://169.254.169.254/plugin.sh) fails with the intended forbidden error.


PR created automatically by Jules for task 10951292170685207095 started by @himattm

Added a custom `net.Dialer` with a `Control` hook to prevent SSRF attacks when fetching plugins from user-provided URLs. The hook verifies the resolved IP address against restricted ranges (e.g., cloud metadata endpoints) before the socket connection is established. This ensures robust protection against DNS rebinding and IP obfuscation. Disables KeepAlives on the custom transport to avoid connection leaks since clients are instantiated per request.

Co-authored-by: himattm <6266621+himattm@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.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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