fix: bump preferred-pm to v5 to resolve js-yaml prototype pollution#756
Merged
rexxars merged 2 commits intosanity-io:mainfrom Mar 23, 2026
Merged
Conversation
…ulnerability preferred-pm v4 depends on which-pm@3 → load-yaml-file@0.2 → js-yaml@3.x which is vulnerable to prototype pollution (GHSA-mh29-5h37-fv8m). preferred-pm v5 → which-pm@4 → load-yaml-file@1.0 → js-yaml@4.x (safe). The only breaking change in preferred-pm v5 is the switch from default to named export, which is updated in packageManagerChoice.ts.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps
preferred-pmfrom^4.1.1to^5.0.0in@sanity/clito resolve the js-yaml prototype pollution vulnerability (moderate severity).Dependency chain fix:
preferred-pm@4→which-pm@3→load-yaml-file@0.2→js-yaml@3.x(vulnerable)preferred-pm@5→which-pm@4→load-yaml-file@1.0→js-yaml@4.x(safe)Code change: The only breaking change in
preferred-pm@5is switching from a default export to a named export. Updated the import inpackageManagerChoice.tsaccordingly:The function signature is identical —
(pkgPath: string) => Promise<{name: 'npm' | 'pnpm' | 'yarn' | 'bun', version: string} | null>.Related: sanity-io/sanity#11151
Test plan
pnpm build:clipassespnpm check:typespasses