Skip to content

chore(deps): update dependency js-yaml to v5.2.2 [security]#3350

Merged
renovate[bot] merged 1 commit into
masterfrom
renovate/npm-js-yaml-vulnerability
Jul 24, 2026
Merged

chore(deps): update dependency js-yaml to v5.2.2 [security]#3350
renovate[bot] merged 1 commit into
masterfrom
renovate/npm-js-yaml-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change OpenSSF
js-yaml devDependencies patch 5.2.15.2.2 OpenSSF Scorecard

js-yaml: Exponential parsing time in flow collections leads to denial of service

GHSA-pm4m-ph32-ghv5

More information

Details

Summary

Parsing a small YAML document can take exponential time. An application that calls load() or loadAll() on untrusted input can be hung by a payload under 200 bytes.

Details

When an entry in a flow sequence turns out to be a key: value pair, the parser rewinds and parses that entry a second time as the key.
If the key is itself a nested flow sequence of the same shape, every level is parsed twice, so the total work is O(2^n) in the nesting depth. The default maxDepth of 100 does not help, because the time is already unmanageable at about 30 to 40 levels.

Root cause, potentially the: readFlowCollection in parser.ts, the restoreState followed by a second parseNode further down.

PoC
const yaml = require('js-yaml')
const n = 30
yaml.load('[ '.repeat(n) + '1' + ' ]: 0'.repeat(n))

With default options: 22 levels takes about 1 second, 26 levels about 17 seconds, 30 levels over 2 minutes. The input stays under 200 bytes and grows linearly with n.

Impact

Denial of service. A single small request can keep one CPU busy for minutes or longer and blocks the Node event loop, so one request can stall the whole process. No anchors, aliases, merges, tags, or non default options are required, and it reproduces on the default schema.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Release Notes

nodeca/js-yaml (js-yaml)

v5.2.2

Compare Source

Fixed
  • Quote flow scalars where a colon precedes a flow indicator, #​773.
Security
  • Avoid exponential parsing time for nested flow sequence pairs.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot enabled auto-merge July 24, 2026 21:07
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedjs-yaml@​5.2.1 ⏵ 5.2.2100100 +169992100

View full report

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.83%. Comparing base (711c06e) to head (65af591).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3350   +/-   ##
=======================================
  Coverage   95.83%   95.83%           
=======================================
  Files          13       13           
  Lines          48       48           
=======================================
  Hits           46       46           
  Misses          2        2           
Flag Coverage Δ
unit 95.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@renovate
renovate Bot merged commit 5e3fe8c into master Jul 24, 2026
14 checks passed
@renovate
renovate Bot deleted the renovate/npm-js-yaml-vulnerability branch July 24, 2026 21:08
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 15.1.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released This issue or pull-request was included in a version released by semantic-release label Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released This issue or pull-request was included in a version released by semantic-release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants