π‘οΈ Sentinel: [HIGH] Fix SSRF vulnerability in MQ queue fetch handlers - #88
π‘οΈ Sentinel: [HIGH] Fix SSRF vulnerability in MQ queue fetch handlers#88frkr wants to merge 1 commit into
Conversation
β¦back handlers - Added protocol validation (`http:` or `https:`) for dynamic URLs passed to `fetch()` in `src/mq/MQDestiny.ts` and `src/mq/MQCallback.ts`. - Validates URLs through the native `URL` constructor which safely throws on malformed URLs. - Invalid or dangerous protocols (e.g. `file://`, `ftp://`) now abort execution and correctly log the message as 'error' in `MQStore` rather than creating an infinite retry loop or exposing internal systems. Co-authored-by: frkr <185359+frkr@users.noreply.github.com>
|
π 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: HIGH
π‘ Vulnerability: Server-Side Request Forgery (SSRF). The queue processors (
MQDestiny.tsandMQCallback.ts) were consuming destination and callback URLs originating from database/R2 state without validating the protocol schema before passing them to the server-sidefetch()API.π― Impact: Maliciously crafted messages in the queue (or bypassed frontend validations) could trick the backend worker into making requests to unauthorized internal systems, using dangerous schemes like
file://orftp://, or creating endless retry loops for invalid URLs.π§ Fix: Utilized the native V8
new URL()to parse and validate the URLs. Explicitly enforced that the URL protocol must be exactlyhttp:orhttps:. Invalid URLs or unsupported protocols will be caught securely and marked with anerrorstate inMQStoreto avoid retry loops without executing the fetch.β Verification: Ran
pnpm testsuccessfully. Tests for the MQ processors and panel paths successfully pass with no regressions.PR created automatically by Jules for task 4238088066636652976 started by @frkr