Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions SECURITY_FIX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Security Fix: serialize-javascript vulnerability (CVE-2020-7660)

## Issue
The serialize-javascript npm package (versions <= 7.0.2) contained a code injection vulnerability. This was an incomplete fix for CVE-2020-7660.

## Problem
- mocha@10.8.2 required serialize-javascript@^6.0.2
- No patched version was available in the 6.x series
- The earliest fixed version is 7.0.5

## Solution
1. **Updated Mocha**: Upgraded to mocha@^11.0.0 (latest stable)
2. **Added Override**: Used npm `overrides` to force serialize-javascript@^7.0.5
3. **Engine Requirement**: Updated Node.js requirement to >=18.18.0 to support newer dependencies

## Changes Made

### package.json
- `mocha`: Updated from `^10.0.0` to `^11.0.0`
- `engines.node`: Updated from `>=14.20.0` to `>=18.18.0`
- Added `overrides` section to force `serialize-javascript@^7.0.5`

### Result
- ✅ serialize-javascript vulnerability resolved (7.0.5 installed)
- ✅ npm audit no longer shows serialize-javascript vulnerability
- ⚠️ Node.js >=18.18.0 now required

## Verification
```bash
npm ls serialize-javascript
# Shows: serialize-javascript@7.0.5

npm audit
# No longer reports serialize-javascript vulnerability
```
Comment on lines +23 to +35

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc claims serialize-javascript@7.0.5 is installed, but package.json uses an override range (^7.0.5), so the installed version may be newer than 7.0.5. To keep this doc accurate over time, describe it as >=7.0.5 (or “7.0.5+”) and/or show an example output rather than an exact version.

Copilot uses AI. Check for mistakes.

## Compatibility
This fix requires Node.js >=18.18.0. Projects using older Node.js versions will need to upgrade.

For production deployments, ensure Node.js version meets the new requirement.

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this PR raises the minimum Node.js version to >=18.18.0, please also update other repo-facing docs/config that still reference Node 14 (e.g., README system requirements) and CI/release workflows that pin or matrix-test Node 14/16. Otherwise consumers and CI will be out of sync with package.json engines.

Suggested change
For production deployments, ensure Node.js version meets the new requirement.
For production deployments, ensure the Node.js version is >=18.18.0.

Copilot uses AI. Check for mistakes.
Loading
Loading