fix: resolve all npm audit vulnerabilities#2249
Conversation
Upgrade dependencies and add npm overrides to fix 12 security vulnerabilities: - @azure/arm-resourcegraph: v4.2.1 → v5.0.0-beta.5 - containerization-assist-mcp: v1.4.0 → v1.4.1 - js-yaml: v4.2.0 → v5.0.0 - Override transitive deps: diff ^9.0.0, serialize-javascript ^7.0.6 Fixes vulnerabilities in uuid, js-yaml, diff, and serialize-javascript. Result: 0 vulnerabilities found by npm audit. Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate npm audit findings by upgrading several direct dependencies, adding npm overrides to force patched transitive versions, and introducing an allowScripts allowlist for install-script transparency.
Changes:
- Upgrade direct dependencies (notably
@azure/arm-resourcegraph,containerization-assist-mcp,js-yaml) and refresh root lockfile accordingly. - Add npm
overridesto force patched transitive versions (e.g.,diff,serialize-javascript,js-yamlunderdockerfilelint). - Add
allowScriptsentries in both the root andwebview-uipackages; normalize the webview lockfile metadata.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| package.json | Adds overrides and allowScripts; upgrades direct dependencies. |
| package-lock.json | Large lockfile refresh reflecting dependency and override changes. |
| webview-ui/package.json | Adds allowScripts to whitelist fsevents install script. |
| webview-ui/package-lock.json | Lockfile normalization (e.g., dev flags / empty requires cleanup). |
Files not reviewed (1)
- webview-ui/package-lock.json: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Downgrade js-yaml from ^5.0.0 to ^4.2.0 to fix ESM/CommonJS incompatibility (js-yaml@5 is ESM-only but project compiles to CommonJS) - Update mocha overrides to use minimum patched versions: * diff: ^9.0.0 → ^8.0.3 * serialize-javascript: ^7.0.6 → ^7.0.5 - Remove fsevents@2.1.3 from allowScripts (not in dependency graph) Security fixes still maintained with 0 vulnerabilities. Addresses: Azure#2249 (comment)
✅ Addressed All Copilot Review CommentsThank you @copilot for the thorough review! I've addressed all 4 comments in commit 93a68f0: 1.
|
Summary
This PR addresses and fixes 12 security vulnerabilities (2 low, 7 moderate, 3 high severity) identified by
npm audit. After these changes, the repository now has 0 vulnerabilities.Gentle ping to @tejhan and @bosesuneha for testing the graph api use as its a major update please ❤️ 🙏
🎯 Changes
Dependency Upgrades
@azure/arm-resourcegraph:
^4.2.1→^5.0.0-beta.5@azure/ms-rest-jsdependency chaincontainerization-assist-mcp:
^1.4.0→^1.4.1js-yaml:
^4.2.0→^5.0.0npm Overrides
Added
overridessection to force transitive dependencies to use secure versions:Fixes:
Configuration
Added
allowScriptsconfiguration to explicitly allow approved install scripts for security transparency.✅ Verification
npm auditreports 0 vulnerabilities📊 Impact
Before: 12 vulnerabilities (2 low, 7 moderate, 3 high)
After: 0 vulnerabilities
🧪 Testing
All commands complete successfully with no security warnings.
Related: Addresses Dependabot/npm audit security alerts