CVE-2022-39300: Node saml Signature Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-5p8w-2mvw-38pv
CVSS 8.1
CWE-347
Published
Advisory Summary

CVE-2022-39300 is a HIGH (CVSS 8.1) signature bypass vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Node saml libraries in the npm ecosystem. The issue involves signature bypass via multiple root elements. Remediation is available by upgrading affected packages to version 4.0.0-beta.5.

CVE-2022-39300 at a Glance

CVE Identifier CVE-2022-39300
GHSA Identifier GHSA-5p8w-2mvw-38pv
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-347: Improper Verification of Cryptographic Signature
Affected Product Node saml
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-39300

To remediate this vulnerability, upgrade all affected Node 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.

node-saml fixed: 4.0.0-beta.5
npm install node-saml@4.0.0-beta.5
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 node-saml

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2022-39300, inspect your project dependencies using npm:

npm ls node-saml

Analyze the terminal output to locate any version of Node saml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.0-beta.5), your application is affected.

Note: The npm ls node-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 Node 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

### Impact A 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. ### Patches Users should upgrade to node-saml v4.0.0-beta5 or newer. ### Workarounds Disable SAML authentication. ### References _Are there any links users can visit to find out more?_ ### For more information If you have any questions or comments about this advisory: * Open a discussion in the [node-saml repo](https://github.com/node-saml/node-saml/discussions) ### Credits * Felix Wilhelm of Google Project Zero

CVE-2022-39300 Affected Node saml Versions

1 component(s)
Fixed Versions:
4.0.0-beta.5
Product / Package Ecosystem Affected Versions Fixed Version
node-saml
npm
< 4.0.0-beta.5
4.0.0-beta.5

References

Frequently Asked Questions

What is CVE-2022-39300?
CVE-2022-39300 is a security vulnerability in Node saml involving Signature bypass via multiple root elements under CWE-347: Improper Verification of Cryptographic Signature.
Which Node saml versions are affected?
Affected versions include releases prior to 4.0.0-beta.5 across affected packages: node-saml.
What version fixes CVE-2022-39300?
Upgrading to 4.0.0-beta.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is node-saml affected?
Yes, node-saml is affected in releases prior to 4.0.0-beta.5. Upgrade your dependency to 4.0.0-beta.5 or later.
What is the CVSS score of CVE-2022-39300?
CVE-2022-39300 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-39300?
CVE-2022-39300 is classified under CWE-347: Improper Verification of Cryptographic Signature (The product does not verify, or incorrectly verifies, the cryptographic signature for data.).
How can I check npm dependencies for CVE-2022-39300?
Run the dependency tree command: 'npm ls node-saml'. 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-5p8w-2mvw-38pv",
  "modified" : "2022-10-14T19:48:04Z",
  "published" : "2022-10-12T22:05:44Z",
  "aliases" : [ "CVE-2022-39300" ],
  "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 node-saml v4.0.0-beta5 or newer. \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\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" : "node-saml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.0.0-beta.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/node-saml/node-saml/security/advisories/GHSA-5p8w-2mvw-38pv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39300"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/node-saml/node-saml/commit/c1f275c289c01921e58f5c70ce0fdbc5287e5fbe"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/node-saml/node-saml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-10-12T22:05:44Z",
    "nvd_published_at" : "2022-10-13T22:15:00Z"
  }
}