CVE-2024-32962
JavaScript vulnerability analysis and mitigation

Overview

CVE-2024-32962 affects xml-crypto, an XML digital signature and encryption library for Node.js, in versions 4.0.0 to less than 6.0.0. The vulnerability was discovered in May 2024 and involves the default configuration not checking authorization of the signer, only validating the signature per section 3.2.2 of the W3C xmldsig-core-20080610 specification. The vulnerability has received a Critical CVSS score of 10.0 (GitHub Advisory).

Technical details

The vulnerability stems from xml-crypto's handling of XML signature verification. The package trusts by default any certificate provided via digitally signed XML document's KeyInfo element, and prefers to use this certificate even when the library is configured to use a specific certificate (publicCert) for signature verification. This behavior was introduced in version 4.0.0 through pull request 301 and commit c2b83f98 (SecurityOnline, GitHub Advisory).

Impact

The vulnerability allows attackers to spoof signature verification by modifying XML documents and replacing existing signatures with signatures generated using malicious private keys. An attacker can attach their malicious private key's certificate to the KeyInfo element, potentially leading to unauthorized data manipulation and breakdown of trust mechanisms in systems relying on xml-crypto for security (SecurityOnline).

Mitigation and workarounds

The vulnerability has been addressed in version 6.0.0. Users are advised to upgrade to this version. For those unable to upgrade immediately, two workarounds are available: 1) Check the certificate extracted via getCertFromKeyInfo against trusted certificates before accepting validation results, or 2) Set xml-crypto's getCertFromKeyInfo to () => undefined to force the use of an explicitly configured publicCert or privateKey for signature verification (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management