Skip to content

fix(security): patch all fixable vulnerabilities across JS and Go apps - #306

Open
Nick Robinson (nickrobinson) wants to merge 5 commits into
mainfrom
claude/fervent-planck-ojnj09
Open

fix(security): patch all fixable vulnerabilities across JS and Go apps#306
Nick Robinson (nickrobinson) wants to merge 5 commits into
mainfrom
claude/fervent-planck-ojnj09

Conversation

@nickrobinson

Copy link
Copy Markdown
Contributor

Summary

Patches all automatically-fixable security vulnerabilities identified across the JavaScript and Go quickstart apps. All fixes are minor or patch version bumps; no major version upgrades were forced.


Vulnerabilities Fixed

Package Severity Advisory Fix
brace-expansion High GHSA-3jxr-9vmj-r5cp, GHSA-mh99-v99m-4gvg Override to ^5.0.8 in all JS apps
js-yaml High GHSA-h67p-54hq-rp68, GHSA-52cp-r559-cp3m Override to ^4.3.0
postcss High GHSA-r28c-9q8g-f849 Bump to 8.5.23
vite High GHSA-v6wh-96g9-6wx3, GHSA-fx2h-pf6j-xcff Bump to 6.4.3
undici High 7 CVEs (TLS bypass, header injection, DoS, cache poisoning) Bump to 7.29.0 (electron)
shell-quote Critical GHSA-w7jw-789q-3m8p, GHSA-395f-4hp3-45gv Override to ^1.9.0 (react-native, react-native-expo)
ws High GHSA-96hv-2xvq-fx4p Override to ^7.5.11 (react-native, react-native-expo)
qs Moderate GHSA-q8mj-m7cp-5q26 Bump to ^6.15.2 (react-native)
form-data High GHSA-hmw2-7cc7-3qxx (CRLF injection) Pin to 4.0.6 (react-native-expo)
body-parser, @babel/core, joi, launch-editor Low–Moderate Various Patched via npm audit fix

Go (go-tui): Bumped golang.org/x/sys → v0.47.0, golang.org/x/term → v0.45.0, fxamacker/cbor/v2 → v2.9.2.


Apps Patched

  • javascript-web — 0 vulnerabilities remaining
  • javascript-tui — 0 vulnerabilities remaining
  • electron — 0 vulnerabilities remaining
  • react-native — 0 vulnerabilities remaining
  • react-native-expo — 0 high/critical remaining (11 moderate remain — see below)
  • go-tui — patch/minor deps updated

MANUAL INTERVENTION REQUIRED

react-native-expo — 11 moderate vulnerabilities

Root cause: uuid < 11.1.1 (GHSA-w5hq-g745-h8pq) is pulled in by xcode@expo/config-pluginsexpo.

What was tried: npm audit fix and adding uuid/xcode overrides — both fail because npm resolves the fix as requiring expo@46.0.21 (a downgrade) or expo@57.x (a major version upgrade).

Required fix: Upgrade expo from ~55.0.x to ~57.0.x along with all matching expo-* packages. This is a major version bump with its own migration guide and potential breaking changes in the app.


Generated by Claude Code

JS apps (javascript-web, javascript-tui, electron, react-native, react-native-expo):
- brace-expansion: override to ^5.0.8 (GHSA-3jxr-9vmj-r5cp, GHSA-mh99-v99m-4gvg)
- js-yaml: bump to ^4.3.0 (GHSA-h67p-54hq-rp68, GHSA-52cp-r559-cp3m)
- postcss: bump to 8.5.23 (GHSA-r28c-9q8g-f849)
- vite: bump to 6.4.3 (GHSA-v6wh-96g9-6wx3, GHSA-fx2h-pf6j-xcff)
- undici: bump to 7.29.0 in electron (multiple CVEs)
- shell-quote: override to ^1.9.0 in react-native/expo (GHSA-w7jw-789q-3m8p, GHSA-395f-4hp3-45gv)
- ws: override to ^7.5.11 in react-native/expo (GHSA-96hv-2xvq-fx4p)
- qs: bump to ^6.15.2 in react-native (GHSA-q8mj-m7cp-5q26)
- form-data: pin to 4.0.6 in react-native-expo (GHSA-hmw2-7cc7-3qxx)
- body-parser, @babel/core, joi, launch-editor: patched via npm audit fix

Go app (go-tui):
- golang.org/x/sys v0.38.0 → v0.47.0
- golang.org/x/term v0.37.0 → v0.45.0
- github.com/fxamacker/cbor/v2 v2.9.0 → v2.9.2

MANUAL INTERVENTION REQUIRED (react-native-expo):
- 11 moderate vulnerabilities remain via uuid < 11.1.1 → xcode → @expo/config-plugins.
  Fix requires upgrading expo 55 → 57 (major version bump with breaking changes).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P27Qi85FyMZUdDXV5Ti7Uv
…nt compatibility

brace-expansion@5.x changed its CJS export from a bare function to an
object, which breaks minimatch@3.x (used by eslint@8-9) when it calls
`const expand = require('brace-expansion')`. The @typescript-eslint
nested brace-expansion@5.0.8 is handled correctly by npm's lockfile
resolution since @typescript-eslint requires ^5.0.2 explicitly.

Revert the global brace-expansion override to ^1.1.12 (1.x series) so
minimatch@3.x consumers remain compatible, while the @typescript-eslint
tree continues to use 5.0.8 via its own semver range.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P27Qi85FyMZUdDXV5Ti7Uv

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR patches automatically-fixable dependency vulnerabilities across the JavaScript-based quickstart apps and the Go TUI app by updating lockfiles and adding dependency overrides/resolutions to force patched transitive versions.

Changes:

  • Added/updated npm overrides and yarn resolutions to pin/override vulnerable transitive packages (e.g., brace-expansion, js-yaml, postcss, shell-quote, ws, qs, form-data).
  • Refreshed JS lockfiles (npm + yarn where applicable) to reflect patched dependency graphs and minor/patch bumps.
  • Updated go-tui module dependencies (golang.org/x/*, fxamacker/cbor) and corresponding go.sum.

Reviewed changes

Copilot reviewed 6 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
react-native/yarn.lock Updated yarn-locked transitive dependencies to patched versions.
react-native/package.json Added/updated overrides/resolutions to force patched transitive packages.
react-native/package-lock.json Updated npm lockfile to reflect patched dependency graph.
react-native-expo/package.json Added/updated resolutions/overrides for patched transitive packages (and postcss bump).
react-native-expo/package-lock.json Updated npm lockfile to reflect patched dependency graph and Expo-related dependency bumps.
javascript-web/package.json Added brace-expansion override.
javascript-web/package-lock.json Updated locked transitive deps (e.g., postcss, vite, js-yaml, brace-expansion).
javascript-tui/package.json Added brace-expansion override.
javascript-tui/package-lock.json Updated locked transitive deps (notably Babel ecosystem + js-yaml/brace-expansion).
go-tui/go.mod Updated Go dependencies (and Go toolchain directive).
go-tui/go.sum Added checksums for updated Go module versions.
electron/package.json Added brace-expansion override.
electron/package-lock.json Updated locked transitive deps to patched versions.
Files not reviewed (5)
  • electron/package-lock.json: Generated file
  • javascript-tui/package-lock.json: Generated file
  • javascript-web/package-lock.json: Generated file
  • react-native-expo/package-lock.json: Generated file
  • react-native/package-lock.json: Generated file
Comments suppressed due to low confidence (1)

react-native-expo/package.json:94

  • ws is forced to the 7.x line, but the lockfile shows multiple dependencies in this app requiring ws ^8.x (e.g. expo’s CLI and jsdom). Forcing a different major version can break those consumers; prefer overriding to a patched 8.x version instead (or remove the override if the resolved 8.x is already patched), then regenerate the lockfile.
    "ws": "^7.5.11",

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread react-native-expo/package.json Outdated
"brace-expansion": "^5.0.8",
"js-yaml": "^4.3.0",
"shell-quote": "^1.9.0",
"ws": "^7.5.11",
Comment thread go-tui/go.mod Outdated
The Go dependency updates had no associated CVEs and were not required
for security patching. Rolling back to avoid unnecessarily raising the
minimum Go toolchain version (go.mod go directive).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P27Qi85FyMZUdDXV5Ti7Uv

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @Copilot. Addressed both items:

ws override in react-native-expo: Checked the actual lockfile resolution — jsdom keeps its own nested ws@8.21.0 (unaffected by the override), while the top-level ws resolves to 7.5.13. The ws vulnerability range is 6.0.0–6.2.3 || 7.0.0–7.5.10; 8.x is not in scope. The ^7.5.11 override is there to ensure the 7.x consumers in this tree land on a safe version. No change needed.

go directive bump: Valid point — golang.org/x/sys, golang.org/x/term, and cbor/v2 had no associated CVEs and didn't need to be updated. Reverted go-tui/go.mod and go-tui/go.sum to the original go 1.24.0 and original dependency versions (commit d87b04b).


Generated by Claude Code

macOS runners no longer include Xcode 16.4; all available versions are
26.x. Update to 26.3, matching the version already used by
react-native-expo-ci.yml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P27Qi85FyMZUdDXV5Ti7Uv

Copy link
Copy Markdown
Contributor Author

CI status update

All Lint checks are now green. ✅

Build iOS was failing with:

##[error]Could not find Xcode version that satisfied version spec: '16.4'
Available versions: 26.6.0, 26.5.0, 26.4.1, 26.3.0, 26.2.0, 26.1.1, 26.0.1

This is a pre-existing infrastructure issue — the macOS runners no longer carry Xcode 16.x. The react-native-expo-ci.yml workflow already uses xcode-version: "26.3". I've updated react-native-ci.yml to match (commit 5c3e542).


Generated by Claude Code

ws@7.x does not export WebSocketServer in the way @expo/cli expects,
causing "TypeError: _ws(...).WebSocketServer is not a constructor" in
both the Android and iOS builds. The CVE (GHSA-3h5q-q39x-f9x3) is
fixed in ws@8.17.1+; use 8.x to match what @expo/cli requires.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P27Qi85FyMZUdDXV5Ti7Uv
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