CWE-185: Incorrect Regular Expression

ClassDraft

The product specifies a regular expression in a way that causes data to be improperly matched or compared.

View on MITRE
Back to CWE Lookup

Extended Description

When the regular expression is used in protection mechanisms such as filtering or validation, this may allow an attacker to bypass the intended restrictions on the incoming data.

Technical Details

Structure
Simple

Applicable To

Languages
Not Language-Specific
Platforms

Frequently Asked Questions

What is CWE-185: Incorrect Regular Expression?+

CWE-185: Incorrect Regular Expression is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product specifies a regular expression in a way that causes data to be improperly matched or compared. When the regular expression is used in protection mechanisms such as filtering or validation, this may allow an attacker to bypass the intended restrictions on the incoming data.

What are the security consequences of Incorrect Regular Expression?+

If exploited, CWE-185 (Incorrect Regular Expression) it can compromise Other and Access Control, leading to outcomes such as Unexpected State, Varies by Context and Bypass Protection Mechanism.

Which programming languages are affected by Incorrect Regular Expression?+

CWE-185 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Incorrect Regular Expression?+

MITRE documents real CVEs mapped to CWE-185, including CVE-2002-2109, CVE-2005-1949, CVE-2001-1072, CVE-2000-0115 and CVE-2002-1527. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-185 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More