fix(security): [CRITICAL] resolve Denial of Service (DoS) vulnerability via State Exhaustion#165
fix(security): [CRITICAL] resolve Denial of Service (DoS) vulnerability via State Exhaustion#165Tugamer89 wants to merge 1 commit into
Conversation
…e Exhaustion Added a maximum state limit of 10000 to the AbstractAutomatonBuilder to prevent unconstrained resource consumption. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@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
Unconstrained Resource Consumption (CWE-400) allowing for Denial of Service (DoS) attacks via state exhaustion. The
AbstractAutomatonBuilderpreviously allowed an unbounded number of states to be programmatically added.Impact
An attacker could cause the application to crash due to memory exhaustion (OutOfMemoryError) by providing inputs or programmatic instructions that trigger the generation of an exceptionally large automaton.
Fix
Implemented a hardcoded
MAX_STATESlimit of 10,000 within theAbstractAutomatonBuilder. TheaddStatemethod now checks if this limit is exceeded before adding a new state, throwing anIllegalStateExceptionwith a secure error message if the threshold is breached.Verification
Ran the full test suite and formatting checks locally. All tests pass, ensuring that legitimate use cases involving up to 10,000 states continue to function normally, while unbounded state creation is securely blocked.
PR created automatically by Jules for task 9714217336291348821 started by @Tugamer89