π‘οΈ Sentinel: [CRITICAL] Fix ReDoS and info leak in API#291
Conversation
Co-authored-by: hadsern <5723837+hadsern@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: CRITICAL
π‘ Vulnerability:
new RegExp(), leaving the API susceptible to resource-exhaustion attacks from malicious payloads.error.message), which could expose sensitive internal server/stack information.π― Impact: Malicious actors could perform a Denial of Service attack using complex regular expression string payloads causing the Node.js event loop to block, leading to server unresponsiveness. Furthermore, explicit error messages could leak environment, database, or network implementation details useful for reconnaissance.
π§ Fix:
new RegExpmatch evaluation with a purely string-basedindexOfloop counting occurrences safely, with bounds checking to avoid infinite loops.detailsfield returningerror.messagefrom the 500 JSON response explicitly.β Verification: Verified by checking that
contentMatchesaccurately usesindexOflogic and by asserting that theFailed to process questionerror block only returns the generic error without the internal details field. Ran tests and build check.PR created automatically by Jules for task 11561901099064455664 started by @hadsern