CWE-625: Permissive Regular Expression
19 CVEs have CWE-625 as their primary weakness. 0 of them are in the CISA KEV catalog. The highest EPSS score among them is 1.681%.
The product uses a regular expression that does not sufficiently restrict the set of allowed values.
Child of CWE-185: Incorrect Regular Expression
Mitigations
- Implementation: When applicable, ensure that the regular expression marks beginning and ending string patterns, such as /^string$/ for Perl.
Observed examples
- CVE-2021-22204: Chain: regex in EXIF processor code does not correctly determine where a string ends (CWE-625), enabling eval injection (CWE-95), as exploited in the wild per CISA KEV.
- CVE-2006-1895: .* regexp leads to static code injection
- CVE-2002-2175: insertion of username into regexp results in partial comparison, causing wrong database entry to be updated when one username is a substring of another.
- CVE-2006-4527: regexp intended to verify that all characters are legal, only checks that at least one is legal, enabling file inclusion.
- CVE-2005-1949: Regexp for IP address isn't anchored at the end, allowing appending of shell metacharacters.
- CVE-2002-2109: Regexp isn't anchored to the beginning or end, which allows spoofed values that have trusted values as substrings.
- CVE-2006-6511: regexp in .htaccess file allows access of files whose names contain certain substrings
- CVE-2006-6629: allow load of macro files whose names contain certain substrings.
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-625'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-625'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).