Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix event loop blocking in SSRF validation#121

Open
d3mocide wants to merge 1 commit into
mainfrom
fix-ssrf-event-loop-blocking-5840742459428934283
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix event loop blocking in SSRF validation#121
d3mocide wants to merge 1 commit into
mainfrom
fix-ssrf-event-loop-blocking-5840742459428934283

Conversation

@d3mocide

Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: The _validate_request_url event hook used to validate URLs in httpx.AsyncClient with follow_redirects=True in backend/routers/radio.py called validate_safe_url synchronously. Because validate_safe_url performs blocking DNS resolution (socket.getaddrinfo), executing it in an async context blocked the backend's main event loop, creating a Denial of Service (DoS) vulnerability.
🎯 Impact: Attackers could cause a severe latency and DoS under load.
πŸ”§ Fix: Modified _validate_request_url in backend/routers/radio.py to run validate_safe_url within a thread using await asyncio.get_running_loop().run_in_executor(None, validate_safe_url, str(request.url)) to avoid blocking the event loop.
βœ… Verification: Tested via unit tests for backend python3 -m unittest discover backend/tests. Added security learning entry to .jules/sentinel.md.


PR created automatically by Jules for task 5840742459428934283 started by @d3mocide

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

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