Skip to content

[Snyk] Security upgrade js-yaml from 4.1.1 to 5.2.2 - #13033

Open
sestinj wants to merge 1 commit into
mainfrom
snyk-fix-80058a2b6f2726401b5d27664e5d9047
Open

[Snyk] Security upgrade js-yaml from 4.1.1 to 5.2.2#13033
sestinj wants to merge 1 commit into
mainfrom
snyk-fix-80058a2b6f2726401b5d27664e5d9047

Conversation

@sestinj

@sestinj sestinj commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

snyk-top-banner

Snyk has created this PR to fix 1 vulnerabilities in the npm dependencies of this project.

Snyk changed the following file(s):

  • extensions/cli/package.json

Vulnerabilities that will be fixed with an upgrade:

Issue Score
high severity Inefficient Algorithmic Complexity
SNYK-JS-JSYAML-18313070
  828  

Breaking Change Risk

Merge Risk: High

Notice: This assessment is enhanced by AI.


Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic


Learn how to fix vulnerabilities with free interactive lessons:

🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.

@sestinj
sestinj requested a review from a team as a code owner July 27, 2026 09:08
@sestinj

sestinj commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Merge Risk: High

The upgrade of js-yaml from v4 to v5 is a major version jump with significant breaking changes that require code modifications. The library has been fundamentally reworked for safety and modern JavaScript standards.

Key Breaking Changes:

  • Safe by Default: The primary breaking change is that the main load() function is now safe by default, and the unsafe safeLoad() function has been removed. This is a critical security improvement, as the previous load() could lead to arbitrary code execution. All calls to safeLoad() must be replaced with load().

  • ESM Named Exports: The package no longer uses a default export. Code must be updated to use named imports.

    • Before (v4): const yaml = require('js-yaml'); yaml.safeLoad(doc);
    • After (v5): const { load } = require('js-yaml'); load(doc); or import { load } from 'js-yaml';
  • Default Schema Change: The default schema has changed from a YAML 1.1-based schema to the more modern and secure YAML 1.2 CORE_SCHEMA. This means some features like merge keys (<<) are no longer supported by default and must be explicitly enabled if needed.

  • API and Behavior Changes:

    • Loading an empty string (load('')) now throws an error instead of returning undefined.
    • The API for creating custom types has been completely replaced.
    • Unsafe tags like !!js/function and !!js/regexp have been removed from the core library.

Source: Migration Guide, Changelog

Recommendation: This upgrade requires careful code review and modification. Developers must update import statements, replace safeLoad with load, and verify that their YAML documents are compatible with the new default schema. Due to the fundamental nature of these changes, thorough testing is essential.

Notice 🤖: This content was augmented using artificial intelligence. AI-generated content may contain errors and should be reviewed for accuracy before use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants