Skip to content

GHSA-mh29-5h37-fv8m CVE-2025-64718

js-yaml has prototype pollution in merge (<<)

Medium npm
Severity
5.3 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.42%
Chance of exploitation in the next 30 days. Higher than 36.64% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-1321 Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Fix
4.1.1
Upgrade js-yaml to this version or later

Description

Impact

In js-yaml 4.1.0, 4.0.0, and 3.14.1 and below, 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.

Patches

Problem is patched in js-yaml 4.1.1 and 3.14.2.

Workarounds

You 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).

References

https://cheatsheetseries.owasp.org/cheatsheets/Prototype_Pollution_Prevention_Cheat_Sheet.html

Affected versions

npm

PackageVulnerableFixed in
js-yaml
>= 4.0.0, < 4.1.1
4.1.1
js-yaml
< 3.14.2
3.14.2
js-yaml
>= 4.0.0, < 4.1.1
4.1.1
js-yaml
< 3.14.2
3.14.2

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

js-yaml npm → 4.1.1

npm
npm install js-yaml@4.1.1
yarn
yarn add js-yaml@4.1.1
pnpm
pnpm add js-yaml@4.1.1

Severity breakdown

CVSS 3.1 5.3

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

Weakness

CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.

How to prevent it
  • Implementation: By freezing the object prototype first (for example, Object.freeze(Object.prototype)), modification of the prototype becomes impossible.
  • Architecture and Design: By blocking modifications of attributes that resolve to object prototype, such as proto or prototype, this weakness can be mitigated.
  • Implementation: When handling untrusted objects, validating using a schema can be used.
  • Implementation: By using an object without prototypes (via Object.create(null) ), adding object prototype attributes by accessing the prototype via the special attributes becomes impossible, mitigating this weakness.
  • Implementation: Map can be used instead of objects in most cases. If Map methods are used instead of object attributes, it is not possible to access the object prototype or modify it.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-r3ph-w7gj-g6xm
js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources
Medium Also affects js-yaml
GHSA-2883-xcg3-v3hh
js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources
High Also affects js-yaml
GHSA-5p4m-2wfm-xmqj
JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026-59870 fix not backported
High Also affects js-yaml
GHSA-pm4m-ph32-ghv5
js-yaml: Exponential parsing time in flow collections leads to denial of service
High Also affects js-yaml
GHSA-724g-mxrg-4qvm
js-yaml: Quadratic-complexity (O(n^2)) DoS via !!omap tag in YAML11_SCHEMA
High Also affects js-yaml
GHSA-52cp-r559-cp3m
js-yaml: YAML merge-key chains can force quadratic CPU consumption
High Also affects js-yaml
GHSA-g796-fgmg-93mv
js-yaml: YAML merge-key chains can force quadratic CPU consumption in js-yaml
High Also affects js-yaml
GHSA-h67p-54hq-rp68
JS-YAML: Quadratic-complexity DoS in merge key handling via repeated aliases
Medium Also affects js-yaml

Credits: Zephkek, alexstrive, jlp-craigmorten, mhassan1, opal-visibuild, turi4200

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor