CVE-2026-32141: flatted: Unbounded recursion DoS in parse() revive phase

Published Mar 12, 2026
·
Updated

Summary

flatted's parse() function uses a recursive revive() phase to resolve circular references in deserialized JSON. When given a crafted payload with deeply nested or self-referential $ indices, the recursion depth is unbounded, causing a stack overflow that crashes the Node.js process.

Impact

Denial of Service (DoS). Any application that passes untrusted input to flatted.parse() can be crashed by an unauthenticated attacker with a single request.

flatted has ~87M weekly npm downloads and is used as the circular-JSON serialization layer in many caching and logging libraries.

Proof of Concept

javascript const flatted = require('flatted');

// Build deeply nested circular reference chain const depth = 20000; const arr = new Array(depth + 1); arr[0] = '{"a":"1"}'; for (let i = 1; i <= depth; i++) { arr[i] = {"a":"${i + 1}"}; } arr[depth] = '{"a":"leaf"}';

const payload = JSON.stringify(arr); flatted.parse(payload); // RangeError: Maximum call stack size exceeded

Fix

The maintainer has already merged an iterative (non-recursive) implementation in PR #88, converting the recursive revive() to a stack-based loop.

Affected Versions

All versions prior to the PR #88 fix.

Other sources

flatted is a circular JSON parser. Prior to 3.4.0, flatted's parse() function uses a recursive revive() phase to resolve circular references in deserialized JSON. When given a crafted payload with deeply nested or self-referential $ indices, the recursion depth is unbounded, causing a stack overflow that crashes the Node.js process. This vulnerability is fixed in 3.4.0.

MITRE

Affected Software

4 affected componentsFixes available
npm/flatted<3.4.0
npm/flatted<3.4.0
3.4.0
Webreflection Flatted Node.js<3.4.0
IBM watsonx.data intelligence<=5.2.2, 5.3.0, 5.3.1, 5.3.1-patch-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/flatted to a version that resolves this vulnerability.

    Fixed in 3.4.0
  2. Upgrade

    Upgrade flatted to a version that resolves this vulnerability.

    Fixed in 3.4.0Patch PR #88

Event History

Mar 12, 2026
CVE Published
via MITRE·06:08 PM
Data Sourced
via MITRE·06:08 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:16 PM
RemedyAffected Software
Data Sourced
via Red Hat·07:01 PM
DescriptionSeverityAffected Software
Mar 13, 2026
Advisory Published
via GitHub·03:40 PM
Data Sourced
via GitHub·03:40 PM
DescriptionSeverityWeaknessAffected Software
Jun 24, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-32141?

CVE-2026-32141 is classified as a denial-of-service vulnerability due to unbounded recursion.

2

How do I fix CVE-2026-32141?

To fix CVE-2026-32141, upgrade to flatted version 3.4.0 or later.

3

What causes CVE-2026-32141?

CVE-2026-32141 is caused by the parse() function in flatted using a recursive method to handle deeply nested or self-referential JSON.

4

Which versions of flatted are affected by CVE-2026-32141?

Versions of flatted prior to 3.4.0 are affected by CVE-2026-32141.

5

How can CVE-2026-32141 affect my application?

Exploiting CVE-2026-32141 can lead to denial-of-service conditions in applications using vulnerable versions of the flatted library.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203