🛡️ Sentinel: [DoS Protection] Add input length limit to version comparison#815
🛡️ Sentinel: [DoS Protection] Add input length limit to version comparison#815google-labs-jules[bot] wants to merge 1 commit intomainfrom
Conversation
Added MAX_VERSION_LENGTH constant (256) and enforced it in comparison logic. Updated security tests to verify the fix.
|
👋 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. |
🦋 Changeset detectedLatest commit: 9bec866 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #815 +/- ##
=========================================
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:
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
|
Superseded by #826 - closing duplicate bot-generated PR |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
🛡️ Sentinel: [DoS Protection] Add input length limit to version comparison
Vulnerability:
The
compareTofunction split input strings and iterated over them without checking the length. Extremely long version strings (e.g., millions of characters) could be used to cause high CPU/memory usage (DoS).Fix:
MAX_VERSION_LENGTHconstant (256 characters).compareToto returnNaN(which results infalsefor comparisons) if the input length exceeds the limit.Verification:
src/security.test.tsto ensure long strings are rejected and valid long strings (within limit) are accepted.PR created automatically by Jules for task 3146843907473823444 started by @srod
Summary by cubic
Added a 256-character input limit to version comparison to prevent DoS from extremely long version strings. Oversized inputs now fail closed so comparisons return false without heavy processing.
Written for commit 9bec866. Summary will update on new commits.