CWE-185βIncorrect Regular Expression
PUBLISHEDweakness record
released 2006-07-19 Β· last modified 2026-04-30
Metadata
- CWE ID:
- CWE-185
- Abstraction:
- Class
- Structure:
- Simple
- Status:
- Draft
- Release Date:
- 2006-07-19
- Latest Modification Date:
- 2026-04-30
Weakness Name
Incorrect Regular Expression
Description
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.
Common Consequences
- Scope:
- Other
- Impact:
- Unexpected State, Varies by Context
- Notes:
- When the regular expression is not correctly specified, data might have a different format or type than the rest of the program expects, producing resultant weaknesses or errors.
- Scope:
- Access Control
- Impact:
- Bypass Protection Mechanism
- Notes:
- In PHP, regular expression checks can sometimes be bypassed with a null byte, leading to any number of weaknesses.