CWE•Base•Draft•20 recent CVEs
CWE-1333Inefficient Regular Expression Complexity
Description
The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.
Common consequences
- Availability→DoS: Resource Consumption (CPU)Attackers can create crafted inputs that intentionally cause the regular expression to use excessive backtracking in a way that causes the CPU consumption to spike.
Potential mitigations
- Architecture and DesignUse regular expressions that do not support backtracking, e.g. by removing nested quantifiers.
- System ConfigurationSet backtracking limits in the configuration of the regular expression implementation, such as PHP's pcre.backtrack_limit. Also consider limits on execution time for the process.
- ImplementationDo not use regular expressions with untrusted input. If regular expressions must be used, avoid using backtracking in the expression.
- ImplementationLimit the length of the input that the regular expression will process.
Related CWEs
Recent CVEs classified under this CWE
CVE-2026-826172026-09-11CVE-2026-684977.52026-09-11CVE-2026-758806.52026-09-10CVE-2026-878197.52026-09-09CVE-2026-860812026-09-08CVE-2026-850622026-09-03CVE-2026-846427.52026-09-01CVE-2026-836192026-09-01CVE-2026-836062026-09-01CVE-2024-583795.32026-08-31CVE-2026-555202026-08-28CVE-2026-802065.92026-08-26CVE-2026-802057.52026-08-26CVE-2026-797707.52026-08-25CVE-2026-667667.52026-08-25CVE-2026-706564.92026-08-21CVE-2026-728187.52026-08-20CVE-2026-770824.32026-08-20CVE-2026-623177.52026-08-19CVE-2026-626722026-08-19