Skip to content

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

Closed
seonghobae wants to merge 2 commits into
mainfrom
sentinel-ssrf-hostname-validation-469850485368275234
Closed

πŸ›‘οΈ Sentinel: [CRITICAL] Fix Server-Side Request Forgery (SSRF)#1344
seonghobae wants to merge 2 commits into
mainfrom
sentinel-ssrf-hostname-validation-469850485368275234

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: Server-Side Request Forgery (SSRF) in wait_for_url helper function within scripts/ci/sandboxed_web_e2e.py.
🎯 Impact: Attackers controlling the readiness URL could potentially access arbitrary internal resources or loopback services, leading to internal network reconnaissance or interaction with sensitive local endpoints.
πŸ”§ Fix: Added strict hostname validation using urllib.parse.urlparse to ensure only localhost and 127.0.0.1 are permitted. Additionally, updated tests/test_sandboxed_web_e2e.py to maintain 100% test coverage and appended the related learning to the Sentinel journal.
βœ… Verification: Ran test suite with 100% code coverage. Bandit reports no new security vulnerabilities.


PR created automatically by Jules for task 469850485368275234 started by @seonghobae


Open in Devin Review

This commit implements a hostname validation in the `wait_for_url` function to prevent Server-Side Request Forgery (SSRF) vulnerabilities. Validating URL schemes is insufficient to prevent SSRF if the URL can target arbitrary external or internal hosts. A malicious URL could target internal network services.

By using `urllib.parse.urlparse`, we validate that the parsed URL hostname is restricted to safe loopback addresses (`localhost` or `127.0.0.1`) before opening the URL when making network requests in CI scripts.

The `.jules/sentinel.md` journal is also updated with this learning. Tests and test coverage have been maintained at 100%.
@google-labs-jules

Copy link
Copy Markdown

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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 26 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

βš™οΈ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 78fc9175-f50e-44ae-868e-c5b5c773c47f

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 33dc57d and 82f112f.

πŸ“’ Files selected for processing (3)
  • .jules/sentinel.md
  • scripts/ci/sandboxed_web_e2e.py
  • tests/test_sandboxed_web_e2e.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines +127 to +128
if parsed.hostname not in {"localhost", "127.0.0.1"}:
raise ValueError(f"URL must target localhost or 127.0.0.1 to prevent SSRF, got: {parsed.hostname}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

πŸ” Allowlist rejects other loopback forms

The hostname allowlist permits only localhost and 127.0.0.1. Readiness URLs using [::1], 0.0.0.0, or other 127.x.x.x addresses now raise ValueError, breaking any CI config that relies on them.

Open in Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

@seonghobae
seonghobae enabled auto-merge (squash) August 25, 2026 22:03
@opencode-agent
opencode-agent Bot disabled auto-merge August 25, 2026 22:49
@seonghobae
seonghobae enabled auto-merge (squash) August 25, 2026 23:13
@seonghobae

Copy link
Copy Markdown
Contributor Author

Superseded by PR #1342, which carries the loopback SSRF fix plus required bubblewrap OS isolation for backend/frontend/E2E processes. Closing this duplicate so only the hardened implementation proceeds.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Closed as superseded by #1342.

@seonghobae seonghobae closed this Aug 25, 2026
auto-merge was automatically disabled August 25, 2026 23:34

Pull request was closed

@google-labs-jules

Copy link
Copy Markdown

Superseded by PR #1342, which carries the loopback SSRF fix plus required bubblewrap OS isolation for backend/frontend/E2E processes. Closing this duplicate so only the hardened implementation proceeds.

Understood. Acknowledging that this work is superseded by PR #1342 and stopping work on this task.

@google-labs-jules

Copy link
Copy Markdown

Closed as superseded by #1342.

Acknowledged.

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