Stack Exhaustion Vulnerability in fast-copy: Maximum Call Stack Size Exceeded

fast-copy Updated 06 Oct 2026

Summary

05/10/2026
MODERATE
Yes i
Moderate
6.3

GHSA-jggr-w7fw-pc2j: fast-copy: Stack exhaustion in fast-copy when copying deeply-nested values. Affects fast-copy across 3 version ranges.

< 2.2.0 >= 3.0.0, < 3.1.0 >= 4.0.0, < 4.1.0

Fixed in 2.2.0, 3.1.0 or 4.1.0, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

fast-copy is a JavaScript library designed for efficiently copying values, including objects and arrays. It is widely used in applications that require deep cloning of data structures. The library's primary features include handling circular references and providing a straightforward API for copying complex nested values. However, it is susceptible to a stack exhaustion vulnerability when copying deeply-nested values, which can lead to application failures.

Vulnerability Detail

The vulnerability arises from fast-copy's recursive approach to copying values without a limit on nesting depth. When attempting to copy a deeply-nested object or array, the JavaScript call stack can become exhausted, resulting in a native RangeError: Maximum call stack size exceeded. This issue can occur with relatively small payloads that are deeply nested, leading to failed requests in applications that rely on this library for cloning data. The vulnerability is confined to the copy call and does not pose memory safety concerns or data exposure risks.

How To Fix

Latest published version: 4.2.0 as of 22 Oct 2026

npm install fast-copy@4.2.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.2.0 2.2.0
    npm install fast-copy@2.2.0
  • >= 3.0.0, < 3.1.0 3.1.0
    npm install fast-copy@3.1.0
  • >= 4.0.0, < 4.1.0 4.1.0
    npm install fast-copy@4.1.0

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If immediate upgrading is not feasible, you can implement a workaround by setting a maximum depth for copying. For example, in versions 3.x and 4.x, you can create a copier with a specified maxDepth as follows: import { createCopier } from 'fast-copy'; export

const copy = createCopier({ maxDepth: 5000 });

In version 2.x, you can pass maxDepth per call: import copy from 'fast-copy';

copy(value, { maxDepth: 5000 });

Conclusion

The stack exhaustion vulnerability in fast-copy poses a risk when copying deeply-nested values, leading to potential application failures. Updating to the latest patched versions or implementing a maxDepth workaround can mitigate this issue. Monitoring tools like Vulert can help ensure your application remains secure against such vulnerabilities.

See every vulnerability recorded for fast-copy →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 6.3, indicating a moderate severity level.

You can use Vulert, which monitors open-source vulnerabilities in your software. By analyzing your package-lock.json file, it can alert you in real-time. You can also check your application using the Vulert playground without signing up.

If left unaddressed, this vulnerability can lead to application crashes when deeply-nested values are copied, resulting in failed requests and a poor user experience.

No, the vulnerability does not pose any risk of data exposure or memory safety concerns; it only affects the copy operation.

Yes, the maxDepth option is configurable, allowing you to set a higher limit for applications that require it, ensuring safe copying of deeply nested structures.

How To Fix

Latest published version: 4.2.0 as of 22 Oct 2026

npm install fast-copy@4.2.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.2.0 2.2.0
    npm install fast-copy@2.2.0
  • >= 3.0.0, < 3.1.0 3.1.0
    npm install fast-copy@3.1.0
  • >= 4.0.0, < 4.1.0 4.1.0
    npm install fast-copy@4.1.0

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback