Include Tests for Pathological Patterns to Ensure Backtracking Limits #16
Labels
No labels
Epic
GHA
Release
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
major
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
NiXTheDev/Ogex#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal: Protect against Regular Expression Denial of Service (ReDoS) by testing with exponential-time patterns.
Certain regex patterns (e.g.,
(a*)*,(a|a)*) can cause catastrophic backtracking. Without limits, the engine could hang or consume excessive CPU.Proposed Solution:
Implementation Steps:
backtrack_limitfield toRegexorNfaSimulator, defaulting to a high value (e.g., 10_000_000).RuntimeError.Example: