# CVE-2025-29774: xml-crypto Vulnerable to XML Signature Verification Bypass via Multiple SignedInfo References

> Attackers can bypass XML signature verification to modify signed messages, enabling privilege escalation or user impersonation in systems using xml-crypto.

- **Severity:** Critical 9.3 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Mar 2025
- **Updated:** 15 Mar 2025
- **Also known as:** GHSA-9p8x-f768-wp2g

## What is CVE-2025-29774?

CVE-2025-29774 is a critical vulnerability in node-saml xml-crypto, published on 14 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

xml-crypto is an XML digital signature and encryption library for Node.js. An attacker may be able to exploit a vulnerability in versions prior to 6.0.1, 3.2.1, and 2.1.6 to bypass authentication or authorization mechanisms in systems that rely on xml-crypto for verifying signed XML documents. The vulnerability allows an attacker to modify a valid signed XML message in a way that still passes signature verification checks. For example, it could be used to alter critical identity or access control attributes, enabling an attacker with a valid account to escalate privileges or impersonate another user. Users of versions 6.0.0 and prior should upgrade to version 6.0.1 to receive a fix. Those who are still using v2.x or v3.x should upgrade to patched versions 2.1.6 or 3.2.1, respectively.

Weakness: CWE-347 (Improper Verification of Cryptographic Signature)

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

6 open source packages ship an affected version, including xml-crypto.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `xml-crypto` | npm | All versions | 2.1.6 |
| `xml-crypto` | npm | All versions | 2.1.6 |
| `xml-crypto` | npm | From 3.0.0 | 3.2.1 |
| `xml-crypto` | npm | From 3.0.0 | 3.2.1 |
| `xml-crypto` | npm | From 4.0.0 | 6.0.1 |
| `xml-crypto` | npm | From 4.0.0 | 6.0.1 |

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

Upgrade xml-crypto to a fixed version for your release line: 2.1.6, 3.2.1 or 6.0.1.

## Is CVE-2025-29774 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-29774 exists.

Public exploit code:

- How CVE-2025-29774 Vulnerabilities and the SIGHASH_SINGLE Bug Threaten Multi-Signature Wallet Operational Methods with Fake RawTX (github_poc): https://github.com/demining/Digital-Signature-Forgery-Attack
- Phantom Signature Attack: An Analysis of the Critical Vulnerability CVE-2025-29774 in the Bitcoin Protocol, SIGHASH_SINGLE Implementation Flaws, and the Mathematical Framework for Private Key Recovery in Lost Cryptocurrency Wallets Enabling Unrestricted Control over BTC Assets (github_poc): https://github.com/demining/Phantom-Signature-Attack

## Fix prompt for AI coding agents

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

What it is: CVE-2025-29774 is a critical vulnerability in node-saml xml-crypto, published on 14 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-29774 exists.

Affected packages and fixed versions:
- xml-crypto (npm): affected all versions; fixed in 2.1.6
- xml-crypto (npm): affected all versions; fixed in 2.1.6
- xml-crypto (npm): affected from 3.0.0; fixed in 3.2.1
- xml-crypto (npm): affected from 3.0.0; fixed in 3.2.1
- xml-crypto (npm): affected from 4.0.0; fixed in 6.0.1
- xml-crypto (npm): affected from 4.0.0; fixed in 6.0.1

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-29774/ (Markdown: https://insights.sbomify.com/CVE-2025-29774/index.md)
```

## Sources

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

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