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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-624 (可执行体正则表达式错误) — Vulnerability Class 2

2 vulnerabilities classified as CWE-624 (可执行体正则表达式错误). AI Chinese analysis included.

CWE-624 represents a critical weakness where regular expressions contain executable components influenced by user-controlled inputs or allow execution via inserted pattern modifiers. This vulnerability is typically exploited when attackers manipulate input to inject malicious code into the regex engine, effectively turning pattern matching into arbitrary code execution. For instance, in PHP’s preg_replace() function, an attacker might supply a string containing special modifiers that alter the regex behavior, leading to unintended side effects or remote code execution. To prevent this, developers must strictly validate and sanitize all user inputs before they are incorporated into regular expression patterns. Additionally, using safe APIs that do not support executable regex features or employing static analysis tools to detect dangerous patterns can significantly mitigate the risk of such exploits.

MITRE CWE Description
The product uses a regular expression that either (1) contains an executable component with user-controlled inputs, or (2) allows a user to enable execution by inserting pattern modifiers. Case (2) is possible in the PHP preg_replace() function, and possibly in other languages when a user-controlled input is inserted into a string that is later parsed as a regular expression.
Common Consequences (1)
Confidentiality, Integrity, AvailabilityExecute Unauthorized Code or Commands
Mitigations (1)
ImplementationThe regular expression feature in some languages allows inputs to be quoted or escaped before insertion, such as \Q and \E in Perl.

Vulnerabilities classified as CWE-624 (可执行体正则表达式错误) represent 2 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.