{"id":"CVE-2026-118513","aliases":["CVE-2026-118513","GHSA-5w3m-mfwg-9f8r"],"related":[],"kind":"vulnerability","state":"published","title":"Symfony: X.509 Authentication Impersonation via DN Value Injection (incomplete fix for CVE-2026-45063)","summary":"Authentication bypass by spoofing in X509Authenticator and X509AuthenticationListener of Symfony versions prior to 5.4.56, 6.x prior to 6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11 allows an attacker holding a certificate from the application's trusted CA who can influence the CN to authenticate as an arbitrary user of the application, including a privileged one, following an incomplete fix for CVE-2026-45063.\nX509Authenticator extracts the user identifier from the Subject DN (Distinguished Name) that the web server passes in $_SERVER['SSL_CLIENT_S_DN']. The fix for CVE-2026-45063 anchored that extraction to an RDN (Relative Distinguished Name) boundary, but the regular expression used was not escape-aware. The expression runs against an already serialized DN, so it cannot tell an RDN separator from a separator character that occurs inside a value. Under RFC 2253, used by Apache and by nginx's $ssl_client_s_dn, a comma inside a value is escaped as \\, and the expression reads it as a separator regardless. RFC 2253 also does not treat / as a separator, so it leaves it bare inside a value, while the expression treats every / as one. The legacy X509_NAME_oneline() format, used by Apache's LegacyDNStringFormat and by nginx's $ssl_client_s_dn_legacy, is the mirror image: it escapes / as \\/ and leaves , bare. In that format, a certificate with no emailAddress attribute, or whose poisoned CN precedes it, authenticates as the smuggled address.\n\n\n\n\n\nTo cover both RFC 2253 and the legacy X509_NAME_oneline() format, X509Authenticator and X509AuthenticationListener now split the DN into RDNs before looking for the attribute, instead of matching the attribute against the serialized string. They select the separator from the serialization, split on unescaped occurrences of that separator only, unescape each RDN afterwards with the rules of its format, and require the attribute to span a whole RDN. The accepted value grammar is unchanged.\n\n\n\n\nApplications that pass a per-attribute user key (such as SSL_CLIENT_S_DN_Email) and deployments whose CA generates or validates the subject are not affected by this vulnerability.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Authentication bypass by spoofing in X509Authenticator and X509AuthenticationListener of Symfony versions prior to 5.4.56, 6.x prior to 6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11 allows an attacker holding a certificate from the application's trusted CA who can influence the CN to authenticate as an arbitrary user of the application, including a privileged one, following an incomplete fix for CVE-2026-45063.\nX509Authenticator extracts the user identifier from the Subject DN (Distinguished Name) that the web server passes in $_SERVER['SSL_CLIENT_S_DN']. The fix for CVE-2026-45063 anchored that extraction to an RDN (Relative Distinguished Name) boundary, but the regular expression used was not escape-aware. The expression runs against an already serialized DN, so it cannot tell an RDN separator from a separator character that occurs inside a value. Under RFC 2253, used by Apache and by nginx's $ssl_client_s_dn, a comma inside a value is escaped as \\, and the expression reads it as a separator regardless. RFC 2253 also does not treat / as a separator, so it leaves it bare inside a value, while the expression treats every / as one. The legacy X509_NAME_oneline() format, used by Apache's LegacyDNStringFormat and by nginx's $ssl_client_s_dn_legacy, is the mirror image: it escapes / as \\/ and leaves , bare. In that format, a certificate with no emailAddress attribute, or whose poisoned CN precedes it, authenticates as the smuggled address.\n\n\n\n\n\nTo cover both RFC 2253 and the legacy X509_NAME_oneline() format, X509Authenticator and X509AuthenticationListener now split the DN into RDNs before looking for the attribute, instead of matching the attribute against the serialized string. They select the separator from the serialization, split on unescaped occurrences of that separator only, unescape each RDN afterwards with the rules of its format, and require the attribute to span a whole RDN. The accepted value grammar is unchanged.\n\n\n\n\nApplications that pass a per-attribute user key (such as SSL_CLIENT_S_DN_Email) and deployments whose CA generates or validates the subject are not affected by this vulnerability.","source":"cvelist"},{"lang":"en","text":"### Description\n\n`X509Authenticator` extracts the user identifier from the Subject DN (Distinguished Name) that the web server passes in `$_SERVER['SSL_CLIENT_S_DN']`. The fix for CVE-2026-45063 anchored that extraction to an RDN (Relative Distinguished Name) boundary:\n\n```php\n'#(?:^|[,/])\\s*(?:emailAddress|1\\.2\\.840\\.113549\\.1\\.9\\.1)=([^,/@]++@[^,/]++)#'\n```\n\n`(?:^|[,/])` is not escape-aware. The expression runs against an already serialized DN, so it cannot tell an RDN separator from a separator character that occurs inside a value. Both serializations a web server can emit are affected, in opposite directions.\n\nUnder RFC 2253, used by Apache and by nginx's `$ssl_client_s_dn`, a comma inside a value is escaped as `\\,`, and the expression reads it as a separator regardless. A certificate whose single `CN` is `jdoe,emailAddress=admin@example.com`, issued to a holder whose genuine address is `jdoe@example.com`, serializes to:\n\n```\nCN=jdoe\\,emailAddress=admin@example.com,emailAddress=jdoe@example.com\n```\n\nRFC 2253 emits RDNs in reverse order, so the poisoned `CN` is scanned before the genuine `emailAddress` attribute and the authenticator returns `admin@example.com`.\n\nRFC 2253 does not treat `/` as a separator, so it leaves it bare inside a value, while the expression treats every `/` as one. A certificate whose single `CN` is `jdoe/emailAddress=admin@example.com` therefore authenticates as `admin@example.com` as well, with no `emailAddress` attribute needed. The legacy `X509_NAME_oneline()` format, used by Apache's `LegacyDNStringFormat` and by nginx's `$ssl_client_s_dn_legacy`, is the mirror image: it escapes `/` as `\\/` and leaves `,` bare. In that format, a certificate with no `emailAddress` attribute, or whose poisoned `CN` precedes it, authenticates as the smuggled address. Formats that quote a value instead of escaping its characters, such as OpenSSL's `XN_FLAG_ONELINE` (`CN = \"jdoe,emailAddress=admin@example.com\"`), are affected the same way.\n\nOn Symfony 5.4, the deprecated `X509AuthenticationListener`, which SecurityBundle uses when `security.enable_authenticator_manager` is not set to `true` (the default on 5.4), still matched `emailAddress=` anywhere in the DN: the fix for CVE-2026-45063 did not cover it, so applications on that code path were also exposed to the original report.\n\nAn attacker holding a certificate from the application's trusted CA who can influence the `CN` authenticates as an arbitrary user of the application, including a privileged one.\n\nApplications that pass a per-attribute `userKey`, such as Apache's `SSL_CLIENT_S_DN_Email`, never reach this fallback and are not affected, and neither are deployments whose CA generates or validates the subject itself rather than accepting requester-supplied values. The nginx configuration Symfony documents does reach the fallback, because nginx exposes no per-attribute equivalent.\n\n### Resolution\n\n`X509Authenticator` and `X509AuthenticationListener` now split the DN into RDNs before looking for the attribute, instead of matching the attribute against the serialized string. They select the separator from the serialization (`X509_NAME_oneline()` always prefixes the DN with a slash, RFC 2253 never does), split on unescaped occurrences of that separator only, unescape each RDN afterwards with the rules of its format, and require the attribute to span a whole RDN. A separator inside a quoted value doesn't split the DN either. The accepted value grammar is unchanged.\n\n`X509_NAME_oneline()` as implemented by OpenSSL before 3.0, and HAProxy's `ssl_c_s_dn` fetch, write a slash inside a value without escaping it, so such a DN cannot be parsed unambiguously by anyone. Deployments using Apache's `LegacyDNStringFormat` or nginx's `$ssl_client_s_dn_legacy` with those libraries, or HAProxy's `ssl_c_s_dn`, should switch to the RFC 2253 output (`$ssl_client_s_dn`, Apache's default, `ssl_c_s_dn(,rfc2253)`) or pass a per-attribute value as the user key (`SSL_CLIENT_S_DN_Email`, `ssl_c_s_dn(emailAddress)`).\n\nOne behaviour change is worth noting for reviewers: a slash-separated DN now has to start with a slash to be read as slash-separated. `CN=jdoe/emailAddress=admin@example.com` is byte for byte both the attack and a two-RDN slash-separated DN written without a leading slash, so one of the two readings had to go, and `X509_NAME_oneline()` always emits the leading slash.\n\nThe patches for this issue are available [here](https://github.com/symfony/symfony/commit/0f5e26b664d17cb235ca6b6d15bf4e7ac83d25cb) for branch 5.4 and [here](https://github.com/symfony/symfony/commit/e885d7549a234530ce1d59121d4ac3ee35b1caea) for branch 6.4 (and forward-ported to 7.4, 8.1 and 8.2). From 6.4 on, the identifier attribute is configurable through `credentialUserIdentifier`, and its value grammar accepts any value rather than an address, so the custom spelling was spoofable the same way. Both arms of the pattern are anchored to a whole RDN.\n\n### Credits\n\nSymfony would like to thank Oryam Halachmi, dahmani toumi and Stapat for reporting the issue.\n\nSymfony would also like to thank [Bruno Dias](https://github.com/cx-bruno-dias) and [João Oliveira](https://github.com/cx-joao-oliveira) from Checkmarx for their help getting a CVE assigned.","format":"markdown","source":"ghsa"}],"published":"2026-11-04T12:19:53.359Z","modified":"2026-12-01T21:45:12.212Z","severity":{"scorer":"Checkmarx","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":7.7,"rating":"HIGH"},"severities":[{"scorer":"Checkmarx","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":7.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"}],"cwes":["CWE-290"],"affected":[{"ranges":[{"type":"git","introduced":"0","fixed":"5.4.56","status":"affected"},{"type":"git","introduced":"6.0.0","fixed":"6.4.50","status":"affected"},{"type":"git","introduced":"7.0.0","fixed":"7.4.23","status":"affected"},{"type":"git","introduced":"8.0.0","fixed":"8.1.11","status":"affected"}],"vendor":"sensiolabs","product":"symfony","package":"symfony/security-http","repo":"https://github.com/symfony/security-http","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.4.56"}],"ecosystem":"Packagist","package":"symfony/security-http","purl":"pkg:composer/symfony/security-http","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.0.0","status":"affected","fixed":"6.4.50"}],"ecosystem":"Packagist","package":"symfony/security-http","purl":"pkg:composer/symfony/security-http","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"7.0.0","status":"affected","fixed":"7.4.23"}],"ecosystem":"Packagist","package":"symfony/security-http","purl":"pkg:composer/symfony/security-http","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"8.0.0","status":"affected","fixed":"8.1.11"}],"ecosystem":"Packagist","package":"symfony/security-http","purl":"pkg:composer/symfony/security-http","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.4.56"}],"ecosystem":"Packagist","package":"symfony/symfony","purl":"pkg:composer/symfony/symfony","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.0.0","status":"affected","fixed":"6.4.50"}],"ecosystem":"Packagist","package":"symfony/symfony","purl":"pkg:composer/symfony/symfony","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"7.0.0","status":"affected","fixed":"7.4.23"}],"ecosystem":"Packagist","package":"symfony/symfony","purl":"pkg:composer/symfony/symfony","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"8.0.0","status":"affected","fixed":"8.1.11"}],"ecosystem":"Packagist","package":"symfony/symfony","purl":"pkg:composer/symfony/symfony","source":"ghsa"}],"references":[{"url":"https://github.com/symfony/symfony/security/advisories/GHSA-5w3m-mfwg-9f8r","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/symfony/symfony/commit/0f5e26b664d17cb235ca6b6d15bf4e7ac83d25cb","tags":["patch","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/symfony/symfony/commit/e885d7549a234530ce1d59121d4ac3ee35b1caea","tags":["patch","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-118513","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/security-http/CVE-2026-118513.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-118513.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/symfony/symfony","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/symfony/symfony/releases/tag/v5.4.56","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/symfony/symfony/releases/tag/v6.4.50","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/symfony/symfony/releases/tag/v7.4.23","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/symfony/symfony/releases/tag/v8.1.11","tags":["web"],"sources":["ghsa"]},{"url":"https://symfony.com/cve-2026-118513","tags":["web"],"sources":["ghsa"]}],"credits":["Oryam Halachmi","Dahmani Toumi","Nicolas Grekas","Stapat"],"assigner":"Checkmarx","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-11-04T20:49:24.686Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-118513","url":"https://www.cve.org/CVERecord?id=CVE-2026-118513","licence":"CVE Terms of Use","modified":"2026-11-05T19:08:50.940Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5w3m-mfwg-9f8r","url":"https://github.com/advisories/GHSA-5w3m-mfwg-9f8r","licence":"CC-BY-4.0","modified":"2026-12-01T21:45:12.212Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-118513","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-118513","licence":"Public domain","modified":"2026-11-06T21:40:43.450Z"}],"updatedAt":"2026-12-01T21:57:25.310Z","epss":{"score":0.0027,"percentile":0.20597,"date":"2026-12-01T12:00:22.000Z"}}