CVE-2025-54803: js-toml Prototype Pollution Vulnerability
Summary
CVE-2025-54803: js-toml Prototype Pollution Vulnerability. Affects js-toml versions < 1.0.2. Fixed in 1.0.2. How to fix ↓
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.
No signup required · Results in about 60 seconds
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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for js-toml.