{"id":"GHSA-25h7-pfq9-p65f","revision":"66171fd8b4214d4cb5c0085739a3fb44","records":[{"revision":"66171fd8b4214d4cb5c0085739a3fb44","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-25h7-pfq9-p65f","aliases":["CVE-2026-32141"],"title":"flatted vulnerable to unbounded recursion DoS in parse() revive phase","description":"## Summary\n\nflatted'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.\n\n## Impact\n\nDenial of Service (DoS). Any application that passes untrusted input to `flatted.parse()` can be crashed by an unauthenticated attacker with a single request.\n\nflatted has ~87M weekly npm downloads and is used as the circular-JSON serialization layer in many caching and logging libraries.\n\n## Proof of Concept\n\n```javascript\nconst flatted = require('flatted');\n\n// Build deeply nested circular reference chain\nconst depth = 20000;\nconst arr = new Array(depth + 1);\narr[0] = '{\"a\":\"1\"}';\nfor (let i = 1; i <= depth; i++) {\n  arr[i] = `{\"a\":\"${i + 1}\"}`;\n}\narr[depth] = '{\"a\":\"leaf\"}';\n\nconst payload = JSON.stringify(arr);\nflatted.parse(payload); // RangeError: Maximum call stack size exceeded\n```\n\n## Fix\n\nThe maintainer has already merged an iterative (non-recursive) implementation in PR #88, converting the recursive `revive()` to a stack-based loop.\n\n## Affected Versions\n\nAll versions prior to the PR #88 fix.","state":0,"publishedAt":"2026-03-13T15:40:42+00:00","modifiedAt":"2026-09-10T03:50:36.2761744+00:00","affected":[{"ecosystem":"npm","name":"flatted","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"3.4.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/WebReflection/flatted/security/advisories/GHSA-25h7-pfq9-p65f","https://nvd.nist.gov/vuln/detail/CVE-2026-32141","https://github.com/WebReflection/flatted/pull/88","https://github.com/WebReflection/flatted/commit/7eb65d857e1a40de11c47461cdbc8541449f0606","https://github.com/WebReflection/flatted"],"sourceUrl":"https://github.com/advisories/GHSA-25h7-pfq9-p65f","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-25h7-pfq9-p65f","identifiers":["GHSA-25h7-pfq9-p65f","CVE-2026-32141"]},"retained":false,"historicalAffected":[]}],"coverage":[]}