Critical Vulnerability in node-json5: Prototype Pollution Risk

node-json5 Updated 03 Oct 2025

Summary

30/04/2024
N/A
Yes i
Unrated
Not published

USN-6758-1: node-json5 vulnerability. Affects node-json5 versions < 0.5.1-1ubuntu0.1~esm1. Fixed in 0.5.1-1ubuntu0.1~esm1. 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

node-json5 is a popular JavaScript library that extends JSON with additional features, allowing for more flexible data representation. It is widely used in various applications for parsing and stringifying JSON-like data. However, a recently discovered vulnerability in this package poses a significant risk, as it allows attackers to manipulate object prototypes, potentially leading to severe security issues.

Vulnerability Detail

The vulnerability arises from the JSON5 parse method's improper handling of keys named 'proto'. This flaw can be exploited by attackers to pollute the prototype of the returned object, enabling them to set arbitrary or unexpected keys. The consequences of this vulnerability can range from denial of service to unauthorized access to network services, depending on how the affected application utilizes the node-json5 module.

How To Fix

Minimum fixed version

0.5.1-1ubuntu0.1~esm1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-json5

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

Workaround

If immediate upgrading is not feasible, consider implementing input validation to sanitize keys before parsing JSON5 data. This can help mitigate the risk of prototype pollution until the package is updated.

Conclusion

The node-json5 vulnerability presents a serious risk due to its potential for prototype pollution. It is crucial for users of this package to update to the latest patched versions to safeguard their applications. Implementing input validation can serve as a temporary measure until an update is applied.

See every vulnerability recorded for node-json5 →

Share this vulnerability

FAQ

The vulnerability allows for prototype pollution through improper handling of keys, which can lead to security risks.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The impacts can include denial of service, unauthorized access to network services, and other unspecified consequences depending on the application's use of the module.

Yes, implementing input validation to sanitize keys can help mitigate the risk until the package is updated.

Related vulnerabilities

Recent vulnerabilities recorded for node-json5.

How To Fix

Minimum fixed version

0.5.1-1ubuntu0.1~esm1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-json5

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