Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CWE-1333 — Vulnerability Class 360

360 vulnerabilities classified as CWE-1333. AI Chinese analysis included.

CWE-1333 represents a software weakness where regular expressions exhibit inefficient, often exponential, worst-case computational complexity. This vulnerability is typically exploited through Regular Expression Denial of Service (ReDoS) attacks, where malicious actors craft specific input strings that trigger catastrophic backtracking within the regex engine. Such inputs force the processor to evaluate an excessive number of potential matches, consuming significant CPU resources and effectively halting application availability. To mitigate this risk, developers must prioritize regex optimization by avoiding nested quantifiers, minimizing ambiguity in pattern structures, and utilizing possessive quantifiers or atomic groups to prevent backtracking. Additionally, implementing strict input length limits and employing regex complexity analysis tools during the development lifecycle can help identify and eliminate inefficient patterns before deployment, ensuring robust application performance against adversarial inputs.

MITRE CWE Description
The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.
Common Consequences (1)
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.
Mitigations (4)
Architecture and Design Use regular expressions that do not support backtracking, e.g. by removing nested quantifiers.
Effectiveness: High
System Configuration Set 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.
Effectiveness: Moderate
Implementation Do not use regular expressions with untrusted input. If regular expressions must be used, avoid using backtracking in the expression.
Effectiveness: High
Implementation Limit the length of the input that the regular expression will process.
Effectiveness: Moderate
Examples (2)
This example attempts to check if an input string is a "sentence" [REF-1164].
var test_string = "Bad characters: $@#"; var bad_pattern  = /^(\w+\s?)*$/i; var result = test_string.search(bad_pattern);
Bad · JavaScript
var test_string = "Bad characters: $@#"; var good_pattern  = /^((?=(\w+))\2\s?)*$/i; var result = test_string.search(good_pattern);
Good · JavaScript
This example attempts to check if an input string is a "sentence" and is modified for Perl [REF-1164].
my $test_string = "Bad characters: \$\@\#"; my $bdrslt = $test_string; $bdrslt =~ /^(\w+\s?)*$/i;
Bad · Perl
my $test_string = "Bad characters: \$\@\#"; my $gdrslt = $test_string; $gdrslt =~ /^((?=(\w+))\2\s?)*$/i;
Good · Perl
CVE ID Title CVSS Severity Published
CVE-2022-36064 Shescape Inefficient Regular Expression Complexity vulnerability — shescape 5.9 Medium 2022-09-06
CVE-2022-29158 Regular Expression Denial of Service (ReDoS) vulnerability in Apache OFBiz — Apache OFBiz 7.5 - 2022-09-02
CVE-2021-43309 ReDoS in uri-template-lite URI.expand function — uri-template-lite 5.9 Medium 2022-08-24
CVE-2022-1930 ReDoS in eth-account encode_structured_data function — eth-account 5.9 Medium 2022-08-22
CVE-2022-2596 Inefficient Regular Expression Complexity in node-fetch/node-fetch — node-fetch/node-fetch 5.9 Medium 2022-08-01
CVE-2022-31147 jquery-validation ReDoS in url2 due to incomplete fix of CVE-2021-43306 — jquery-validation 7.5 High 2022-07-14
CVE-2022-31781 Regular Expression Denial of Service (ReDoS) in ContentType.java. (GHSL-2022-022) — Apache Tapestry 7.5 - 2022-07-13
CVE-2022-1929 Exponential ReDoS in devcert — devcert 5.9 Medium 2022-06-01
CVE-2021-43308 Exponential ReDoS in markdown-link-extractor — markdown-link-extractor 5.9 Medium 2022-06-01
CVE-2021-43307 Exponential ReDoS in semver-regex — semver-regex 5.9 Medium 2022-06-01
CVE-2021-43306 Exponential ReDoS in jquery-validation — jquery-validation 5.9 Medium 2022-06-01
CVE-2022-26650 Apache ShenYu (incubating) Regular expression denial of service — Apache ShenYu (incubating) 7.5 - 2022-05-17
CVE-2022-25598 Apache DolphinScheduler user registration is vulnerable to ReDoS attacks — Apache DolphinScheduler 7.5 - 2022-03-30
CVE-2021-3842 Inefficient Regular Expression Complexity in nltk/nltk — nltk/nltk 7.5 - 2022-01-04
CVE-2021-43805 ReDos vulnerability on guest checkout email validation — solidus 7.5 High 2021-12-07
CVE-2021-3765 Inefficient Regular Expression Complexity in validatorjs/validator.js — validatorjs/validator.js 7.5 - 2021-11-02
CVE-2021-3828 Inefficient Regular Expression Complexity in nltk/nltk — nltk/nltk 7.5 - 2021-09-27
CVE-2021-3822 Inefficient Regular Expression Complexity in josdejong/jsoneditor — josdejong/jsoneditor 7.5 - 2021-09-27
CVE-2021-3820 Inefficient Regular Expression Complexity in pksunkara/inflect — pksunkara/inflect 7.5 - 2021-09-27
CVE-2021-3810 Inefficient Regular Expression Complexity in cdr/code-server — cdr/code-server 7.5 - 2021-09-17
CVE-2021-3804 Inefficient Regular Expression Complexity in nervjs/taro — nervjs/taro 7.5 - 2021-09-17
CVE-2021-3803 Inefficient Regular Expression Complexity in fb55/nth-check — fb55/nth-check 7.5 - 2021-09-17
CVE-2021-3807 Inefficient Regular Expression Complexity in chalk/ansi-regex — chalk/ansi-regex 7.5 - 2021-09-17
CVE-2021-3795 Inefficient Regular Expression Complexity in sindresorhus/semver-regex — sindresorhus/semver-regex 7.5 - 2021-09-15
CVE-2021-3801 Inefficient Regular Expression Complexity in prismjs/prism — prismjs/prism 7.5 - 2021-09-15
CVE-2021-3794 Inefficient Regular Expression Complexity in vuelidate/vuelidate — vuelidate/vuelidate 7.5 - 2021-09-15
CVE-2021-3777 Inefficient Regular Expression Complexity in daaku/nodejs-tmpl — daaku/nodejs-tmpl 7.5 - 2021-09-15
CVE-2021-3749 Inefficient Regular Expression Complexity in axios/axios — axios/axios 7.5 - 2021-08-31
CVE-2021-3649 Inefficient Regular Expression Complexity in chatwoot/chatwoot — chatwoot/chatwoot 7.5 - 2021-07-16
CVE-2020-1920 React Native代码问题漏洞 — react-native 7.5 - 2021-06-01

Vulnerabilities classified as CWE-1333 represent 360 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.