Skip to content

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

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

πŸ›‘οΈ Sentinel: [HIGH] Fix SSRF vulnerability in background workers#85
frkr wants to merge 1 commit into
mainfrom
sentinel/fix-ssrf-background-workers-1502159186315946944

Conversation

@frkr

@frkr frkr commented Jul 23, 2026

Copy link
Copy Markdown
Owner

🚨 Severity: HIGH
πŸ’‘ Vulnerability: Server-Side Request Forgery (SSRF) vulnerability in background workers processing messages. The workers blindly passed asyncContent.destiny and asyncContent.callback to fetch() without verifying the URL protocol. This meant that an attacker who managed to queue an asynchronous message could supply a non-HTTP URL (like file://, ftp://, etc.) causing the worker to interact with internal or unexpected external systems.
🎯 Impact: High. Depending on the Cloudflare Worker runtime restrictions or eventual deployment context, fetching unintended protocols or internal endpoints can lead to data leakage, bypassing network access controls, and probing internal infrastructure.
πŸ”§ Fix:

  • Handled potential errors when parsing URLs by wrapping new URL() in a try/catch block.
  • Implemented protocol validation ensuring that the URL uses the http: or https: scheme.
  • If an invalid or unallowed protocol is detected, the message state is immediately set to 'error' and processing returns early, preventing infinite loops and dangerous operations.
    βœ… Verification: Tested against the full test suite (pnpm test), ensuring that 12 test files passed successfully, without regressions.

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

Added protocol validation in `src/mq/MQDestiny.ts` and `src/mq/MQCallback.ts` to ensure that only `http:` and `https:` URLs are fetched, mitigating Server-Side Request Forgery (SSRF) vulnerabilities where attackers could use malicious protocols like `file://` or `ftp://`.

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