🛡️ Sentinel: Enforce max version string length (DoS prevention)#799
🛡️ Sentinel: Enforce max version string length (DoS prevention)#799google-labs-jules[bot] wants to merge 1 commit intomainfrom
Conversation
Add `MAX_VERSION_LENGTH` constant (256) to prevent processing of excessively long strings in `compareTo`, mitigating potential DoS/CPU exhaustion risks. Input strings exceeding this limit now return NaN (fail-closed).
|
👋 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. |
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #799 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 46 49 +3
Branches 16 17 +1
=========================================
+ Hits 46 49 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Superseded by #826 - closing duplicate bot-generated PR |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
🛡️ Sentinel: [MEDIUM] Fix DoS risk via long input strings
Severity: MEDIUM
Vulnerability: The version comparison logic accepted strings of arbitrary length. Extremely long strings could cause CPU exhaustion or OOM due to internal string operations (
replace,split) and regex checks.Impact: Denial of Service (DoS) if user-supplied input is passed unchecked to the library.
Fix: Enforced a
MAX_VERSION_LENGTHof 256 characters. Inputs longer than this are immediately rejected (returnNaN), preserving existing fail-closed behavior.Verification: Added a test case in
src/security.test.tsverifying that a string of 300 characters is rejected.PR created automatically by Jules for task 4012677338304431508 started by @srod
Summary by cubic
Enforces a 256-character max for version strings to prevent DoS from extremely long inputs. Inputs over the limit now fail closed by returning NaN.
Written for commit f598875. Summary will update on new commits.