GHSA-c27r-x354-4m68: Xml crypto Xml-crypto's HMAC-SHA1 Signatures Can Bypass Vulnerability
HIGHGHSA-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
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.
npm install xml-crypto@2.0.0
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
GHSA-c27r-x354-4m68 Affected Xml crypto Versions
1 component(s)| 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?
Which Xml crypto versions are affected?
What version fixes GHSA-c27r-x354-4m68?
Is xml-crypto affected?
What CWE is associated with GHSA-c27r-x354-4m68?
How can I check npm dependencies for GHSA-c27r-x354-4m68?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}