CVE-2025-29775: xml-crypto XML Signature Verification Bypass Vulnerability

xml-crypto Updated 14 Dec 2025

Summary

14/03/2025
Yes i
Critical
9.3

CVE-2025-29775: xml-crypto Vulnerable to XML Signature Verification Bypass via DigestValue Comment. Affects xml-crypto across 3 version ranges.

< 2.1.6 >= 3.0.0, < 3.2.1 >= 4.0.0, < 6.0.1

Fixed in 2.1.6, 3.2.1 or 6.0.1, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

xml-crypto is a widely used library in the Node.js ecosystem that provides functionality for XML digital signatures and encryption. It allows developers to sign and verify XML documents, which is crucial for secure data exchange in various applications, particularly those involving authentication and authorization. However, xml-crypto has a critical vulnerability that can lead to serious security breaches if not addressed.

Vulnerability Detail

The vulnerability in xml-crypto allows an attacker to bypass XML signature verification by exploiting the presence of comments within the DigestValue element of a signed XML document. This can lead to unauthorized access or privilege escalation, as attackers can modify signed XML messages to alter critical attributes without detection. The issue arises from improper handling of comments in the DigestValue, which should not contain any comments. If an attacker successfully exploits this vulnerability, they can impersonate users or gain elevated privileges within the system.

How To Fix

Latest published version: 6.4.0 as of 23 Oct 2026

npm install xml-crypto@6.4.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.1.6 2.1.6
    npm install xml-crypto@2.1.6
  • >= 3.0.0, < 3.2.1 3.2.1
    npm install xml-crypto@3.2.1
  • >= 4.0.0, < 6.0.1 6.0.1
    npm install xml-crypto@6.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If immediate upgrading is not feasible, a temporary workaround involves checking for the presence of comments in the DigestValue. Below is a code snippet to help detect potential tampering:

const xpath = require('xpath');
const { DOMParser } = require('xmldom');

const decryptedDocument = ... // your implementation here

const digestValues = xpath.select(
  "/*[local-name()='DigestValue'][count(node()) > 1]",
  decryptedDocument,
);

if (digestValues.length > 0) {
  // Compromise detected, implement your response here
}

Conclusion

The xml-crypto package has a critical vulnerability that can lead to severe security issues if not addressed. It is crucial to upgrade to the latest patched versions to ensure the integrity of XML signature verification. Additionally, using tools like Vulert can help monitor for vulnerabilities in real-time.

See every vulnerability recorded for xml-crypto →

Share this vulnerability

FAQ

xml-crypto is used for signing and verifying XML documents, which is essential for secure data exchange in applications that require authentication and authorization.

CVE-2025-29775 allows attackers to bypass XML signature verification by manipulating the DigestValue element, potentially leading to unauthorized access or privilege escalation.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application using the Vulert playground without any signup.

Upgrade to xml-crypto version 6.0.1 or higher if using version 4.0.0 or lower. For version 2.x, upgrade to 2.1.6, and for version 3.x, upgrade to 3.2.1.

Implement the provided workaround to check for comments in the DigestValue to detect potential tampering until you can upgrade.

Related vulnerabilities

Recent vulnerabilities recorded for xml-crypto.

How To Fix

Latest published version: 6.4.0 as of 23 Oct 2026

npm install xml-crypto@6.4.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.1.6 2.1.6
    npm install xml-crypto@2.1.6
  • >= 3.0.0, < 3.2.1 3.2.1
    npm install xml-crypto@3.2.1
  • >= 4.0.0, < 6.0.1 6.0.1
    npm install xml-crypto@6.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback