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

> Attackers can impersonate users by crafting certificates with spoofed Common Names if SASL EXTERNAL is enabled, requiring an upgrade to Openfire.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Sep 2025
- **Updated:** 15 Sep 2025
- **Also known as:** GHSA-w252-645g-87mp

## What is CVE-2025-59154?

CVE-2025-59154 is a medium-severity authentication bypass vulnerability in igniterealtime Openfire, published on 15 Sep 2025. An attacker needs administrator access to exploit it, with no action from the victim.

### Official 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.

Weakness: CWE-290 (Authentication Bypass by Spoofing)

## Which versions are affected by CVE-2025-59154?

2 open source packages ship an affected version, including org.igniterealtime.openfire:xmppserver.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.igniterealtime.openfire:xmppserver` | Maven | All versions | 5.0.2 |
| `org.igniterealtime.openfire:xmppserver` | Maven | All versions | 5.0.2 |

## How do I fix CVE-2025-59154?

Upgrade org.igniterealtime.openfire:xmppserver to 5.0.2 or later.

## Is CVE-2025-59154 being exploited?

There is no known exploitation of CVE-2025-59154 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-59154 and fix it if it is affected.

What it is: CVE-2025-59154 is a medium-severity authentication bypass vulnerability in igniterealtime Openfire, published on 15 Sep 2025. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-59154 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.igniterealtime.openfire:xmppserver (Maven): affected all versions; fixed in 5.0.2
- org.igniterealtime.openfire:xmppserver (Maven): affected all versions; fixed in 5.0.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-59154/ (Markdown: https://insights.sbomify.com/CVE-2025-59154/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-59154
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-59154
- OSV: https://osv.dev/vulnerability/CVE-2025-59154

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-59154/
Summaries are generated and may contain mistakes; the official description above is the record.
