Improper Signature VerificationWeakness · CWE-347

CVE-2024-32962

CRITICAL · 10.0 CVSS v3.1 Published 2024-05-02
Patch available
A vendor patch is available. No clean upgrade release — apply the published patch.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click Patch available

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
xml-crypto is an xml digital signature and encryption library for Node.js. In affected versions the default configuration does not check authorization of the signer, it only checks the validity of the signature per section 3.2.2 of the w3 xmldsig-core-20080610 spec. As such, without additional validation steps, the default configuration allows a malicious actor to re-sign an XML document, place the certificate in a `<KeyInfo />` element, and pass `xml-crypto` default validation checks. As a result `xml-crypto` trusts by default any certificate provided via digitally signed XML document's `<KeyInfo />`. `xml-crypto` prefers to use any certificate provided via digitally signed XML document's `<KeyInfo />` even if library was configured to use specific certificate (`publicCert`) for signature verification purposes. An attacker can spoof signature verification by modifying XML document and replacing existing signature with signature generated with malicious private key (created by attacker) and by attaching that private key's certificate to `<KeyInfo />` element. This vulnerability is combination of changes introduced to `4.0.0` on pull request 301 / commit `c2b83f98` and has been addressed in version 6.0.0 with pull request 445 / commit `21201723d`. Users are advised to upgrade. Users unable to upgrade may either check the certificate extracted via `getCertFromKeyInfo` against trusted certificates before accepting the results of the validation or set `xml-crypto's getCertFromKeyInfo` to `() => undefined` forcing `xml-crypto` to use an explicitly configured `publicCert` or `privateKey` for signature verification.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

The xml-crypto library for Node.js by default trusts any certificate provided in the `<KeyInfo />` element of signed XML documents without validating the signer's authorization. Even when a specific `publicCert` is configured for verification, the library prioritizes certificates found in the XML document's `<KeyInfo />` over the configured one, allowing attackers to spoof signature verification by re-signing documents with their own malicious private key and certificate.

MitigationUpgrade xml-crypto to version 6.0.0 or later; alternatively, either validate certificates from `getCertFromKeyInfo` against a trusted certificate store before accepting validation results, or set `getCertFromKeyInfo` to `() => undefined` to force use of the explicitly configured `publicCert`.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify xml-crypto installation and version
    Run 'npm list xml-crypto' in the project directory, or inspect package.json dependencies, or check node_modules/xml-crypto/package.json for the version field
    Affected if The installed version is below 6.0.0 (or if version cannot be determined but xml-crypto is present)
  2. Locate XML signature verification code
    Search codebase for calls to xml-crypto APIs such as 'SignedXml', 'verify', or methods that perform signature validation on XML documents
    Affected if The application performs XML signature verification using xml-crypto
  3. Inspect getCertFromKeyInfo configuration
    Search for 'getCertFromKeyInfo' in the codebase and examine how it is set in the SignedXml configuration object
    Affected if getCertFromKeyInfo is not set to '() => undefined' and no custom validation against a trusted certificate store is implemented
  4. Check if publicCert is explicitly configured for verification
    Search for 'publicCert' usage in SignedXml initialization and verify whether it is being used as the trusted certificate
    Affected if publicCert is not set or the certificate from KeyInfo is being trusted over the explicitly configured publicCert
  5. Determine if XML documents from untrusted sources are processed
    Review the data flow to see if the application accepts and verifies signed XML from external or untrusted sources
    Affected if The application processes signed XML from external or untrusted sources without additional certificate validation

You are affected if xml-crypto below version 6.0.0 is used to verify XML signatures and the application relies on certificates from KeyInfo elements without additional validation against a trusted certificate store.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Patch available Apply the vendor patch
Vendor patch github.com →
Interim mitigation

Upgrade xml-crypto to version 6.0.0 or later; alternatively, either validate certificates from `getCertFromKeyInfo` against a trusted certificate store before accepting validation results, or set `getCertFromKeyInfo` to `() => undefined` to force use of the explicitly configured `publicCert`.

Recommended fix High confidence

xml-crypto version 6.0.0

  1. Upgrade xml-crypto to version 6.0.0 or later using your package manager (e.g., npm install xml-crypto@^6.0.0 or yarn upgrade xml-crypto@^6.0.0)
  2. After upgrading, verify that your signature validation still works correctly by running existing test suites or manual validation tests
  3. If you encounter issues, review the changelog for breaking changes between your current version and 6.0.0
Caveat Review xml-crypto changelog for breaking changes between v4 and v6; test thoroughly in non-production environment before deploying

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation1.0 h
  • Implementation2.0 h
  • Testing2.0 h
  • Review / QA1.0 h
6.0 hours of engineering $1,040
Get the patch applied

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,664.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2024-32962 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2024-32962 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data