-
Notifications
You must be signed in to change notification settings - Fork 16
fix(deps): resolve shell-quote and other npm audit vulnerabilities (MSDK-4134) #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -60,6 +60,9 @@ | |||||||||||||
| "react-test-renderer": "19.1.0", | ||||||||||||||
| "typescript": "~5.3.0" | ||||||||||||||
| }, | ||||||||||||||
| "overrides": { | ||||||||||||||
| "shell-quote": ">=1.9.0" | ||||||||||||||
| }, | ||||||||||||||
|
Comment on lines
+63
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [REFACTORING] Prefer pinning the override to the specific patched version you validated (for example "shell-quote": "1.10.0") instead of a loose range (">=1.9.0"). Pinning yields more deterministic installs and avoids accidental upgrades to a future version that may introduce regressions. If you intentionally want a range, document the reason in the PR message. {
"overrides": {
"shell-quote": "1.10.0"
}
}
Comment on lines
+63
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== package files =="
git ls-files | grep -E '(^|/)(package\.json|package-lock\.json|pnpm-lock\.yaml|yarn\.lock|bun\.lockb|bun\.lock)$' || true
echo
echo "== sample/package.json relevant lines =="
if [ -f sample/package.json ]; then
nl -ba sample/package.json | sed -n '1,120p'
else
echo "sample/package.json not found"
fi
echo
echo "== shell-quote references in lock/package files =="
if [ -f sample/package-lock.json ]; then
echo "--- package-lock mentions ---"
rg -n '"shell-quote"|1\.10\.0|1\.9\.0' sample/package-lock.json || true
fi
rg -n '"shell-quote"|1\.10\.0|1\.9\.0' package.json sample/package.json package-lock.json sample/package-lock.json 2>/dev/null || true
echo
echo "== changed files summary =="
git diff --stat HEAD~1..HEAD 2>/dev/null || git diff --stat origin/main..HEAD 2>/dev/null || git diff --stat 2>/dev/null | head -50Repository: Usercentrics/react-native-sdk Length of output: 346 🌐 Web query:
💡 Result: In npm, the overrides field in package.json supports the use of standard semver ranges, including caret (^) and tilde ( Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== sample/package.json relevant lines =="
awk 'NR>=1 && NR<=120 {printf "%6d %s\n", NR, $0}' sample/package.json
echo
echo "== package-lock shell-quote locations =="
rg -n '"shell-quote"|shell-quote|1\.10\.0|1\.9\.0' package-lock.json sample/package-lock.json | sed -n '1,120p'Repository: Usercentrics/react-native-sdk Length of output: 4056 Bound the override to the locked minor version.
Proposed fix "overrides": {
- "shell-quote": ">=1.9.0"
+ "shell-quote": "^1.10.0"
},📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||||||||||
| "engines": { | ||||||||||||||
| "node": ">=20.19.4" | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[CRITICAL_BUG] The npm "overrides" entry will be ignored if CI or contributors use an npm version that doesn't support overrides (or if Yarn/pnpm is used). If overrides are ignored the vulnerable shell-quote version remains in installs. Ensure the sample/ package-lock.json is regenerated with your package manager (e.g. run npm install/npm ci with an npm that supports overrides) and committed to the PR, and confirm with a reproducible check (e.g.
npm ls shell-quoteshowing 1.10.0). Also verify CI runs using an npm version that supports overrides so the vulnerability is actually fixed in CI and downstream consumers.