HMAC-SHA1 Signature Bypass in xml-crypto

xml-crypto Updated 02 Oct 2025

Summary

27/10/2020
HIGH
Yes i
High
Not published

GHSA-c27r-x354-4m68: xml-crypto's HMAC-SHA1 signatures can bypass validation via key confusion. Affects xml-crypto versions < 2.0.0. Fixed in 2.0.0. 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 an npm package that provides XML digital signature functionality. It allows users to sign and verify XML documents using various signature algorithms. However, a vulnerability has been discovered in xml-crypto's HMAC-SHA1 signatures, which can be bypassed by exploiting key confusion.

Vulnerability Detail

The vulnerability allows an attacker to inject an HMAC-SHA1 signature that appears valid using only knowledge of the RSA public key. This bypasses the signature validation process, potentially leading to unauthorized access or tampering of XML documents. The issue arises from a flaw in the implementation of the signature validation logic.

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 version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.0.0

This is the first release that contains the fix.

npm install xml-crypto@2.0.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to version 2.0.0 is not possible, a temporary workaround is to remove the 'http://www.w3.org/2000/09/xmldsig#hmac-sha1' entry from the SignedXml.SignatureAlgorithms configuration. This will disable the vulnerable HMAC-SHA1 signature algorithm and prevent the bypass. However, this workaround should only be considered as a temporary solution until the package can be upgraded.

Conclusion

The HMAC-SHA1 signature bypass vulnerability in xml-crypto can be mitigated by upgrading to version 2.0.0 or applying the provided workaround. It is important to take action to prevent potential unauthorized access or tampering of XML documents. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for xml-crypto →

Share this vulnerability

FAQ

xml-crypto is an npm package that provides XML digital signature functionality. It allows users to sign and verify XML documents using various signature algorithms.

The vulnerability allows an attacker to bypass signature validation in xml-crypto, potentially leading to unauthorized access or tampering of XML documents.

To fix this vulnerability, it is recommended to upgrade to version 2.0.0 of xml-crypto. This version includes the necessary fixes to prevent the bypass of signature validation.

If upgrading to version 2.0.0 is not possible, a temporary workaround is to remove the 'http://www.w3.org/2000/09/xmldsig#hmac-sha1' entry from the SignedXml.SignatureAlgorithms configuration.

For more information about this vulnerability, you can refer to the advisory on GitHub: [link to advisory]

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 version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.0.0

This is the first release that contains the fix.

npm install xml-crypto@2.0.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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