fix(MSDK-3374): resolve npm dependency vulnerabilities #202
Conversation
…ackage.json - Upgrade @react-native-community/cli to ^20.1.3 (was ^18.0.0, had CISA known exploit) - Upgrade cli-platform-android and cli-platform-ios to ^20.1.3 - Remove deprecated metro-react-native-babel-preset (@react-native/babel-preset already present) - Remove @types/react-native (types now bundled in react-native itself) - Add npm overrides for transitive vulnerable deps: fast-xml-parser >=4.5.4, braces >=3.0.3, micromatch >=4.0.8, flatted >=3.4.2, lodash >=4.18.1, picomatch >=4.0.4, yaml >=2.8.3 (minimatch resolved via CLI v20 upgrade) - npm audit: 0 vulnerabilities | 32 tests passing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Review Summary by QodoResolve npm dependency vulnerabilities and security exploits
WalkthroughsDescription• Upgrade @react-native-community/cli to ^20.1.3 (CISA known exploit fix) • Upgrade cli-platform-android and cli-platform-ios to ^20.1.3 • Remove deprecated metro-react-native-babel-preset and @types/react-native • Add npm overrides for seven transitive vulnerable dependencies • Achieves zero npm audit vulnerabilities with all tests passing Diagramflowchart LR
A["package.json"] -->|"Upgrade CLI versions"| B["@react-native-community/cli ^20.1.3"]
A -->|"Remove deprecated"| C["metro-react-native-babel-preset"]
A -->|"Remove bundled types"| D["@types/react-native"]
A -->|"Add overrides"| E["7 transitive deps"]
B --> F["Zero vulnerabilities"]
E --> F
File Changes1. package.json
|
Code Review by Qodo
|
📝 WalkthroughWalkthroughUpdated React Native CLI tooling from version 18.0.0 to 20.1.3 across all platform packages. Removed two development-time dependencies and added an overrides block to enforce minimum versions for seven transitive dependencies. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
PR Summary: Update dev/devtooling dependencies to remediate npm vulnerabilities and add overrides to pin safe transitive dependency versions.
|
|
Reviewed up to commit:f2eb6ce4f08bfe4b50744e893db39bdc117f4726 Additional Suggestionpackage.json, line:55You removed @types/react-native from devDependencies. Modern react-native ships types, but ensure TypeScript compile/tests still work without that package (tsconfig, typeRoots, and any code referencing older @types APIs). Run `yarn/npm run compile` and jest to confirm no missing type errors and re-add the types package only if required.package.json, line:60metro-react-native-babel-preset was removed. Confirm that your Babel and Metro configuration rely on @react-native/babel-preset (already present) and that metro config does not explicitly require the removed preset. Run Metro dev server and verify transforms for both iOS and Android to avoid runtime JS transform regressions. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Around line 66-74: The overrides block currently uses open-ended ranges like
"fast-xml-parser": ">=4.5.4" which permit major upgrades; update each entry in
the overrides object (fast-xml-parser, braces, micromatch, flatted, lodash,
picomatch, yaml) to use bounded caret ranges (e.g. "^4.5.4") so you lock to
compatible major versions while allowing minor/patch updates; keep the same
version numbers but replace the ">=" prefix with "^" for all listed packages in
the overrides object.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bcb62a95-1528-47db-98e1-d8101a52249f
⛔ Files ignored due to path filters (2)
package-lock.jsonis excluded by!**/package-lock.jsonsample/Gemfile.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
package.json
|
CodeAnt AI finished reviewing your PR. |
User description
…ackage.json
Summary by CodeRabbit
Chores
CodeAnt-AI Description
Update project dependencies to remove known security vulnerabilities
What Changed
Impact
✅ Fewer dependency vulnerability alerts✅ Safer installs for the app build setup✅ Reduced risk from vulnerable transitive packages🔄 Retrigger CodeAnt AI Review
Details
💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.