Read the docs
TI-2026-68394 Aliases GHSA-jggr-w7fw-pc2j

Stack exhaustion in fast-copy when copying deeply nested values

Priority LOW 38CWE-674Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
Denial of service
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-674.

Summary

fast-copy versions from 4.0.0 before 4.1.0, from 3.0.0 before 3.1.0, and before 2.2.0 are affected. Both copy and copyStrict recurse once per level of nesting with no depth limit (CWE-674). A deeply nested value, which need not be circular or large, exhausts the JavaScript call stack and makes the call throw a RangeError, so applications that copy externally supplied data can fail.

Written with Claude Haiku 5.5 from the sources below · 2026-10-29

Description from the GitHub advisory

## Summary `fast-copy` traverses values recursively with no bound on depth. Copying a sufficiently deeply-nested value exhausts the JavaScript call stack and throws a native `RangeError: Maximum call stack size exceeded` from inside the library. ## Details Both `copy` and `copyStrict` recurse once per level of nesting. The value does not need to be circular (circular references were already handled correctly via an internal cache) and it does not need to be large. A plain object nested a few thousand levels deep is only a few kilobytes of equivalent JSON. Measured depths at which copying begins to fail (Node.js, V8; the exact ceiling varies with JIT state and the stack available to the environment): | Call | Last depth that copies successfully | | -------------------- | ----------------------------------- | | `copy(object)` | 2811 | | `copy(array)` | 3983 | | `copyStrict(object)` | 1874 | | `copyStrict(array)` | 1874 | `JSON.parse` is iterative and parses deeply-nested input without difficulty, so a payload that deserializes cleanly can fail in a subsequent `copy` call. ## Impact The failure is a synchronous, catchable `RangeError` confined to the `copy` call that received the value. There are no memory safety concerns, no data exposure, and no effect on state outside that call. In a typical server the result is a failed request rather than a failed process. Applications that call `copy` on externally-supplied data, such as request bodies, cached payloads, merged configuration, etc., do not expect a clone helper to throw may surface this as an unhandled error. ## Patches Fixed in 4.1.0, and backported to 3.1.0 and 2.2.0 so that every major line has a patch available without requiring a breaking upgrade. Traversal is now bounded by a `maxDepth` option, defaulting to `1000`, which sits below the native limit in standard environments. Exceeding it throws `MaxDepthExceededError`, which carries the limit that was exceeded and extends `RangeError` so existing handling continues to match. The limit is configurable for consumers with legitimately deep data. On `3.x` and `4.x` it is set when creating a copier: ```js import { createCopier } from 'fast-copy'; export const copy = createCopier({ maxDepth: 5000 }); ``` On `2.x` it is passed per call, and the error is a property of the exported function rather than a named export: ```js import copy from 'fast-copy'; copy(value, { maxDepth: 5000 }); // detection: error instanceof copy.MaxDepthExceededError ``` In legacy environments without `Object.setPrototypeOf`, `instanceof MaxDepthExceededError` cannot be supported; check `error.name === 'MaxDepthExceededError'` or `error instanceof RangeError` instead.

Why it matters now

Fix Fixed fast-copy (npm): 4.1.0, 3.1.0, 2.2.0

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—fast-copy (npm)4.0.0 to before 4.1.04.1.0Patch availableGHSA-jggr-w7fw-pc2j
—fast-copy (npm)3.0.0 to before 3.1.03.1.0Patch availableGHSA-jggr-w7fw-pc2j
—fast-copy (npm)before 2.2.02.2.0Patch availableGHSA-jggr-w7fw-pc2j
  • fast-copy (npm) Vendor— Affected 4.0.0 to before 4.1.0 Fixed in 4.1.0 Patch available GHSA-jggr-w7fw-pc2j
  • fast-copy (npm) Vendor— Affected 3.0.0 to before 3.1.0 Fixed in 3.1.0 Patch available GHSA-jggr-w7fw-pc2j
  • fast-copy (npm) Vendor— Affected before 2.2.0 Fixed in 2.2.0 Patch available GHSA-jggr-w7fw-pc2j

Remediation

Upgrade fast-copy to 4.1.0, 3.1.0 or 2.2.0, which bound traversal with a maxDepth option that defaults to 1000.

Written with Claude Haiku 5.5 from the sources below · 2026-10-29

  • Fix · GHSA-jggr-w7fw-pc2j fast-copy (npm) Fixed in 4.1.0 Advisory →
  • Fix · GHSA-jggr-w7fw-pc2j fast-copy (npm) Fixed in 3.1.0 Advisory →
  • Fix · GHSA-jggr-w7fw-pc2j fast-copy (npm) Fixed in 2.2.0 Advisory →

Timeline

  1. 2026-10-06 Threatist record created from GHSA-jggr-w7fw-pc2j

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences