CWE-186
AllowedOverly Restrictive Regular Expression
Abstraction: Base · Status: Draft
A regular expression is overly restrictive, which prevents dangerous values from being detected.
3 vulnerabilities reference this CWE, most recent first.
CVE-2026-121373 (GCVE-0-2026-121373)
Vulnerability from cvelistv5 – Published: 2026-11-04 12:59 – Updated: 2026-11-04 18:20| URL | Tags |
|---|---|
| https://github.com/symfony/symfony/security/advis… | third-party-advisory |
| https://github.com/symfony/symfony/commit/2d4c4fe… | patch |
| Vendor | Product | Version | |
|---|---|---|---|
| sensiolabs | symfony |
Affected:
6.1.0 , < 6.4.50
(git)
Affected: 7.0.0 , < 7.4.23 (git) Affected: 8.0.0 , < 8.1.11 (git) cpe:2.3:a:sensiolabs:symfony:*:*:*:*:*:*:*:* cpe:2.3:a:sensiolabs:symfony:*:*:*:*:*:*:*:* cpe:2.3:a:sensiolabs:symfony:*:*:*:*:*:*:*:* |
{
"containers": {
"adp": [
{
"metrics": [
{
"other": {
"content": {
"id": "CVE-2026-121373",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2026-11-04T17:49:00.814730Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2026-11-04T18:20:22.620Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
}
],
"cna": {
"affected": [
{
"collectionURL": "https://packagist.org/packages/symfony/html-sanitizer",
"defaultStatus": "unaffected",
"modules": [
"Symfony\\Component\\HtmlSanitizer\\Visitor\\AttributeSanitizer\\MetaRefreshAttributeSanitizer"
],
"packageName": "symfony/html-sanitizer",
"product": "symfony",
"repo": "https://github.com/symfony/html-sanitizer",
"vendor": "sensiolabs",
"versions": [
{
"lessThan": "6.4.50",
"status": "affected",
"version": "6.1.0",
"versionType": "git"
},
{
"lessThan": "7.4.23",
"status": "affected",
"version": "7.0.0",
"versionType": "git"
},
{
"lessThan": "8.1.11",
"status": "affected",
"version": "8.0.0",
"versionType": "git"
}
]
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:a:sensiolabs:symfony:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.4.50",
"versionStartIncluding": "6.1.0",
"vulnerable": true
},
{
"criteria": "cpe:2.3:a:sensiolabs:symfony:*:*:*:*:*:*:*:*",
"versionEndExcluding": "7.4.23",
"versionStartIncluding": "7.0.0",
"vulnerable": true
},
{
"criteria": "cpe:2.3:a:sensiolabs:symfony:*:*:*:*:*:*:*:*",
"versionEndExcluding": "8.1.11",
"versionStartIncluding": "8.0.0",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
],
"operator": "OR"
}
],
"credits": [
{
"lang": "en",
"type": "reporter",
"value": "Ilia Alshanetsky"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Nicolas Grekas"
}
],
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cdiv\u003eThe Symfony HtmlSanitizer component\u0026nbsp;\u003ccode\u003eMetaRefreshAttributeSanitizer\u003c/code\u003e\u003cspan\u003e, introduced to fix\u0026nbsp;\u003c/span\u003e\u003cspan\u003eCVE-2026-48761\u003c/span\u003e,\u0026nbsp;\u003cspan\u003es\u003c/span\u003e\u003cspan\u003eanitizes\u0026nbsp;\u003c/span\u003e\u003cspan\u003ethe refresh URL of\u0026nbsp;\u003c/span\u003e\u003ccode\u003econtent\u003c/code\u003e\u003cspan\u003e\u0026nbsp;attributes of\u0026nbsp;\u003c/span\u003e\u003ccode\u003emeta\u003c/code\u003e\u003cspan\u003e\u0026nbsp;tags using a regular expression that is too narrow, allowing sanitization to be bypassed, and resulting in potential URL redirection to untrusted sites in Symfony versions 6.1.x prior to\u0026nbsp;\u003c/span\u003e\u003cspan\u003e6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11.\u003c/span\u003e\u003c/div\u003e\u003cdiv\u003e\u003cspan\u003e\u003cbr\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv\u003eThe shared declarative refresh steps in the WHATWG HTML Standard\u0026nbsp;require a broader approach: the separator after the time may be ASCII whitespace alone, with no\u0026nbsp;\u003ccode\u003e;\u003c/code\u003e\u0026nbsp;or\u0026nbsp;\u003ccode\u003e,\u003c/code\u003e, and the\u0026nbsp;\u003ccode\u003eurl=\u003c/code\u003e\u0026nbsp;keyword is optional. Directives the browser honours, but the regular expression misses are returned unchanged, so the attacker URL skips\u0026nbsp;\u003ccode\u003eUrlSanitizer\u003c/code\u003e\u0026nbsp;entirely and both\u0026nbsp;\u003ccode\u003eallowLinkSchemes\u003c/code\u003e\u0026nbsp;and\u0026nbsp;\u003ccode\u003eallowLinkHosts\u003c/code\u003e\u0026nbsp;are defeated for the refresh navigation.\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis is reachable under any configuration that allows\u0026nbsp;\u003ccode\u003emeta\u003c/code\u003e\u0026nbsp;with\u0026nbsp;\u003ccode\u003ehttp-equiv\u003c/code\u003e\u0026nbsp;and\u0026nbsp;\u003ccode\u003econtent\u003c/code\u003e, including the documented\u0026nbsp;\u003ccode\u003eallowStaticElements()\u003c/code\u003e\u0026nbsp;preset.\u003c/div\u003e"
}
],
"value": "The Symfony HtmlSanitizer component\u00a0MetaRefreshAttributeSanitizer, introduced to fix\u00a0CVE-2026-48761,\u00a0sanitizes\u00a0the refresh URL of\u00a0content\u00a0attributes of\u00a0meta\u00a0tags using a regular expression that is too narrow, allowing sanitization to be bypassed, and resulting in potential URL redirection to untrusted sites in Symfony versions 6.1.x prior to\u00a06.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11.\n\n\n\n\nThe shared declarative refresh steps in the WHATWG HTML Standard\u00a0require a broader approach: the separator after the time may be ASCII whitespace alone, with no\u00a0;\u00a0or\u00a0,, and the\u00a0url=\u00a0keyword is optional. Directives the browser honours, but the regular expression misses are returned unchanged, so the attacker URL skips\u00a0UrlSanitizer\u00a0entirely and both\u00a0allowLinkSchemes\u00a0and\u00a0allowLinkHosts\u00a0are defeated for the refresh navigation.\n\n\n\n\nThis is reachable under any configuration that allows\u00a0meta\u00a0with\u00a0http-equiv\u00a0and\u00a0content, including the documented\u00a0allowStaticElements()\u00a0preset."
}
],
"metrics": [
{
"cvssV4_0": {
"Automatable": "NOT_DEFINED",
"Recovery": "NOT_DEFINED",
"Safety": "NOT_DEFINED",
"attackComplexity": "LOW",
"attackRequirements": "NONE",
"attackVector": "NETWORK",
"baseScore": 5.3,
"baseSeverity": "MEDIUM",
"exploitMaturity": "NOT_DEFINED",
"privilegesRequired": "NONE",
"providerUrgency": "NOT_DEFINED",
"subAvailabilityImpact": "NONE",
"subConfidentialityImpact": "LOW",
"subIntegrityImpact": "LOW",
"userInteraction": "PASSIVE",
"valueDensity": "NOT_DEFINED",
"vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N",
"version": "4.0",
"vulnAvailabilityImpact": "NONE",
"vulnConfidentialityImpact": "NONE",
"vulnIntegrityImpact": "NONE",
"vulnerabilityResponseEffort": "NOT_DEFINED"
},
"format": "CVSS",
"scenarios": [
{
"lang": "en",
"value": "GENERAL"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-186",
"description": "CWE-186 Overly restrictive regular expression",
"lang": "en",
"type": "CWE"
}
]
},
{
"descriptions": [
{
"cweId": "CWE-601",
"description": "CWE-601 URL redirection to untrusted site (\u0027open redirect\u0027)",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-11-04T18:14:54.592Z",
"orgId": "596c5446-0ce5-4ba2-aa66-48b3b757a647",
"shortName": "Checkmarx"
},
"references": [
{
"tags": [
"third-party-advisory"
],
"url": "https://github.com/symfony/symfony/security/advisories/GHSA-wm2w-4mgj-vw33"
},
{
"tags": [
"patch"
],
"url": "https://github.com/symfony/symfony/commit/2d4c4fe36200858b91132a95076fff3d9de89d26"
}
],
"source": {
"advisory": "GHSA-wm2w-4mgj-vw33",
"discovery": "UNKNOWN"
},
"title": "Symfony: HtmlSanitizer MetaRefreshAttributeSanitizer Matches Only a Narrow Subset of the Browser Refresh Grammar (Incomplete Fix for CVE-2026-48761)",
"x_generator": {
"engine": "Vulnogram 1.0.5"
}
}
},
"cveMetadata": {
"assignerOrgId": "596c5446-0ce5-4ba2-aa66-48b3b757a647",
"assignerShortName": "Checkmarx",
"cveId": "CVE-2026-121373",
"datePublished": "2026-11-04T12:59:22.585Z",
"dateReserved": "2026-11-03T11:38:38.187Z",
"dateUpdated": "2026-11-04T18:20:22.620Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}
CVE-2026-47241 (GCVE-0-2026-47241)
Vulnerability from cvelistv5 – Published: 2026-06-22 20:11 – Updated: 2026-06-23 14:16| URL | Tags |
|---|---|
| https://github.com/ruby/net-imap/security/advisor… | x_refsource_CONFIRM |
{
"containers": {
"adp": [
{
"metrics": [
{
"other": {
"content": {
"id": "CVE-2026-47241",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "yes"
},
{
"Technical Impact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2026-06-23T14:16:22.874467Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2026-06-23T14:16:32.846Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
}
],
"cna": {
"affected": [
{
"product": "net-imap",
"vendor": "ruby",
"versions": [
{
"status": "affected",
"version": "\u003e= 0.6.0, \u003c 0.6.4.1"
},
{
"status": "affected",
"version": "\u003c 0.5.15"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Prior to 0.6.5 and 0.5.15, several Net::IMAP commands accept a raw string argument which is only validated to prevent CRLF injection and then sent verbatim. If this string is derived from user-controlled input, an attacker can force the next command to be absorbed as a continuation of the first command. This will cause the first command to eventually fail, but also prevents it from returning until another command is sent (from another thread). That other command will not return until the connection is closed. This vulnerability is fixed in 0.6.5 and 0.5.15."
}
],
"metrics": [
{
"cvssV4_0": {
"attackComplexity": "LOW",
"attackRequirements": "PRESENT",
"attackVector": "NETWORK",
"baseScore": 2.1,
"baseSeverity": "LOW",
"privilegesRequired": "LOW",
"subAvailabilityImpact": "NONE",
"subConfidentialityImpact": "NONE",
"subIntegrityImpact": "NONE",
"userInteraction": "PASSIVE",
"vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N",
"version": "4.0",
"vulnAvailabilityImpact": "LOW",
"vulnConfidentialityImpact": "NONE",
"vulnIntegrityImpact": "NONE"
}
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-162",
"description": "CWE-162: Improper Neutralization of Trailing Special Elements",
"lang": "en",
"type": "CWE"
}
]
},
{
"descriptions": [
{
"cweId": "CWE-182",
"description": "CWE-182: Collapse of Data into Unsafe Value",
"lang": "en",
"type": "CWE"
}
]
},
{
"descriptions": [
{
"cweId": "CWE-186",
"description": "CWE-186: Overly Restrictive Regular Expression",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-06-22T20:11:04.329Z",
"orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"shortName": "GitHub_M"
},
"references": [
{
"name": "https://github.com/ruby/net-imap/security/advisories/GHSA-c4fp-cxrr-mj66",
"tags": [
"x_refsource_CONFIRM"
],
"url": "https://github.com/ruby/net-imap/security/advisories/GHSA-c4fp-cxrr-mj66"
}
],
"source": {
"advisory": "GHSA-c4fp-cxrr-mj66",
"discovery": "UNKNOWN"
},
"title": "Net::IMAP: Denial of Service via incomplete raw argument validation"
}
},
"cveMetadata": {
"assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"assignerShortName": "GitHub_M",
"cveId": "CVE-2026-47241",
"datePublished": "2026-06-22T20:11:04.329Z",
"dateReserved": "2026-05-18T22:54:18.272Z",
"dateUpdated": "2026-06-23T14:16:32.846Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}
CVE-2025-46821 (GCVE-0-2025-46821)
Vulnerability from cvelistv5 – Published: 2025-05-07 21:24 – Updated: 2025-05-08 14:11- CWE-186 - Overly Restrictive Regular Expression
| URL | Tags |
|---|---|
| https://github.com/envoyproxy/envoy/security/advi… | x_refsource_CONFIRM |
| Vendor | Product | Version | |
|---|---|---|---|
| envoyproxy | envoy |
Affected:
< 1.31.8
Affected: >= 1.32.0, < 1.32.6 Affected: >= 1.33.0, < 1.33.3 Affected: >= 1.34.0, < 1.34.1 |
{
"containers": {
"adp": [
{
"metrics": [
{
"other": {
"content": {
"id": "CVE-2025-46821",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "yes"
},
{
"Technical Impact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2025-05-08T13:43:52.581427Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2025-05-08T14:11:13.676Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
}
],
"cna": {
"affected": [
{
"product": "envoy",
"vendor": "envoyproxy",
"versions": [
{
"status": "affected",
"version": "\u003c 1.31.8"
},
{
"status": "affected",
"version": "\u003e= 1.32.0, \u003c 1.32.6"
},
{
"status": "affected",
"version": "\u003e= 1.33.0, \u003c 1.33.3"
},
{
"status": "affected",
"version": "\u003e= 1.34.0, \u003c 1.34.1"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "Envoy is a cloud-native edge/middle/service proxy. Prior to versions 1.34.1, 1.33.3, 1.32.6, and 1.31.8, Envoy\u0027s URI template matcher incorrectly excludes the `*` character from a set of valid characters in the URI path. As a result URI path containing the `*` character will not match a URI template expressions. This can result in bypass of RBAC rules when configured using the `uri_template` permissions. This vulnerability is fixed in Envoy versions v1.34.1, v1.33.3, v1.32.6, v1.31.8. As a workaround, configure additional RBAC permissions using `url_path` with `safe_regex` expression."
}
],
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "NONE",
"baseScore": 5.3,
"baseSeverity": "MEDIUM",
"confidentialityImpact": "LOW",
"integrityImpact": "NONE",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
"version": "3.1"
}
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-186",
"description": "CWE-186: Overly Restrictive Regular Expression",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2025-05-07T21:24:07.891Z",
"orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"shortName": "GitHub_M"
},
"references": [
{
"name": "https://github.com/envoyproxy/envoy/security/advisories/GHSA-c7cm-838g-6g67",
"tags": [
"x_refsource_CONFIRM"
],
"url": "https://github.com/envoyproxy/envoy/security/advisories/GHSA-c7cm-838g-6g67"
}
],
"source": {
"advisory": "GHSA-c7cm-838g-6g67",
"discovery": "UNKNOWN"
},
"title": "Envoy vulnerable to bypass of RBAC uri_template permission"
}
},
"cveMetadata": {
"assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"assignerShortName": "GitHub_M",
"cveId": "CVE-2025-46821",
"datePublished": "2025-05-07T21:24:07.891Z",
"dateReserved": "2025-04-30T19:41:58.134Z",
"dateUpdated": "2025-05-08T14:11:13.676Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.1"
}
Mitigation MIT-45
Strategy: 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.
No CAPEC attack patterns related to this CWE.