GHSA-c27r-x354-4m68: Xml crypto Xml-crypto's HMAC-SHA1 Signatures Can Bypass Vulnerability

HIGH
CWE-287
Published
Advisory Summary

GHSA-c27r-x354-4m68 is a HIGH xml-crypto's hmac-sha1 signatures can bypass vulnerability (CWE-287: Improper Authentication) affecting Xml crypto libraries in the npm ecosystem. The issue involves xml-crypto's hmac-sha1 signatures can bypass validation via key confusion. Remediation is available by upgrading affected packages to version 2.0.0.

GHSA-c27r-x354-4m68 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-c27r-x354-4m68
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-287: Improper Authentication
Affected Product Xml crypto
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-c27r-x354-4m68

To remediate this vulnerability, upgrade all affected Xml crypto dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

xml-crypto fixed: 2.0.0
npm install xml-crypto@2.0.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls xml-crypto

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-c27r-x354-4m68, inspect your project dependencies using npm:

npm ls xml-crypto

Analyze the terminal output to locate any version of Xml crypto in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0), your application is affected.

Note: The npm ls xml-crypto command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Xml crypto, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact An attacker can inject an HMAC-SHA1 signature that is valid using only knowledge of the RSA public key. This allows bypassing signature validation. ### Patches Version 2.0.0 has the fix. ### Workarounds The recommendation is to upgrade. In case that is not possible remove the 'http://www.w3.org/2000/09/xmldsig#hmac-sha1' entry from SignedXml.SignatureAlgorithms.

GHSA-c27r-x354-4m68 Affected Xml crypto Versions

1 component(s)
Fixed Versions:
2.0.0
Product / Package Ecosystem Affected Versions Fixed Version
xml-crypto
npm
< 2.0.0
2.0.0

References

Frequently Asked Questions

What is GHSA-c27r-x354-4m68?
GHSA-c27r-x354-4m68 is a security vulnerability in Xml crypto involving xml-crypto's HMAC-SHA1 signatures can bypass validation via key confusion under CWE-287: Improper Authentication.
Which Xml crypto versions are affected?
Affected versions include releases prior to 2.0.0 across affected packages: xml-crypto.
What version fixes GHSA-c27r-x354-4m68?
Upgrading to 2.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xml-crypto affected?
Yes, xml-crypto is affected in releases prior to 2.0.0. Upgrade your dependency to 2.0.0 or later.
What CWE is associated with GHSA-c27r-x354-4m68?
GHSA-c27r-x354-4m68 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check npm dependencies for GHSA-c27r-x354-4m68?
Run the dependency tree command: 'npm ls xml-crypto'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c27r-x354-4m68",
  "modified" : "2022-08-02T20:03:05Z",
  "published" : "2020-10-27T20:39:46Z",
  "aliases" : [ ],
  "summary" : "xml-crypto's HMAC-SHA1 signatures can bypass validation via key confusion",
  "details" : "### Impact\nAn attacker can inject an HMAC-SHA1 signature that is valid using only knowledge of the RSA public key. This allows bypassing signature validation.\n\n### Patches\nVersion 2.0.0 has the fix.\n\n### Workarounds\nThe recommendation is to upgrade. In case that is not possible remove the 'http://www.w3.org/2000/09/xmldsig#hmac-sha1' entry from SignedXml.SignatureAlgorithms.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "xml-crypto"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.5.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/yaronn/xml-crypto/security/advisories/GHSA-c27r-x354-4m68"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yaronn/xml-crypto/commit/3d9db712e6232c765cd2ad6bd2902b88a0d22100"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/yaronn/xml-crypto"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/xml-crypto"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-10-27T20:35:52Z",
    "nvd_published_at" : null
  }
}