CVE-2025-64718: Js-yaml Vulnerability & Fix
This article discusses a medium-severity vulnerability, CVE-2025-64718, detected in version 3.7.0 of the js-yaml library. We'll break down the details of the vulnerability, its potential impact, and how to remediate it.
Vulnerable Library: js-yaml-3.7.0.tgz
js-yaml is a JavaScript YAML parser and serializer. YAML is a human-readable data serialization language. The affected library version is 3.7.0.tgz, and it's crucial to understand the context in which this library is being used to assess the potential impact of the vulnerability.
- Library Description: YAML 1.2 parser and serializer.
- Library Home Page: https://registry.npmjs.org/js-yaml/-/js-yaml-3.7.0.tgz
- Path to Dependency File:
/package.json - Path to Vulnerable Library:
/node_modules/js-yaml/package.json
Dependency Hierarchy
The vulnerability exists within a dependency chain. Here's how js-yaml-3.7.0.tgz is reached in the project:
- css-loader-0.28.4.tgz (Root Library)
- cssnano-3.10.0.tgz
- postcss-svgo-2.1.6.tgz
- svgo-0.7.2.tgz
- js-yaml-3.7.0.tgz (Vulnerable Library)
This dependency chain highlights that js-yaml is a sub-dependency of svgo, which is itself a sub-dependency of other packages. This nested structure means that even if your project doesn't directly depend on js-yaml, it could still be vulnerable through these transitive dependencies. Understanding this hierarchy is vital for effective remediation.
Commit and Branch Information
- Found in HEAD commit: https://github.com/kapseliboi/mimic/commit/6d4fe404335bf56c57080e4ab1425b65bbe3ac2f
- Found in base branch:
master
The identification of the vulnerable commit and branch provides a specific context for developers to investigate and address the vulnerability within their codebase. It allows for focused efforts in patching or upgrading the affected components.
Vulnerability Details
Prototype pollution is the core issue of CVE-2025-64718. js-yaml versions 4.1.0 and below are susceptible to attackers modifying the prototype of parsed YAML documents via the __proto__ property. If you are parsing untrusted YAML documents, you are potentially at risk. This vulnerability is patched in js-yaml version 4.1.1.
Prototype pollution is a type of vulnerability that allows attackers to inject properties into the base JavaScript object, which can then affect all objects in the application. This can lead to various security issues, including:
- Denial of Service (DoS): By polluting the prototype with properties that cause errors or performance issues, an attacker can disrupt the application's functionality.
- Arbitrary Code Execution: In some cases, prototype pollution can be leveraged to execute arbitrary code on the server or client-side.
- Information Disclosure: An attacker might be able to access sensitive information by polluting the prototype with properties that expose internal data.
Mitigation Strategies
Besides upgrading, consider these mitigation strategies:
- Node.js
--disable-proto=deleteflag: This flag can help prevent prototype pollution attacks in Node.js environments. - Deno: Deno, a secure runtime for JavaScript and TypeScript, has built-in pollution protection enabled by default.
Key Dates and Links
- Publish Date: 2025-11-13
- URL: https://www.mend.io/vulnerability-database/CVE-2025-64718
CVSS 3 Score Details (5.3 - Medium)
The Common Vulnerability Scoring System (CVSS) provides a standardized way to assess the severity of vulnerabilities. CVE-2025-64718 has a CVSS 3 score of 5.3, which is considered Medium. This score is derived from various factors, including the attack vector, complexity, and impact.
Base Score Metrics
- Exploitability Metrics: These metrics reflect the ease with which the vulnerability can be exploited.
- Attack Vector: Network - The vulnerability can be exploited over a network.
- Attack Complexity: Low - The vulnerability is relatively easy to exploit.
- Privileges Required: None - No special privileges are required to exploit the vulnerability.
- User Interaction: None - No user interaction is required to trigger the vulnerability.
- Scope: Unchanged - An exploited vulnerability can only affect resources managed by the same security authority.
- Impact Metrics: These metrics reflect the potential impact of a successful exploit.
- Confidentiality Impact: None - There is no impact on data confidentiality.
- Integrity Impact: Low - There is some impact on data integrity.
- Availability Impact: None - There is no impact on system availability.
The CVSS score of 5.3 indicates that while the vulnerability is network-exploitable and requires no privileges or user interaction, the impact is limited to low integrity impact, with no impact on confidentiality or availability. This means that a successful exploit could potentially lead to data modification, but would not result in data disclosure or system downtime. Understanding the CVSS score and its components is essential for prioritizing vulnerability remediation efforts.
For more information on CVSS3 Scores, click here.
Suggested Fix
The primary solution is to upgrade to a patched version of js-yaml. Upgrade to version 4.1.1 or later.
- Type: Upgrade version
- Origin: https://github.com/nodeca/js-yaml/security/advisories/GHSA-mh29-5h37-fv8m
- Release Date: 2025-11-13
- Fix Resolution (js-yaml): 4.1.1
- Direct dependency fix Resolution (css-loader): 1.0.0
Upgrade Instructions
Depending on your project's package manager (npm, yarn, etc.), use the appropriate command to update js-yaml and css-loader.
npm:
npm update js-yaml css-loader
yarn:
yarn upgrade js-yaml css-loader
After upgrading, thoroughly test your application to ensure that the changes haven't introduced any regressions. Pay close attention to any functionality that relies on YAML parsing.
Conclusion
CVE-2025-64718 is a medium-severity vulnerability in js-yaml-3.7.0.tgz that can lead to prototype pollution. It's crucial to upgrade to version 4.1.1 or later to mitigate this risk. Also, consider using the --disable-proto=delete flag in Node.js or using Deno for enhanced security. By understanding the vulnerability details and following the suggested fix, you can protect your application from potential attacks.
For more information about Prototype Pollution, visit OWASP.
Step up your Open Source Security Game with Mend here