feat: Add comprehensive vulnerability tracking and remediation tools
Create detailed vulnerability management system with tracking,
remediation plans, and manual update scripts.
New Files:
----------
1. VULNERABILITY_TRACKING.md (NEW)
- Complete inventory of all 35 vulnerabilities
- Detailed analysis of each critical/high vulnerability
- Fixable vs unfixable breakdown
- Remediation plans with specific commands
- Risk assessment for unfixable vulnerabilities
- Phase-based remediation timeline
- Success metrics and monitoring plan
- Quick reference commands
2. scripts/manual-security-update.sh (NEW)
- Manual dependency update script
- Works when npm audit fix fails (network restrictions)
- Updates dependencies in priority order:
* Critical: crypto-js, form-data, jsonpath-plus, pbkdf2, sha.js
* High: axios, glob, jsonwebtoken, jws, node-forge, ws
* Moderate: @babel/runtime, webpack-dev-server, tmp
- Automatic backup creation
- Post-update audit report
- Rollback instructions
- Exit codes for CI/CD integration
Vulnerability Summary:
----------------------
Total: 35 vulnerabilities
├─ 🔴 Critical: 8 (5 fixable, 3 unfixable)
├─ 🟠 High: 8 (7 fixable, 1 unfixable)
├─ 🟡 Moderate: 11 (10 fixable, 1 unfixable)
└─ ⚪ Low: 8 (8 fixable, 0 unfixable)
Fixability: 86% (30/35)
Critical Vulnerabilities (Fixable):
------------------------------------
1. crypto-js < 4.2.0
- PBKDF2 1,000x weaker than spec
- Fix: npm install crypto-js@^4.2.0
2. jsonpath-plus < 10.2.0
- Remote Code Execution (RCE)
- CVSS: 9.8
- Fix: npm install jsonpath-plus@^10.2.0
3. pbkdf2 <= 3.1.2
- Silently returns static keys for Uint8Array input
- Breaks crypto guarantees
- Fix: npm install pbkdf2@^3.1.3
4. sha.js <= 2.4.11
- Missing type checks, hash rewind possible
- Fix: npm install sha.js@^2.4.12
5. form-data 4.0.0-4.0.3
- Unsafe random for boundary selection
- Fix: npm install form-data@^4.0.4
Critical Vulnerabilities (Unfixable):
--------------------------------------
1. babel-traverse (all versions)
- Babel 6.x EOL package
- Dev dependency only
- Risk: MEDIUM (mitigated by dev-only usage)
- Decision: ACCEPT RISK (documented)
2. babel-template (all versions)
- Via babel-traverse
- Risk: Same as above
3. babel-plugin-transform-builtin-extend
- Via babel-traverse
- Action: Review if needed, consider removal
High Severity Vulnerabilities (Fixable):
-----------------------------------------
- axios < 1.12.0: DoS attack
- glob < 10.5.0: Command injection
- jsonwebtoken <= 8.5.1: Unrestricted key type
- jws < 3.2.3: HMAC signature bypass
- node-forge < 1.3.2: ASN.1 unbounded recursion
- shelljs < 0.8.5: Privilege management
- ws < 5.2.4: DoS with many headers
Remediation Plan:
-----------------
Phase 1 (Day 1): Fix 5 critical vulnerabilities
Phase 2 (Week 1): Fix 7 high vulnerabilities
Phase 3 (Week 2): Fix 10 moderate vulnerabilities
Phase 4 (Week 2): Fix 8 low, review unfixable
Usage:
------
Manual Updates (Recommended):
```bash
chmod +x scripts/manual-security-update.sh
./scripts/manual-security-update.sh
```
Individual Updates:
```bash
# Critical
npm install crypto-js@^4.2.0 jsonpath-plus@^10.2.0 pbkdf2@^3.1.3 sha.js@^2.4.12 --save
npm install form-data@^4.0.4 --save-dev
# High
npm install axios@^1.12.0 jsonwebtoken@^9.0.0 jws@^3.2.3 node-forge@^1.3.2 ws@^8.0.0 --save
npm install glob@^10.5.0 shelljs@^0.8.5 --save-dev
```
Testing:
```bash
npm test
npm run build
npm run security:triage
```
Integration with Automation:
-----------------------------
The manual-security-update.sh script:
- Can be run in CI/CD when npm audit fix fails
- Generates JSON audit reports
- Exit codes: 0 (success), 1 (remaining vulns), 2 (audit error)
- Integrates with security-auto-fix.yml workflow
Documentation:
--------------
VULNERABILITY_TRACKING.md provides:
- Executive summary with counts
- Detailed analysis of each vulnerability
- CVE/GHSA references where available
- CVSS scores
- Impact assessment
- Specific remediation commands
- Testing requirements
- Risk acceptance documentation for unfixable
Risk Management:
----------------
Unfixable vulnerabilities are documented with:
- Risk level assessment
- Mitigation strategies
- Attack surface analysis
- Acceptance criteria
- Long-term remediation plans
This addresses the "eliminowanie podatności Krytycznych i Wysokich"
requirement with comprehensive tooling and documentation.
Next Steps:
-----------
1. Run ./scripts/manual-security-update.sh
2. Test thoroughly
3. Review unfixable babel-* dependencies
4. Consider removing babel-plugin-transform-builtin-extend if unused
5. Document accepted risks in SECURITY.md