Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦 npm
Not in CISA KEV

fast-copy: Stack exhaustion in fast-copy when copying deeply-nested valuesGHSA-jggr-w7fw-pc2j

Fix: planttheidea/fast-copy#137

GHSA-jggr-w7fw-pc2j is a remote code execution vulnerability in fast-copy. A fix is available for fast-copy — see the affected versions and patch details below.

Published
Updated
Affected
3 pkgs
Patched
3 / 3
Exploits
None indexed
Exploitation data as of Oct 5, 2026 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

3 pkgs affected
📦fast-copy📦fast-copy📦fast-copy

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.

Description

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):

CallLast 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:

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:

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.

Affected Packages

3 total 3 fixed
EcosystemPackageVulnerable rangeFix
📦npmfast-copy≥ 4.0.0&&< 4.1.04.1.0npm install fast-copy@4.1.0
📦npmfast-copy≥ 3.0.0&&< 3.1.03.1.0npm install fast-copy@3.1.0
📦npmfast-copyall versions2.2.0npm install fast-copy@2.2.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for fast-copy, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update fast-copy to 4.1.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-jggr-w7fw-pc2j is resolved across your whole dependency graph.

  3. Workarounds

    Do not deserialise data from untrusted sources: where the format allows it, restrict deserialisation to an explicit allowlist of expected types, and prefer a data-only format (JSON, Protobuf) over one that can reconstruct arbitrary objects until you can upgrade.

Frequently Asked Questions

## 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 b
O3 Security · Impact-Aware SCA

Is GHSA-jggr-w7fw-pc2j in your dependencies?

Find it across npm, including transitive dependencies.

fast-copy: Stack exhaustion in fast-copy when copying…