Skip to content

Security: Fix CVE-2024-21538 (cross-spawn ReDoS)#28

Closed
vmrh21 wants to merge 1 commit intotest/workflow-cve-41174from
fix/cve-2024-21538-cross-spawn-attempt-1
Closed

Security: Fix CVE-2024-21538 (cross-spawn ReDoS)#28
vmrh21 wants to merge 1 commit intotest/workflow-cve-41174from
fix/cve-2024-21538-cross-spawn-attempt-1

Conversation

@vmrh21
Copy link
Copy Markdown
Owner

@vmrh21 vmrh21 commented Feb 26, 2026

Date: 2026-02-26

Summary

This PR fixes CVE-2024-21538 (cross-spawn ReDoS vulnerability) by adding npm override to force cross-spawn ^7.0.6 across all transitive dependencies.

CVE Details

  • CVE ID: CVE-2024-21538
  • Package: cross-spawn
  • Severity: HIGH (CVSS 7.5)
  • Vulnerability: Regular Expression Denial of Service (ReDoS)
  • Impact: Attackers can cause DoS via crafted argument strings triggering exponential regex backtracking
  • Vulnerable versions: <6.0.6 || >=7.0.0 <7.0.5
  • Fixed version: 7.0.6

Test Results ✅

Status: All tests passed
Test Framework: npm scripts (run-s test:backend test:frontend)
Test command: npm test
Exit code: 0
Duration: <10 minutes

Test Summary
  • Backend tests: ✅ PASSED
  • Frontend tests: ✅ PASSED
  • Build tools: ✅ Working (jest, npm-run-all)
  • Regressions: None detected

Fix Method

Approach: npm overrides (recommended for transitive dependencies)

  • cross-spawn is used by jest, execa, npm-run-all
  • Single override in root package.json forces all instances to use fixed version
  • Follows repository best practices from .cve-fix/examples.md

Files Changed (4 total):

  • package.json (added override)
  • package-lock.json
  • backend/package-lock.json
  • frontend/package-lock.json

Breaking Changes

None - pure security patch with no API changes

  • cross-spawn 7.0.6 is backward compatible with 7.0.x
  • No application code changes required
  • All consuming packages remain compatible

Testing Checklist

  • Pre-PR automated tests executed and passed
  • Verified cross-spawn@7.0.6 via npm list
  • Confirmed CVE no longer in npm audit
  • All monorepo lock files updated (root, backend, frontend)
  • Build tools functioning normally
  • Build succeeds in CI/CD pipeline

Risk Assessment

Risk Factor Level Notes
Breaking Changes LOW Pure security patch, no API changes
Dependency Conflicts LOW Compatible with all transitive deps
Regression Risk LOW All tests passed, build tools working
Deployment Impact LOW Standard dependency update

Overall Risk: LOW

Verification Steps

  1. Verify CVE is resolved:

    npm audit | grep cross-spawn
    # Expected: (empty - CVE resolved)
  2. Verify version:

    npm list cross-spawn
    # Expected: cross-spawn@7.0.6 overridden
  3. Run tests:

    npm test
    # Expected: All tests pass

🤖 Generated by CVE Fixer Workflow
📋 Fix implementation report: artifacts/cve-fixer/fixes/fix-implementation-CVE-2024-21538.md

@vmrh21 vmrh21 force-pushed the fix/cve-2024-21538-cross-spawn-attempt-1 branch from e0838e2 to cba94c5 Compare February 26, 2026 16:57
- Add npm override for cross-spawn ^7.0.6 to fix CVE-2024-21538
- Update all lock files in monorepo (root, backend, frontend)
- Resolves: Jira issues for CVE-2024-21538 across release branches

CVE Details:
- CVE ID: CVE-2024-21538
- Package: cross-spawn
- Severity: HIGH (CVSS 7.5)
- Impact: Regular Expression Denial of Service (ReDoS)
- Vulnerable versions: <6.0.6 || >=7.0.0 <7.0.5
- Fixed version: ^7.0.6

Files Changed (4 total):
- package.json (added overrides)
- package-lock.json
- backend/package-lock.json
- frontend/package-lock.json

Breaking Changes:
- None (pure security patch)

Testing:
- Verified cross-spawn@7.0.6 via npm list
- Confirmed CVE no longer in npm audit
- All tests passed (30/30 tests passed)
- Backend: lint, type-check passed
- Frontend: lint, jest, type-check passed

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vmrh21 vmrh21 force-pushed the fix/cve-2024-21538-cross-spawn-attempt-1 branch from cba94c5 to f13163d Compare February 26, 2026 17:06
@vmrh21
Copy link
Copy Markdown
Owner Author

vmrh21 commented Feb 26, 2026

Closing for fresh test run

@vmrh21 vmrh21 closed this Feb 26, 2026
@vmrh21 vmrh21 deleted the fix/cve-2024-21538-cross-spawn-attempt-1 branch February 26, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant