1 vulnerabilities classified as CWE-777. AI Chinese analysis included.
CWE-777 represents a critical input validation weakness where regular expressions lack proper anchoring, allowing malicious data to bypass security controls. This flaw typically occurs when developers use patterns to sanitize or validate user input without enforcing strict boundaries, such as missing start (^) or end ($) anchors. Attackers exploit this by injecting carefully crafted payloads that partially match the allowed pattern, effectively slipping through neutralization mechanisms intended to filter out harmful content. For instance, a regex designed to block specific keywords might fail if an attacker appends the keyword to a valid string. To prevent this, developers must ensure all regular expressions used for validation are fully anchored, explicitly defining the start and end of the expected input. This guarantees that only complete, well-formed strings matching the entire pattern are accepted, eliminating the risk of partial matches enabling injection attacks or data corruption.
$dir = "/home/cwe/languages"; $lang = $_GET['lang']; if (preg_match("/[A-Za-z0-9]+/", $lang)) { include("$dir/$lang"); } else { echo "You shall not pass!\n"; }../../etc/passwdimport subprocess import re def validate_ip_regex(ip: str): ip_validator = re.compile(r"((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}") if ip_validator.match(ip): return ip else: raise ValueError("IP address does not match valid pattern.") def run_ping_regex(ip: str): validated = validate_ip_regex(ip) # The ping command treats zero-prepended IP addresses as octal result = subprocess.call(["ping", validated]) print(result)| CVE ID | Title | CVSS | Severity | Published |
|---|---|---|---|---|
| CVE-2026-40110 | jupyter-server CORS origin validation bypass via unanchored regex in allow_origin_pat — jupyter_server | - | - | 2026-05-05 |
Vulnerabilities classified as CWE-777 represent 1 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.