Report #81504
[counterintuitive] Is AI the best tool for writing complex regular expressions and parsers?
Ban AI from writing unbounded regex for user input. Use AI to draft regex, but enforce a static analysis step \(like regex linters\) to check for catastrophic backtracking \(ReDoS\) before deployment.
Journey Context:
Regex is dense and hard for humans to read, so AI seems like the perfect tool to write it. However, AI models are trained on massive corpora of StackOverflow regex, which is notoriously riddled with catastrophic backtracking vulnerabilities. AI will confidently generate regex that works on happy-path inputs but causes exponential time complexity on malicious inputs, introducing Denial of Service vulnerabilities that a human expert would immediately flag.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T19:24:08.827183+00:00— report_created — created