Skip to content

feat(parser): add fuel-based operation limit to prevent DoS#66

Merged
chaliy merged 1 commit intomainfrom
claude/parser-fuel-at3RT
Feb 2, 2026
Merged

feat(parser): add fuel-based operation limit to prevent DoS#66
chaliy merged 1 commit intomainfrom
claude/parser-fuel-at3RT

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 2, 2026

Summary

  • Add parser fuel tracking (tick() on every token advance)
  • Add max_parser_operations field to ExecutionLimits (default: 100,000)
  • Add ParserExhausted variant to LimitExceeded error enum
  • Add Parser::with_fuel() constructor for custom limits
  • Integrate with Bash::exec() to use configured limits

Security: Prevents V3 (Parser Hang) attacks from threat model by limiting parser CPU consumption.

Test plan

  • Run cargo test - all tests pass
  • Run cargo clippy - no warnings

https://claude.ai/code/session_018gzyudqmPsjaDgCxmKVLtg

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chaliy chaliy force-pushed the claude/parser-fuel-at3RT branch from 1a98180 to db53737 Compare February 2, 2026 06:41
Add parser fuel tracking to prevent CPU exhaustion from pathological input:
- Parser tracks fuel consumption on every token advance
- Default limit: 100,000 operations (matches ExecutionLimits)
- Parser::with_fuel() constructor for custom limits
- Bash::exec() uses configured limits from ExecutionLimits
- Error: Parse("parser fuel exhausted (N operations, max M)")

Security: Prevents V3 (Parser Hang) attacks from threat model.

https://claude.ai/code/session_018gzyudqmPsjaDgCxmKVLtg
@chaliy chaliy force-pushed the claude/parser-fuel-at3RT branch from db53737 to 26bea6b Compare February 2, 2026 06:43
@chaliy chaliy merged commit 0025f6b into main Feb 2, 2026
7 checks passed
@chaliy chaliy deleted the claude/parser-fuel-at3RT branch February 2, 2026 06:51
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.

2 participants