CVE-2026-40345
NoneCVSS
—
EPSS
0.5%
Published
Aug 20, 2026
CISA due date
—
Cloudanix analysis
A data-combining helper used inside some applications can be tricked into crashing the whole program when given specially crafted looping data structures.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The deepmerge, deepmergeCustom, deepmergeInto, and deepmergeIntoCustom functions lack visited-object tracking, allowing unbounded recursion when self-referential object graphs are supplied at matching property paths and resulting in synchronous RangeError: Maximum call stack size exceeded.
Why it matters to the business
Applications performing deep merges on untrusted object structures can experience abrupt process crashes or repeated worker restarts, producing denial-of-service conditions without persistent data loss.
How an attack unfolds
An attacker constructs a pair of objects containing cyclic references at identical paths, passes them to any of the affected merge APIs, and triggers immediate stack exhaustion inside the Node.js event loop.
How to fix it
Upgrade deepmerge-ts to version 8.0.0 or later; after upgrade, re-test all merge call sites with representative recursive inputs to confirm the stack-limit guard is active.
How to confirm the fix worked
Inventory package.json or lockfiles for deepmerge-ts versions prior to 8.0.0; run a unit test that supplies a pair of mutually recursive objects to each merge function and verify that a controlled error or safe return occurs instead of a stack overflow.
Typical attack path
- Locate application endpoints or code paths that invoke deepmerge-ts merge functions on external input
- Craft two JavaScript objects that reference each other at the same property depth
- Submit the objects through the merge entry point
- Observe synchronous RangeError crash or worker restart
How to detect it
Search Node.js application and worker logs for "RangeError: Maximum call stack size exceeded" entries that coincide with calls to deepmerge, deepmergeCustom, deepmergeInto, or deepmergeIntoCustom; correlate with request timestamps that accept complex object payloads.
- RangeError: Maximum call stack size exceeded
- deepmerge-ts merge functions in stack trace
What your security team should do
- Immediately update deepmerge-ts to 8.0.0+ in all services and rebuild containers
- Add input-schema validation or depth limits around any merge of untrusted data
- Monitor application logs for RangeError stack traces originating from merge functions
- Review downstream dependents that consume the library to ensure transitive upgrades occur
The record
deepmerge-ts is a typescript library providing functionality to deep merging of javascript objects. Prior to 8.0.0, the deepmerge, deepmergeCustom, deepmergeInto, and deepmergeIntoCustom APIs do not track visited objects or object pairs when recursively merging records. When two input values contain self-references at the same property path, the merge logic repeatedly revisits the same pair until Node.js raises RangeError: Maximum call stack size exceeded. Applications that merge attacker-controlled recursive object graphs can synchronously crash the affected process or cause repeated worker restarts. Plain JSON input alone cannot create the recursive graph required to trigger the issue. This issue is fixed in version 8.0.0.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-121092 Uncontrolled recursion in SVG in Google Chrome prior to 157.0.8103.38 allowed a remote… CWE-674
- CVE-2026-63475 isomorphic-git is a pure JavaScript implementation of Git for Node.js and browsers. CWE-674
- CVE-2026-115290 Uncontrolled Recursion (CWE-674) in Elasticsearch can lead to denial of service via… CWE-674
- CVE-2026-121423 SurrealDB before 3.3.0 contains an unbounded recursion vulnerability that allows… CWE-674
- CVE-2026-120689 HDF5 through 2.2.0 contains an uncontrolled recursion vulnerability in… CWE-674
- CVE-2026-101180 DoS vulnerability in the file parsing module. CWE-674
- CVE-2026-120135 Uncontrolled Recursion vulnerability in Apache Thrift Java bindings. CWE-674
- CVE-2026-62303 Pistache is a high-performance REST toolkit written in C++. CWE-674