# Symfony: X509Authenticator and X509AuthenticationListener Read Escaped RFC 2253 Commas and Bare Slashes Inside a DN Value as RDN Boundaries

Symfony's X509 authenticator regex treated escaped commas and bare slashes inside a DN value as RDN separators, letting a CA-issued cert with a crafted CN authenticate as an arbitrary user.

- Payout: Research
- Severity: high
- Program: Symfony
- Found by (vendor credit): Oryam Halachmi, Dahmani Toumi, Stapat
- Found by: pgaSUS99, stapat1245
- Disclosed: 2026-12-01
- CVE: CVE-2026-118513
- Write-up quality: 8/10
- Original: https://github.com/advisories/GHSA-5w3m-mfwg-9f8r
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-5w3m-mfwg-9f8r
- Tags: area:web domain:web impact:ato impact:privesc kind:research platform:ghsa sev:high tech:php technique:incomplete-fix technique:parser-differential technique:source-review vuln:access-control vuln:auth-bypass

**Target:** X509 client-certificate authenticator (SSL_CLIENT_S_DN parsing)
**Root cause:** The fix for CVE-2026-45063 anchored attribute extraction with `(?:^|[,/])`, which is not escape-aware and runs against an already serialized DN, so it cannot distinguish an RDN separator from a separator character inside a value.
**Steps:**
1. Attacker obtains a certificate from the app's trusted CA and controls the CN value.
2. Set CN to `jdoe,emailAddress=admin@example.com` (RFC 2253 serializes the comma as `\,`).
3. Server emits `CN=jdoe\,emailAddress=admin@example.com,emailAddress=jdoe@example.com` in `$_SERVER['SSL_CLIENT_S_DN']`.
4. Regex `(?:^|[,/])\s*(?:emailAddress|1\.2\.840\.113549\.1\.9\.1)=([^,/@]++@[^,/]++)` matches the escaped comma as a separator and returns `admin@example.com`.
5. Alternatively set CN to `jdoe/emailAddress=admin@example.com`; RFC 2253 leaves `/` bare and the regex treats it as a separator.
6. Present the certificate to the X509 authenticator and authenticate as the smuggled identity.
**How found:** Reviewing the CVE-2026-45063 fix, the finder noticed `(?:^|[,/])` is not escape-aware and that the regex runs on a serialized DN, then reasoned about the two serializations (RFC 2253 escaping `,` and leaving `/` bare; X509_NAME_oneline escaping `/` and leaving `,` bare) to construct values that cross RDN boundaries.
**Exploitation:** Attacker with a CA-issued certificate supplies a crafted CN; the authenticator extracts the smuggled emailAddress and logs them in as that user, including privileged accounts. No emailAddress attribute is needed in the slash variant.
**Escalation:** Authenticating as an arbitrary user, including a privileged one, yields full account takeover of the application.
**Insight:** When a regex parses a serialized structured string, check whether the separator class is escape-aware and whether the serialization escapes that character; test both RFC 2253 and legacy X509_NAME_oneline formats since they escape opposite characters.

## Proof of concept (copied exactly from the original report)

**Vulnerable regex matching RDN boundary**

```
'#(?:^|[,/])\s*(?:emailAddress|1\.2\.840\.113549\.1\.9\.1)=([^,/@]++@[^,/]++)#'
```

**Poisoned CN serialized DN with escaped comma**

```
CN=jdoe\,emailAddress=admin@example.com,emailAddress=jdoe@example.com
```

**Bare slash CN smuggling emailAddress**

```
CN=jdoe/emailAddress=admin@example.com
```

