Skip to content

Add SafeRegex module to have centralized regex match #25

Open
adbatista wants to merge 2 commits into
masterfrom
adb/validate-task-params
Open

Add SafeRegex module to have centralized regex match #25
adbatista wants to merge 2 commits into
masterfrom
adb/validate-task-params

Conversation

@adbatista
Copy link
Copy Markdown

Summary

Add Util.SafeRegex — bounded regex matching for parameter input format validation. Caps pattern at 512 bytes, value at 4096 bytes, and relies on PCRE's match_limit to short-circuit runaway matches (basic ReDoS mitigation).

Test plan

  • has tests

adbatista and others added 2 commits May 8, 2026 14:55
Extracted from Front.SafeRegex and Scheduler.SafeRegex (near-duplicate
copies kept in sync by hand). Caps pattern at 512 bytes and value at
4096 bytes; relies on PCRE's match_limit to short-circuit runaway
matches. Public API: max_pattern_length/0, max_value_length/0,
validate_pattern/1, match/2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@adbatista adbatista changed the title Adb/validate task params Add SafeRegex module to have centralized regex match May 8, 2026
@adbatista adbatista marked this pull request as ready for review May 8, 2026 21:19
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