Skip to content

Update js-yaml and shell-quote in committed RN harness lockfiles - #1089

Merged
Chris Anderson (codemonkeychris) merged 1 commit into
microsoft:mainfrom
pranav-gupta-msft:user/pragupta/sfi-fixes-v0.001
Aug 13, 2026
Merged

Chris Anderson (codemonkeychris) merged 1 commit into
microsoft:mainfrom
pranav-gupta-msft:user/pragupta/sfi-fixes-v0.001

Conversation

@pranav-gupta-msft

Copy link
Copy Markdown
Member

The React Native harnesses under tests/ carry committed package-lock.json files, so an upstream advisory fix never reaches us until the lockfile is updated.

Note that js-yaml 3.15.0 and 4.3.0 are NOT sufficient. Those releases fix CVE-2026-59869 (merge-key chains forcing quadratic CPU), but the follow-up CVE-2026-59870 / GHSA-5p4m-2wfm-xmqj (quadratic CPU in !!omap resolution) was not included in them; both the 3.x and 4.x lines remained vulnerable. The first patched releases are 3.15.1 and 4.3.1.

js-yaml 3.14.2, 3.15.0 -> 3.15.1
js-yaml 4.1.1, 4.3.0 -> 4.3.1
shell-quote 1.8.4 -> 1.10.0 GHSA-395f-4hp3-45gv

Affected: tests/startup_perf/BlankRNW, tests/stress_perf_rn/StocksGrid, tests/stress_perf_rn/VirtualList. VirtualList already carried shell-quote 1.10.0 and is left untouched.

None of these are direct dependencies, and every declaring range already permitted the patched version (js-yaml ^4.1.0 and ^3.13.1, shell-quote ^1.8.4, ^1.8.3 and ^1.6.1) - only the lockfile held the vulnerable versions, so package.json needs no change.

Edited surgically rather than regenerated. A previous attempt with npm audit fix rewrote ~70 unrelated entries and, because it resolved through a proxy registry that strips dist.integrity, silently downgraded those entries from sha512 to sha1. This change touches only the eight affected entries (version, resolved, integrity), leaving every other line byte-identical: 24 changed lines total.

Both the dependency and bin sets are unchanged across all three bumps (js-yaml 3.x: argparse ^1.0.7 + esprima ^4.0.0; js-yaml 4.x: argparse ^2.0.1; shell-quote: none), so no other lockfile entries are affected. All integrity values are sha512, computed by hashing the published tarballs; the method was validated against the shell-quote 1.10.0 integrity already present in this repo, which it reproduces exactly. All resolved URLs remain on registry.npmjs.org.

Verified: npm ci succeeds in all three projects and leaves the lockfiles unmodified, which also confirms every integrity value validates against the real tarball; the patched versions are the ones installed on disk; npm audit no longer reports js-yaml or shell-quote in any of the three (it still reports unrelated advisories, so the check is not vacuous); and all three packages load and parse correctly, including the !!omap path covered by the newer advisory.

Summary

Linked issue / spec

Test plan

Risk / breaking changes

The React Native harnesses under tests/ carry committed package-lock.json
files, so an upstream advisory fix never reaches us until the lockfile is
updated.

Note that js-yaml 3.15.0 and 4.3.0 are NOT sufficient. Those releases fix
CVE-2026-59869 (merge-key chains forcing quadratic CPU), but the follow-up
CVE-2026-59870 / GHSA-5p4m-2wfm-xmqj (quadratic CPU in !!omap resolution)
was not included in them; both the 3.x and 4.x lines remained vulnerable.
The first patched releases are 3.15.1 and 4.3.1.

  js-yaml      3.14.2, 3.15.0 -> 3.15.1
  js-yaml      4.1.1,  4.3.0  -> 4.3.1
  shell-quote  1.8.4          -> 1.10.0   GHSA-395f-4hp3-45gv

Affected: tests/startup_perf/BlankRNW, tests/stress_perf_rn/StocksGrid,
tests/stress_perf_rn/VirtualList. VirtualList already carried shell-quote
1.10.0 and is left untouched.

None of these are direct dependencies, and every declaring range already
permitted the patched version (js-yaml ^4.1.0 and ^3.13.1, shell-quote
^1.8.4, ^1.8.3 and ^1.6.1) - only the lockfile held the vulnerable
versions, so package.json needs no change.

Edited surgically rather than regenerated. A previous attempt with
`npm audit fix` rewrote ~70 unrelated entries and, because it resolved
through a proxy registry that strips dist.integrity, silently downgraded
those entries from sha512 to sha1. This change touches only the eight
affected entries (version, resolved, integrity), leaving every other line
byte-identical: 24 changed lines total.

Both the dependency and bin sets are unchanged across all three bumps
(js-yaml 3.x: argparse ^1.0.7 + esprima ^4.0.0; js-yaml 4.x: argparse
^2.0.1; shell-quote: none), so no other lockfile entries are affected.
All integrity values are sha512, computed by hashing the published
tarballs; the method was validated against the shell-quote 1.10.0
integrity already present in this repo, which it reproduces exactly. All
resolved URLs remain on registry.npmjs.org.

Verified: `npm ci` succeeds in all three projects and leaves the lockfiles
unmodified, which also confirms every integrity value validates against
the real tarball; the patched versions are the ones installed on disk;
`npm audit` no longer reports js-yaml or shell-quote in any of the three
(it still reports unrelated advisories, so the check is not vacuous); and
all three packages load and parse correctly, including the !!omap path
covered by the newer advisory.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, i'll merge

@codemonkeychris
Chris Anderson (codemonkeychris) merged commit 22b8650 into microsoft:main Aug 13, 2026
18 checks passed
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Sep 1, 2026
…1169)

* Clear the fixable Component Governance alerts in the RN harness lockfiles

The React Native comparison harnesses under tests/ carry committed
package-lock.json files, so an upstream advisory fix never reaches us
until the lockfile is updated. 11 of the 17 open alerts are fixable by
version bump; this does all 11.

  brace-expansion   1.1.14 -> 1.1.18  GHSA-3jxr-9vmj-r5cp, GHSA-mh99-v99m-4gvg,
                                      GHSA-rgw5-rvv9-x895  (6 nested copies each
                                      in StocksGrid and VirtualList)
  brace-expansion   5.0.6  -> 5.0.9   GHSA-3jxr-9vmj-r5cp
  launch-editor     2.13.2 -> 2.14.1  GHSA-v6wh-96g9-6wx3
  @babel/plugin-transform-modules-systemjs
                    7.29.0 -> 7.29.4  GHSA-fv7c-fp4j-7gwp
  @babel/core       7.29.0 -> 7.29.6  GHSA-4x5r-pxfx-6jf8

@babel/core 7.29.6 requires generator ^7.29.6, which requires parser and
types ^7.29.7, which require the two 7.29.7 helpers; BlankRNW therefore
also moves generator 7.29.1 -> 7.29.7, parser 7.29.3 -> 7.29.7, types
7.29.0 -> 7.29.7, helper-string-parser 7.27.1 -> 7.29.7 and
helper-validator-identifier 7.28.5 -> 7.29.7. The chain terminates there
(both helpers have no dependencies). Every declaring range on the chain
is a caret range, so all are satisfied.

None of these are direct dependencies, and every declaring range already
permitted the patched version (brace-expansion ^1.1.7 and ^5.0.5,
launch-editor ^2.9.1, systemjs plugin ^7.29.0, @babel/core ^7.25.2) -
only the lockfile held the vulnerable versions, so no package.json changes.

The remaining 6 alerts are image-size (GHSA-w3rx-r6r6-pgpr,
GHSA-5p2g-fcmc-qvqq), which have no fix available: both cover <= 2.0.2 and
2.0.2 is the latest published release. It arrives via metro's ^1.0.2, which
would not take a 2.x fix anyway. Not reachable here - metro reads image
dimensions at bundle time from first-party assets, the vulnerable parsers
are ICNS/JXL/HEIF, and the only images in all three harnesses are MSIX
package PNGs consumed by the Windows packaging pipeline, not metro; no JS
source imports an image at all. These need a risk-accepted dismissal in the
CG portal rather than a code change.

Edited surgically rather than regenerated, per the precedent in #1089:
resolving through the proxy registry strips dist.integrity and silently
downgrades entries from sha512 to sha1. Only version, resolved and
integrity are touched, plus the four metadata fields that genuinely changed
upstream (brace-expansion 5.0.9 engines "18 || 20 || >=22" -> "20 || >=22",
launch-editor shell-quote ^1.8.3 -> ^1.8.4, and the @babel/core and
generator/parser/types dependency ranges). 77 changed lines total, and a
filter over the diff confirms every one of the 154 changed lines is an
intended field - verified non-vacuous by feeding it license/dev/funding
lines, which it flags.

Verified: all 10 introduced integrity values were confirmed by downloading
the published tarballs and recomputing sha512, with the method first
validated by reproducing four pre-existing untouched integrity values
(balanced-match, concat-map, picocolors, jsesc) exactly - so the proxy is
not rewriting tarball bytes - and a negative control confirming the checker
detects a corrupted hash. `npm ci` then succeeds in all three harnesses
(789/860/860 packages, exit 0) and leaves the lockfiles unmodified, which
independently confirms every integrity value validates and every range is
satisfiable. No vulnerable version remains in any resulting tree; that scan
is non-vacuous - run against the pre-change tree the same checker flags
@babel/core 7.29.0.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Drop image-size by taking metro 0.83.8 in the RN harness lockfiles

Clears the remaining 6 Component Governance alerts - image-size
GHSA-w3rx-r6r6-pgpr / CVE-2025-71330 (ICNS parser infinite loop) and
GHSA-5p2g-fcmc-qvqq / CVE-2025-71329 (JXL and HEIF parser infinite loops),
one pair per harness.

There is no fixed image-size to upgrade to: both advisories cover <= 2.0.2,
2.0.2 is the latest release, and image-size/image-size was archived on
2026-06-03 with issues and pull requests disabled - which is why both
advisories can only cite PR 439 through a web.archive.org snapshot.

The fix came from the consumer side instead. metro vendored its own image
dimension parsing (react/metro#1860, cherry-picked as #1870 and #1871) and
released it in 0.83.8 and 0.84.5, dropping the image-size dependency
outright. These harnesses were pinned at metro 0.83.7. Tracking issues
upstream are react/metro#1607 and #1762.

metro-config and metro-transform-worker pin `metro` to an exact version, so
the whole family moves in lockstep: 15 entries per lockfile (the 14 metro-*
packages plus ob1) go 0.83.7 -> 0.83.8. Removing image-size also orphans
`queue`, its only dependant, so that entry goes too - 17 entries changed per
lockfile, 173 lines. No package.json changes: @react-native/community-cli-plugin
already declares metro ^0.83.1, which admits 0.83.8.

Note this is not fixed on metro 0.85+ - 0.85.0, 0.86.0 and 0.87.0 all still
declare image-size ^1.0.2, so a future React Native upgrade will reintroduce
it until that is forward-ported upstream.

Applied surgically, for a sharper reason than last time. npm's own resolution
was used as the source of truth for versions and dependency ranges (run in a
scratch directory with an `overrides` pin), but this environment's proxy
registry rewrites both fields that identify the artifact: `resolved` becomes an
ms-feed-N.pkgs.visualstudio.com URL and `integrity` is downgraded to sha1. A
fresh resolve here corrupts 791 of 791 entries that way, so its output cannot
be committed. Only entries whose version actually changed were taken; the
~20 entries where the proxy rewrote resolved/integrity while the version stood
still are noise and were excluded, as was a spurious typescript
devOptional -> dev flip. `resolved` was rewritten back to registry.npmjs.org
and `integrity` recomputed as sha512 from the real tarball bytes.

Verified: 0 non-sha512 integrity values and 0 non-registry.npmjs.org resolved
URLs remain in any of the three lockfiles. `npm ci` succeeds in all three
(787/858/858 packages, exit 0) and leaves the lockfiles unmodified, which
confirms every recomputed integrity validates against the real tarball and
every range is satisfiable; each tree installs exactly 2 packages fewer than
before, matching image-size and queue. metro on disk is 0.83.8 and image-size
is absent. Sweeping the installed trees for every package named in all 17
original alerts finds 30 copies and 0 vulnerable - and that sweep is not
vacuous: run against the pre-change tree the same check flags image-size 1.2.1.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

3 participants