CVE-2021-39171: passport-saml unlimited transforms denial of service

CVE-2021-39171 · Severity: low · CVSS 3.1 · Published 2021-08-30

passport-saml is a Node.js library that handles SAML authentication for web applications. A flaw allows attackers to send malicious SAML payloads with excessive cryptographic transforms that consume significant CPU and memory resources during processing, enabling denial-of-service attacks that degrade or disable the authentication service.

Technologies: passport-saml (npm). Vendors: npm.

Quick answers

Is CVE-2021-39171 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2021-39171 being exploited in the wild.
How severe is CVE-2021-39171?
Low severity, with a CVSS score of 3.1, published 30 August 2021.
Which products and versions are affected?
passport-saml (npm) SEMVER:introduced=0,fixed=3.1.0.
Is there a fix for CVE-2021-39171?
Yes. passport-saml (npm): upgrade to 3.1.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2021-39171 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2021-39171?
Check whether you run passport-saml (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • passport-saml (npm): upgrade to 3.1.0 or later
    npm install passport-saml@3.1.0

Technical details

The vulnerability exists in passport-saml's SAML signature validation code, which processes XML Digital Signature (XMLDSIG) transforms without limiting their quantity. An attacker can craft a malicious SAML assertion containing an unlimited number of Transform elements within a Reference node, forcing the application to perform expensive cryptographic operations on each transform. This is an uncontrolled resource consumption vulnerability (CWE-400). The attack requires only network access and no authentication or user interaction. The fix, released in version 3.1.0, imposes a hard limit of 2 allowed transforms per signed node, preventing the resource exhaustion.

Affected products

  • node-saml passport-saml before 3.1.0

Identifiers

  • CVE-2021-39171
  • GHSA-5379-r78w-42h2

Timeline

  • 2021-08-27: disclosed: Security advisory published
  • 2021-08-30: patched: Version 3.1.0 released with fix limiting transforms to 2

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.