1. CVE archive
  2. Vulnerability types
  3. CWE-186
CWE-186 · #576 most frequent type in the archive

Overly Restrictive Regular Expression

A regular expression is overly restrictive in a way that does not match all intended values.

Part of: CWE-185 · Incorrect Regular Expression

3CVEs of this type in the archive
0critical (CVSS ≥ 9)
0high severity (7–8.9)
Nov 25, 2026latest published

What it is

A regular expression is overly restrictive in a way that does not match all intended values.

Impact on systems

ScopeImpact
Access Control Bypass Protection Mechanism, Varies by Context
An overly restrictive regexp misses some potentially security-relevant values, leading to either false positives *or* false negatives, depending on how the regexp is being used within the code.

How to prevent it

Implementation · Refactoring Regular expressions can become error prone when defining a complex language even for those experienced in writing grammars. Determine if several smaller regular expressions simplify one large regular expression. Also, subject your regular expression to thorough testing techniques such as equivalence partitioning, boundary value analysis, and robustness. After testing and a reasonable confidence level is achieved, a regular expression may not be foolproof. If an exploit is allowed to slip through, then record the exploit and refactor your regular expression.

Source: MITRE CWE catalog · Official entry on the MITRE website

CWE-186 CVEs published per year

2026: year in progress, updated every hour

Show the data as a table
YearCVE
20251
20262

All CWE-186 CVEs

3 results

Dottor Marc

Is this type of vulnerability in your systems?

An archive tells you what exists; a Vulnerability Assessment tells you what is exposed on your side. Dottor Marc tests your web applications and network with automated and manual checks.