[安全] 更新 svgo 依赖项,以修复 @svgr/plugin-svgo 中的 nth-check 漏洞 (CVE-2021-3803)
To Reproduce Steps to reproduce the behavior: 1. Create a new Create React App project: npx create-react-app test-svgr-vulnerability 2. cd test-svgr-vulnerability 3. Run npm ls nth-check to see the vulnerable dependency 4. Run npm audit to see the security vulnerability 5. Check BlackDuck, Snyk, or other security scanning tools - they will flag this vulnerability Current Dependency Chain: [email protected] ├── @svgr/[email protected] ├── @svgr/[email protected] ├── [email protected] (outdated - released 2019) ├── [email protected] ├── [email protected] (VULNERABLE ❌) Expected behavior The @svgr/plugin-svgo package should use a modern version of svgo (v2.x or v3.x) that depends on [email protected] or [email protected], which in turn depends on the fixed [email protected] versions. Proposed Fix Update packages/plugin-svgo/package.json: { "dependencies": { "svgo": "^2.0.0" // or "^3.0.0" } } Expected Fixed Chain: @svgr/[email protected] ├── [email protected] (or 3.x.x) ├── [email protected] (or 5.x.x) ├── [email protected]+ (SECURE ✅)
内容来源: gregberge/svgr