Skip to main content

js-yaml CVE-2026-53550

| EUVDEUVD-2026-38256 MEDIUM
Inefficient Algorithmic Complexity (CWE-407)
2026-06-15 https://github.com/nodeca/js-yaml GHSA-h67p-54hq-rp68
5.3
CVSS 3.1 · Vendor: https://github.com/nodeca/js-yaml
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify Node.js service accepting untrusted YAML input
  2. Delivery
    Craft YAML with high-K anchor and high-M repeated aliases in merge sequence
  3. Exploit
    Submit ~87 KB payload to parsing endpoint
  4. Execution
    Trigger O(K×M) CPU exhaustion in storeMappingPair()
  5. Persist
    Block Node.js event loop for 3-4 seconds
  6. Impact
    Repeat submissions to sustain denial of service

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V2 - Validation and Business Logic Algorithmic complexity limits
Exploitation Conditions

Exploitation is triggered whenever js-yaml <= 4.1.1 parses a YAML document that uses the YAML 1.1 merge-key syntax with a sequence value (<<: [*alias, *alias, ...]) containing repeated references to the same anchor. No authentication is required (CVSS PR:N), no special server configuration is needed beyond the service accepting YAML input, and no user interaction is required. Exploitation is limited to environments that: (1) run js-yaml version 4.1.1 or earlier, (2) pass untrusted or attacker-controlled input to the js-yaml parser, and (3) do not impose upstream limits on YAML payload size or parsing time. Services that parse YAML exclusively from trusted, static sources (configuration files, internal pipelines) are not at risk. The Node.js single-threaded event loop model amplifies impact, as a single blocked parse operation halts all concurrent request handling.

Impact

The NVD-assigned CVSS 3.1 score of 5.3 (Medium) with A:L (Low availability) understates practical severity: the PoC demonstrates approximately 3.5 seconds of event loop blockage from an 87 KB payload (K=M=8000), and because Node.js is single-threaded, this completely prevents all other requests from being processed during that window. Repeated low-bandwidth submissions can sustain denial of service indefinitely. The AV:N/AC:L/PR:N/UI:N vector is accurate - no authentication, no configuration prerequisites, and no user interaction are required, making this trivially exploitable against any exposed endpoint. No EPSS score was provided in the available data, so exploitation probability cannot be quantified from that signal. No CISA KEV listing exists, indicating no confirmed widespread active exploitation at time of analysis. However, the public availability of a detailed PoC with precise reproduction steps significantly lowers the exploitation barrier. Risk is highest for Node.js services that accept untrusted YAML without upstream size or complexity limits: API gateways, CI/CD pipelines, infrastructure automation tools, and configuration processors are the primary concern.

Exploit ScenarioDerived

An attacker identifies a Node.js API endpoint that accepts user-supplied YAML - such as a configuration upload or data import feature. They submit a crafted YAML document containing an anchor mapping with 8,000 keys and a merge sequence that repeats the same alias 8,000 times, totaling approximately 87 KB. The js-yaml parser processes this input and blocks the Node.js event loop for roughly 3-4 seconds; by sending a continuous stream of such payloads from a single low-bandwidth connection, the attacker sustains denial of service and prevents legitimate traffic from being served. A proof-of-concept reproduction script is publicly available in GHSA-h67p-54hq-rp68.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 15, 2026

Quadratic CPU exhaustion in js-yaml (npm) versions 4.1.1 and earlier allows unauthenticated remote attackers to block a Node.js event loop for multiple seconds using a crafted YAML payload under 100 KB, resulting in denial of service. The flaw lies in the merge-key parser's failure to deduplicate repeated alias references before invoking per-key processing, producing O(K×M) work from O(K+M) input. A detailed proof-of-concept with reproducible timing benchmarks is publicly available via GitHub Security Advisory GHSA-h67p-54hq-rp68; no active exploitation is confirmed in CISA KEV at time of analysis.

RemediationAI

Upgrade js-yaml to version 4.2.0 or later, which introduces reference deduplication in storeMappingPair() via a Set-based seen-check before invoking mergeMappings(), preserving full YAML 1.1 merge semantics. The advisory is at https://github.com/nodeca/js-yaml/security/advisories/GHSA-h67p-54hq-rp68. If an immediate upgrade is not feasible, apply an upstream payload size limit - for example, reject YAML inputs exceeding a configurable byte threshold (e.g., 16 KB for most use cases) before passing them to the parser; note this may reject legitimate large documents and requires careful threshold tuning. A second compensating control is to restrict YAML parsing to trusted internal sources only and prevent untrusted input from reaching any code path that calls js-yaml. There is no configuration flag in js-yaml itself to disable merge-key processing without modifying the library. Generic input sanitization at the application layer is not sufficient, as the malicious complexity is hidden in syntactically valid YAML.

Affected VersionsENISA

js-yaml < 4.2.0

Affected Packages

npm js-yaml fix: 3.15.0, 4.2.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

js-yaml (pkg:npm/js-yaml) is a widely deployed JavaScript/Node.js YAML 1.1 parser. The vulnerability (CWE-407: Inefficient Algorithmic Complexity) is rooted in lib/loader.js in the storeMappingPair() function, which handles the YAML 1.1 merge key tag tag:yaml.org,2002:merge (commonly <<:). When a merge value is a sequence - <<: [*a, *a, ...*a] - the function iterates each element and calls mergeMappings() without first deduplicating alias references. Each mergeMappings() call performs an Object.keys(source) allocation of O(K) and K hasOwnProperty checks against the destination object. Because all M aliases resolve to the same anchored object in state.anchorMap, every call after the first is a semantic no-op, yet the computation is repeated in full. Total work is O(K×M), while input size is only O(K+M), yielding quadratic scaling. YAML 1.1 merge semantics are explicitly idempotent and commutative over duplicate sources, so deduplication is a lossless fix with no spec trade-off.

Know when Node.js gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/nodeca/js-yaml) PRIMARY 5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
vuln.today AI 7.5 HIGH

No auth or configuration prerequisites; a single small payload blocks the entire Node.js event loop for 3+ seconds, constituting high availability impact rather than the NVD-assigned low.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE MEDIUM
Red Hat 5.3 MEDIUM

Primary rating from Vendor (https://github.com/nodeca/js-yaml).

CVSS VectorVendor: https://github.com/nodeca/js-yaml

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

DescriptionCVE.org

Summary

A crafted YAML document can trigger algorithmic CPU exhaustion in js-yaml merge-key processing (<<) by repeating the same alias many times in a merge sequence. This causes quadratic parse-time behavior relative to input size and can block a Node.js worker/event loop for seconds with a relatively small payload (tens of KB), resulting in denial of service.

Details

The issue is in merge handling inside lib/loader.js:

  • storeMappingPair(...) iterates every element of a merge sequence when key tag is tag:yaml.org,2002:merge.
  • For each element, it calls mergeMappings(...).
  • mergeMappings(...) computes Object.keys(source) and performs _hasOwnProperty.call(destination, key) checks for each key.

When input is of the form:

a: &a {k0:0, k1:0, ..., kK:0} b: {<<: [*a, *a, *a, ... repeated M times ...]} all *a entries refer to the same anchored object. After the first merge, subsequent merges are semantically no-ops, but the parser still reprocesses all keys each time. Resulting work is O(K * M), while input size is O(K + M), giving quadratic scaling as payload grows. Relevant code path: lib/loader.js in storeMappingPair(...) merge branch (keyTag === 'tag:yaml.org,2002:merge') lib/loader.js mergeMappings(...)

Root cause

File: lib/loader.js Function: storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) Lines: ~359-366

if (keyTag === 'tag:yaml.org,2002:merge') { if (Array.isArray(valueNode)) { for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { mergeMappings(state, _result, valueNode[index], overridableKeys); } } else { mergeMappings(state, _result, valueNode, overridableKeys); } }

When the merge value is a sequence (YAML 1.1 <<: [ *a, *a, ... ]), each element is handed to mergeMappings() without deduplication. mergeMappings() then does

sourceKeys = Object.keys(source); for (index = 0; index < sourceKeys.length; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty.call(destination, key)) { setProperty(destination, key, source[key]); overridableKeys[key] = true; } }

Every alias reference in the sequence resolves (by design) to the SAME object via state.anchorMap. After the first merge, every subsequent merge of that same reference is a pure no-op semantically, but still performs:

  • one Object.keys(source) call (O(K))
  • K _hasOwnProperty.call checks on the destination

Total: M * K hasOwnProperty checks + M Object.keys allocations, while the final object and all observable side effects are identical to a single merge.

YAML semantics for <<: are idempotent and commutative over duplicate sources, so collapsing duplicates preserves behavior exactly; this isn't a spec trade-off.

PoC

Environment: js-yaml version: 4.1.1 Node.js: v24.5.0 Platform: arm64 macOS (reproduced consistently) Reproduction script: Create many keys in one anchored map (&a). Merge that same alias repeatedly via <<: [*a, *a, ...]. Measure parse time and compare with control payload using single merge (<<: *a). Observed repeated runs (same machine): K=M=1000, input 9,909 bytes: ~33-36 ms K=M=2000, input 20,909 bytes: ~121-123 ms K=M=4000, input 42,909 bytes: ~524-537 ms K=M=6000, input 64,909 bytes: ~1,608-1,829 ms K=M=8000, input 86,909 bytes: ~3,395-3,565 ms Control (single merge, similar key counts): K=2000: ~1-2 ms K=4000: ~3 ms K=8000: ~5 ms Also verified: repeated-merge output equals single-merge output (same key count and same JSON), confirming excess time is redundant computation.

Impact

This is a denial-of-service vulnerability (CPU exhaustion / algorithmic complexity). Any service parsing untrusted YAML with js-yaml can be impacted, including API backends, CI tools, config processors, and automation services. An attacker can submit crafted YAML to significantly increase CPU time and reduce availability.

Suggested fix:

Dedupe the merge source list by reference before invoking mergeMappings. Any of the following are minimal and preserve YAML 1.1 merge semantics:

dedupe in storeMappingPair:

if (keyTag === 'tag:yaml.org,2002:merge') { if (Array.isArray(valueNode)) { var seen = new Set(); for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { var src = valueNode[index]; if (seen.has(src)) continue; // idempotent; skip redundant alias seen.add(src); mergeMappings(state, _result, src, overridableKeys); } } else { mergeMappings(state, _result, valueNode, overridableKeys); } }

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 5,988 npm packages depend on js-yaml (138 direct, 5,863 indirect)

Ecosystem-wide dependent count for version 4.0.0.

Threat Intelligence Overview

EPSS Score
0.3%
Top 84% exploitable
Threat Intel
1
1 source
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

CVE-2025-68613 HIGH POC
8.8 Dec 19

Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation

CVE-2024-41713 CRITICAL POC
9.1 Oct 21

A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could

CVE-2024-55591 CRITICAL POC
9.8 Jan 14

FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote

CVE-2023-44487 HIGH POC
7.5 Oct 10

Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour

CVE-2014-7205 CRITICAL POC
10.0 Oct 08

Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t

CVE-2025-59528 CRITICAL POC
10.0 Sep 22

Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete

CVE-2017-14849 HIGH POC
7.5 Sep 28

Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc

CVE-2017-5941 CRITICAL POC
9.8 Feb 09

An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2014-3744 HIGH POC
7.5 Oct 23

Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi

CVE-2014-9566 HIGH POC
7.5 Mar 10

Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin

CVE-2024-35286 CRITICAL POC
9.8 Oct 21

A vulnerability in NuPoint Messenger (NPM) of Mitel MiCollab through 9.8.0.33 allows an unauthenticated attacker to cond

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise High Performance Computing 12 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy