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

Source: https://junglewise.ai/threats/cve-2021-39171-passport-saml-unlimited-transforms-denial-of-service  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-08-30. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/passport-saml). Vendors: [npm](https://junglewise.ai/threats/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

  ```sh
  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

- [https://github.com/node-saml/passport-saml/security/advisories/GHSA-5379-r78w-42h2](https://github.com/node-saml/passport-saml/security/advisories/GHSA-5379-r78w-42h2)
- [https://github.com/node-saml/passport-saml/pull/595](https://github.com/node-saml/passport-saml/pull/595)
- [https://github.com/node-saml/passport-saml/commit/f1e00b64c21a725f545e675cd810bbaa435a3972](https://github.com/node-saml/passport-saml/commit/f1e00b64c21a725f545e675cd810bbaa435a3972)
- [https://github.com/node-saml/passport-saml](https://github.com/node-saml/passport-saml)

## Related threats

- [Node-SAML SAML assertion signature verification bypass](https://junglewise.ai/threats/cve-2025-54419-node-saml-saml-assertion-signature-verification-bypass)
- [passport-saml signature bypass via multiple root elements](https://junglewise.ai/threats/cve-2022-39299-passport-saml-signature-bypass-via-multiple-root-elements)
