CVE-2022-39299: Passport saml Signature Bypass Vulnerability
HIGHCVE-2022-39299 is a HIGH (CVSS 8.1) signature bypass vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Passport saml libraries in the npm ecosystem. The issue involves signature bypass via multiple root elements. Remediation is available by upgrading affected packages to version 3.2.2, 4.0.0-beta.5, 4.0.0-beta.3.
CVE-2022-39299 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-39299
To remediate this vulnerability, upgrade all affected Passport saml 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 passport-saml@3.2.2
npm install node-saml@4.0.0-beta.5
npm install @node-saml/node-saml@4.0.0-beta.5
npm install @node-saml/passport-saml@4.0.0-beta.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls passport-saml
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-39299, inspect your project dependencies using npm:
npm ls passport-saml
Analyze the terminal output to locate any version of Passport saml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.2), your application is affected.
Note: The npm ls passport-saml 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-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. In Passport saml, 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
CVE-2022-39299 Affected Passport saml Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
passport-saml
|
npm |
< 3.2.2
|
3.2.2
|
|
node-saml
|
npm |
< 4.0.0-beta.5
|
4.0.0-beta.5
|
|
@node-saml/node-saml
|
npm |
< 4.0.0-beta.5
|
4.0.0-beta.5
|
|
@node-saml/passport-saml
|
npm |
< 4.0.0-beta.3
|
4.0.0-beta.3
|
References
Frequently Asked Questions
What is CVE-2022-39299?
Which Passport saml versions are affected?
What version fixes CVE-2022-39299?
Is passport-saml affected?
Is node-saml affected?
What is the CVSS score of CVE-2022-39299?
What CWE is associated with CVE-2022-39299?
How can I check npm dependencies for CVE-2022-39299?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m974-647v-whv7",
"modified" : "2022-10-18T03:11:22Z",
"published" : "2022-10-12T22:05:41Z",
"aliases" : [ "CVE-2022-39299" ],
"summary" : "Signature bypass via multiple root elements",
"details" : "### Impact\n\nA remote attacker may be able to bypass SAML authentication on a website using passport-saml. A successful attack requires that the attacker is in possession of an arbitrary IDP signed XML element. Depending on the IDP used, fully unauthenticated attacks (e.g without access to a valid user) might also be feasible if generation of a signed message can be triggered.\n\n### Patches\n\nUsers should upgrade to passport-saml 3.2.2 or newer. The issue was also present in the beta releases of `node-saml` before v4.0.0-beta.5.\n\n### Workarounds\n\nDisable SAML authentication.\n\n### References\n_Are there any links users can visit to find out more?_\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open a discussion in the [node-saml repo](https://github.com/node-saml/node-saml/discussions)\n\n### Credits\n\n* Felix Wilhelm of Google Project Zero\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "passport-saml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.2.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "node-saml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.0.0-beta.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@node-saml/node-saml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.0.0-beta.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@node-saml/passport-saml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.0.0-beta.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/node-saml/passport-saml/security/advisories/GHSA-m974-647v-whv7"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39299"
}, {
"type" : "WEB",
"url" : "https://github.com/node-saml/passport-saml/commit/8b7e3f5a91c8e5ac7e890a0c90bc7491ce33155e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/node-saml/passport-saml"
}, {
"type" : "WEB",
"url" : "https://github.com/node-saml/passport-saml/releases/tag/v3.2.2"
}, {
"type" : "WEB",
"url" : "http://packetstormsecurity.com/files/169826/Node-saml-Root-Element-Signature-Bypass.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-347" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-10-12T22:05:41Z",
"nvd_published_at" : "2022-10-12T21:15:00Z"
}
}