Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix SSRF vulnerability in background workers - #94

Open
frkr wants to merge 1 commit into
mainfrom
sentinel-fix-ssrf-background-workers-620201129246789358
Open

frkr wants to merge 1 commit into
mainfrom
sentinel-fix-ssrf-background-workers-620201129246789358

Conversation

@frkr

@frkr frkr commented Sep 17, 2026

Copy link
Copy Markdown
Owner

🚨 Severity: HIGH

πŸ’‘ Vulnerability: The background queue workers (src/mq/MQDestiny.ts and src/mq/MQCallback.ts) were parsing URLs dynamically derived from queue messages and passing them directly into fetch() calls without explicitly validating the URL protocol (scheme). Because new URL() simply validates structural soundness, an attacker could supply file://, ftp://, or other non-HTTP schemes in the queue payload.

🎯 Impact: This enables Server-Side Request Forgery (SSRF). While Cloudflare Workers environments mitigate some standard node-based file:// risks, allowing unvalidated protocols in backend fetching services can lead to arbitrary probing, interacting with internal metadata endpoints, or bypassing network restrictions/egress filters.

πŸ”§ Fix: I introduced explicit URL protocol validation directly after new URL() parsing in both background workers. If the protocol is not strictly http: or https:, the worker throws an error, fails securely, and updates the queue message status to 'error' using MQStore, effectively stopping the bad request and preventing infinite retry loops.

βœ… Verification:

  • Added the URL protocol strict validation.
  • All unit tests (pnpm test) executed and passed successfully.
  • Code changes reviewed to ensure safe fallbacks.
  • Documented learning in .jules/sentinel.md.

PR created automatically by Jules for task 620201129246789358 started by @frkr

…RL protocols

Co-authored-by: frkr <185359+frkr@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.

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