forked from exceljs/exceljs
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency file
Description
Problem
After adding package-lock.json (issue #10), we can now run npm audit to identify and fix security vulnerabilities in dependencies.
Current Status
After running npm audit fix:
- 37 vulnerabilities remain (6 critical, 18 high, 7 moderate, 6 low)
- Many were fixed automatically (1,131 packages updated)
- Remaining issues require breaking changes (
npm audit fix --force)
Vulnerability Breakdown
Critical (6)
flat- Prototype pollution (GHSA-2j2x-2gpw-g8fm)- Others in devDependencies (mocha, grunt tooling)
High (18)
braces- Resource consumption (GHSA-grv7-fg5c-xmjg)http-cache-semantics- ReDoS (GHSA-rc47-6667-2j5j)ip- Private IP misidentification (GHSA-78xj-cgh5-2h22)
Moderate (7)
got- UNIX socket redirect (GHSA-pfrx-2q88-qq97)debug- ReDoS (GHSA-gxpj-cx7g-858c)
Impact Assessment
Most vulnerabilities are in devDependencies (test/build tools):
- ✅ Low production risk - Not shipped to users
⚠️ CI/CD risk - Could affect build pipeline security⚠️ Developer risk - Could affect local development environment
Proposed Solution
Phase 1: Non-Breaking Fixes (DONE in this PR)
- ✅ Enabled package-lock in .npmrc
- ✅ Ran
npm audit fix(updated 1,131 packages) - ✅ Updated many transitive dependencies
Phase 2: Breaking Changes (Requires Testing)
Run npm audit fix --force which will:
- Update
mochato v11 (from v8) - test framework - Update
grunt-contrib-jasmineto v4 - test runner - Update
gotto v14 - HTTP library (devDep)
Risk: May break existing tests or build scripts
Phase 3: Manual Updates (If Needed)
Some packages may need manual intervention:
- Replace deprecated packages (watchify, grunt tooling)
- Update test configurations
- Fix any broken tests
Testing Plan
Before merging Phase 2:
- Run full test suite:
npm test - Run integration tests:
npm run test:integration - Test build:
npm run build - Verify CI/CD pipeline passes
- Manual smoke testing of core functionality
Implementation Steps
# 1. Create branch
git checkout -b fix-audit-vulnerabilities
# 2. Run audit fix with force flag
npm audit fix --force
# 3. Test everything
npm test
npm run test:integration
# 4. Fix any broken tests
# (investigate specific failures)
# 5. Commit and push
git add package-lock.json
git commit -m "Update #N Run npm audit fix --force to address remaining vulnerabilities"
git push origin fix-audit-vulnerabilities
# 6. Create PR for reviewAlternative: Manual Updates
If --force breaks too much, manually update problem packages:
npm install mocha@latest --save-dev
npm install grunt-contrib-jasmine@latest --save-dev
# etc.Security Note
While these are devDependencies, they still matter because:
- Compromised dev tools can inject malicious code during build
- CI/CD environments could be exploited
- Developer machines could be compromised
- Supply chain attacks often target dev dependencies
References
- npm audit documentation: https://docs.npmjs.com/cli/v10/commands/npm-audit
- GHSA advisories: https://github.com/advisories
- Related: Issue Add package-lock.json to enable security auditing #10 (Add package-lock.json)
Metadata
Metadata
Assignees
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency file