Skip to content

Security Advisory: js-yaml Prototype Pollution (CVE) used via @changesets/* Dependencies #1762

Closed

Description

@PhilMcVay

Hi maintainers 👋

Summary

A recently-flagged security advisory affects the js-yaml dependency used transitively within several @changesets/* packages. All js-yaml versions below 4.1.0 are affected:

Prototype pollution in merge

The dependency chain (via @changesets/[email protected]) looks like this:

@changesets/[email protected]
  |-- @changesets/[email protected]
      |-- @changesets/[email protected]
          |-- [email protected]
  |-- @manypkg/[email protected]
      |-- [email protected]
          |-- [email protected] (deduped)

Attempted Mitigation

I've attempted to override js-yaml in our project to the patched version (4.1.1):

"overrides": {
  "js-yaml": "4.1.1"
},

…but this results in runtime failures when executing changeset version:

Error Output
npx changeset version

🦋  error Error: could not parse changeset - invalid frontmatter: ---

🦋  error     at Object.parseChangesetFile [as default] (.../node_modules/@changesets/parse/dist/changesets-parse.cjs.js:35:11)
🦋  error     at .../node_modules/@changesets/read/dist/changesets-read.cjs.js:148:71
🦋  error     at async Promise.all (index 0)
🦋  error     at async Object.getChangesets [as default] (.../node_modules/@changesets/read/dist/changesets-read.cjs.js:152:48)
🦋  error     at async version (.../node_modules/@changesets/cli/dist/changesets-cli.cjs.js:1155:34)
🦋  error     at async run (.../node_modules/@changesets/cli/dist/changesets-cli.cjs.js:1339:11)

It appears that @changesets/parse depends on YAML parsing behaviour that changed in [email protected], making the override incompatible.

Environment

  • @changesets/cli: 2.29.7
  • Node.js: 22.19.0

Request

Would it be possible to update the relevant @changesets/* packages to use js-yaml@^4.1.1, or otherwise confirm whether upgrading is feasible?

Given this is a security advisory (prototype pollution in merge), having a path to a secure version would be very helpful for downstream consumers.

Thanks for maintaining this project 😄

Activity

  1. bluwy commented on Nov 15, 2025

    @bluwy
    Member

    Makes sense to look into upgrading it. I also wonder if it's worth implementing a simple parser ourselves since we really only need to parse "<pkg-name>": "patch|minor|major".

  2. marcalexiei commented on Nov 15, 2025

    @marcalexiei
    Contributor

    I have opened a PR with a simple implementation that should mirror current behaviour and remove js-yaml dependency.

    If you want to solve the security issue you can update to [email protected].
    Basically 4.1.1 fix has been back ported, but the security advisory is still not updated.

    References:

  3. added a commit that references this issue on Nov 16, 2025
  4. added a commit that references this issue on Nov 16, 2025
  5. added a commit that references this issue on Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions