Skip to content

fix(security): [CRITICAL] resolve Denial of Service (DoS) via memory exhaustion in manual automaton construction#154

Open
Tugamer89 wants to merge 1 commit into
mainfrom
fix-security-dos-memory-exhaustion-5785750246689795399
Open

fix(security): [CRITICAL] resolve Denial of Service (DoS) via memory exhaustion in manual automaton construction#154
Tugamer89 wants to merge 1 commit into
mainfrom
fix-security-dos-memory-exhaustion-5785750246689795399

Conversation

@Tugamer89

Copy link
Copy Markdown
Owner

Severity: CRITICAL
Vulnerability: Denial of Service (DoS) vulnerability due to unconstrained state allocation in AbstractAutomatonBuilder, leading to memory exhaustion (OOM).
Impact: An attacker could construct an automaton with an extremely large number of states, consuming all available JVM memory, crashing the application.
Fix: Introduced a constant MAX_STATES = 10000 in AbstractAutomatonBuilder and an explicit check inside addState() to limit the total number of states that can be allocated for any single automaton during manual construction. Exceeding this limit immediately throws an IllegalStateException.
Verification: Verified by creating a test that attempts to add > 10,000 states and checking that IllegalStateException is correctly thrown, and by confirming existing unit tests continue to pass correctly.


PR created automatically by Jules for task 5785750246689795399 started by @Tugamer89

…exhaustion in manual automaton construction

Added a MAX_STATES limit to the AbstractAutomatonBuilder to prevent unconstrained state allocations during manual automaton construction. This hard limit prevents Denial of Service (DoS) attacks caused by deliberate memory exhaustion or logic errors in user-provided automaton definitions.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant