CVE-2026-34043: Denial of Service in serialize-javascript via Crafted Array-like Objects

serialize-javascript Updated 27 Mar 2026

Summary

27/03/2026
Yes i
Moderate
5.9

CVE-2026-34043: Serialize JavaScript has CPU Exhaustion Denial of Service via crafted array-like objects. Affects serialize-javascript versions < 7.0.5. Fixed in 7.0.5. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

serialize-javascript is a widely used npm package that safely serializes JavaScript objects into a format that can be safely embedded in HTML. It is commonly utilized in web applications to handle user input and data serialization. However, it has a vulnerability that can lead to CPU exhaustion, making applications unresponsive when processing certain specially crafted objects.

Vulnerability Detail

The vulnerability arises from a Denial of Service (DoS) condition caused by CPU exhaustion. When the serialize-javascript package attempts to serialize a specially crafted 'array-like' object (an object that inherits from Array.prototype but has a very large length property), it enters an intensive loop that consumes 100% CPU resources and hangs indefinitely. This issue primarily affects applications that serialize untrusted or user-controlled objects, especially if they are also vulnerable to Prototype Pollution or handle untrusted data via YAML Deserialization.

How To Fix

Latest published version: 7.1.3 as of 22 Oct 2026

npm install serialize-javascript@7.1.3

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

If you need the minimum change

7.0.5

This is the first release that contains the fix.

npm install serialize-javascript@7.0.5

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

While there is no direct code-level workaround within the library itself, users can mitigate the risk by validating and sanitizing all input before passing it to the serialize() function. Additionally, ensure that the environment is protected against Prototype Pollution. Here is an example of input validation:

function validateInput(input) {
  if (typeof input !== 'object' || input === null) {
    throw new Error('Invalid input: must be a non-null object.');
  }
  // Further validation logic...
}

Conclusion

The serialize-javascript package has a critical Denial of Service vulnerability that can lead to CPU exhaustion when handling specially crafted objects. Users are strongly advised to upgrade to version 7.0.5 or later to mitigate this risk and ensure the security of their applications.

See every vulnerability recorded for serialize-javascript →

Share this vulnerability

FAQ

The vulnerability is a Denial of Service (DoS) issue that leads to CPU exhaustion when serializing specially crafted array-like objects.

Applications using the serialize-javascript package to serialize untrusted or user-controlled objects are at risk, especially if they are also vulnerable to Prototype Pollution.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application against this vulnerability using the Vulert playground without any signup.

You should validate and sanitize all input before passing it to the serialize() function to mitigate the risk until you can upgrade.

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

Related vulnerabilities

Recent vulnerabilities recorded for serialize-javascript.

How To Fix

Latest published version: 7.1.3 as of 22 Oct 2026

npm install serialize-javascript@7.1.3

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

If you need the minimum change

7.0.5

This is the first release that contains the fix.

npm install serialize-javascript@7.0.5

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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