REDHAT-BUG-2491401: Medium severity npm/js-yaml vulnerability

Published Jun 22, 2026
·
Updated

js-yaml is a JavaScript YAML parser and dumper. Prior to 4.2.0, 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. The issue is in merge handling inside lib/loader.js. This vulnerability is fixed in 4.2.0.

Affected Software

1 affected component
npm/js-yaml<4.2.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/js-yaml to a version that resolves this vulnerability.

    Fixed in 4.2.0

Event History

Jun 22, 2026
Data Sourced
via Red Hat·04:01 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Which installations are affected?

Installations using js-yaml versions prior to 4.2.0 are affected. Version 4.2.0 contains the fix.

2

What does an attacker need to supply?

An attacker needs to cause the application to parse a crafted YAML document containing repeated instances of the same alias in a merge-key sequence (<<).

3

How can I determine whether I am exposed?

Check the version of npm/js-yaml used by the application. If it is earlier than 4.2.0 and the application parses attacker-controlled YAML, it is affected.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203