CVE-2025-54803: js-toml Prototype Pollution Vulnerability

js-toml Updated 14 Dec 2025

Summary

04/08/2025
Yes i
High
7.9

CVE-2025-54803: js-toml Prototype Pollution Vulnerability. Affects js-toml versions < 1.0.2. Fixed in 1.0.2. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The js-toml package is a JavaScript library used for parsing TOML (Tom's Obvious, Minimal Language) configuration files. It allows developers to easily read and manipulate TOML data structures within their applications. However, due to its design, js-toml is susceptible to prototype pollution, a security issue that can lead to severe vulnerabilities in applications that rely on it.

Vulnerability Detail

A prototype pollution vulnerability in js-toml allows a remote attacker to manipulate properties of the global Object.prototype by parsing specially crafted TOML input. This can lead to critical security issues, such as authentication bypass, Denial of Service (DoS), or even Remote Code Execution (RCE), depending on how the application handles object properties. The vulnerability arises when the library processes TOML strings containing the key 'proto', enabling attackers to modify the behavior of the application.

How To Fix

Latest published version: 2.0.1 as of 22 Oct 2026

npm install js-toml@2.0.1

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

If you need the minimum change

1.0.2

This is the first release that contains the fix.

npm install js-toml@1.0.2

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

Workaround

If upgrading is not immediately possible, ensure that any TOML input passed to the js-toml library comes from a fully trusted source and validate it to prevent malicious keys. For example, you can implement input validation like this:

const safeTomlInput = validateInput(userInput);
const parsedData = jsToml.parse(safeTomlInput);

Conclusion

The js-toml package has a critical prototype pollution vulnerability (CVE-2025-54803) that can lead to severe security issues in applications. It is crucial for developers to upgrade to version 1.0.2 or later to mitigate this risk. If upgrading is not feasible, implementing strict input validation is essential to protect against potential exploits.

See every vulnerability recorded for js-toml →

Share this vulnerability

FAQ

Prototype pollution is a security vulnerability that allows an attacker to modify the prototype of built-in objects in JavaScript, potentially leading to unexpected behavior and security issues.

If your application uses js-toml to parse untrusted input, an attacker could exploit this vulnerability to manipulate object properties, leading to authentication bypass, DoS, or RCE.

If you are using a version of js-toml prior to 1.0.2, your application is vulnerable to this issue, especially if it processes untrusted TOML input.

If you cannot upgrade, ensure that all TOML input is from trusted sources and validate it to avoid malicious keys.

You can use tools like Vulert, which monitors and alerts for open-source vulnerabilities in your software using just the package-lock.json file. You can also check if your application is affected by this vulnerability using the Vulert playground without any signup.

Related vulnerabilities

Recent vulnerabilities recorded for js-toml.

How To Fix

Latest published version: 2.0.1 as of 22 Oct 2026

npm install js-toml@2.0.1

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

If you need the minimum change

1.0.2

This is the first release that contains the fix.

npm install js-toml@1.0.2

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