Skip to content

fix: update node, regenerate the lockfile and run the audit pass - #194

Merged
javierarams merged 10 commits into
mainfrom
fix/security-audit-and-node-update
Oct 29, 2026
Merged

javierarams merged 10 commits into
mainfrom
fix/security-audit-and-node-update

Conversation

@javierarams

@javierarams javierarams commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

mpd-parser still uses Node 10 and a v1 lockfile, so a new release needs a toolchain update first. The steps are the same as in videojs/video.js#9231 and videojs/video.js#9232:

  1. Update Node.
  2. Regenerate the lockfile.
  3. Run the audit pass.

Before, using

  • node: v10.24.1
  • npm: 6.14.12

npm audit showed:

found 269 vulnerabilities (24 low, 65 moderate, 163 high, 17 critical) in 1098 scanned packages

npm 11 counts vulnerabilities per package, not per path. With npm 11, the same lockfile shows 69 vulnerabilities (11 low, 16 moderate, 32 high, 10 critical).

Now, using

  • node: v24.21.0
  • npm: 11.19.0

npm audit shows 19 vulnerabilities (7 moderate, 12 high). Two advisories cause all of them, and neither advisory has a patched release. Both affect only dev dependencies.

The runtime dependency ranges do not change. The runtime advisories in @xmldom/xmldom, @babel/runtime and min-document have fixes inside the current ranges.

Replaces #190 with the same rollup update. @xmldom/xmldom stays on ^0.8.3, because 0.8.15 fixes all xmldom advisories. A move to 0.9 is a breaking change for consumers, and no advisory requires it.

Specific Changes proposed

Each commit passes lint, the build, karma, the node tests and prepublishOnly by itself.

  • Updated Node to 24 in .nvmrc, CI and engines. The engines value is the same as in video.js.
    • npm 11 regenerated the lockfile as v3 and kept the resolved versions.
  • Added CHANGELOG.md to files in package.json. npm 7 and later do not add it to the package automatically, but the releases made with npm 6 included it.
  • Updated the workflow actions to versions with Node 24 runtimes. GitHub deprecated the node16 and node20 action runtimes.
    • Removed xvfb, because headless browsers do not need it.
  • Ran npm audit fix. Result: 39 vulnerabilities (7 low, 14 moderate, 15 high, 3 critical)
  • Updated karma to 6. Karma 5 depends on vulnerable socket.io, engine.io and ua-parser-js versions.
  • Updated rollup to ^2.80.0 and added an override for serialize-javascript.
    • rollup-plugin-terser requires serialize-javascript 4.x, which has a known vulnerability. The override forces a fixed version.
  • Updated jsdom to 29. jsdom 16 depends on vulnerable http-proxy-agent versions.
    • With jsdom 16, each npm audit fix run changed jsdom between 16.5.3 and 16.7.0.
  • Updated @videojs/generator-helpers to 3.2. Version 2 brings doctoc 1, which depends on vulnerable underscore and trim versions.
    • Husky 7 ignores the hooks in package.json. The pre-commit hook moved to .husky/pre-commit, and the prepare script installs it.
    • Version 3 removes conventional-changelog-cli and not-prerelease. The version and update-changelog scripts now use vjs-update-changelog, like the release workflow.
    • For version 1.4.1, the generated changelog has 0 differences from the old command. Prereleases still skip the changelog.
    • vjsverify 3 cannot parse the npm pack --json output when prepare writes to stdout. videojs-generator-verify 4 keeps prepublishOnly working.
  • Added an override for uuid. conventional-changelog-cli 2 uses tempfile 3, which depends on a vulnerable uuid version.
    • tempfile only calls uuid.v4(), and uuid 11 keeps that function.
  • Removed BrowserStack from the ci job, the same change as chore(ci): run karma on local headless browsers instead of BrowserStack http-streaming#1612 and chore(ci): run karma on local headless browsers instead of BrowserStack mux.js#453. The BrowserStack sessions did not start, so the unit and coverage jobs stopped only at the 6 hour timeout. Karma now uses the headless browsers on the runner.
    • scripts/karma.conf.js filters out Safari and Chromium. ChromiumHeadless cannot start on ubuntu-latest, and Safari has no headless launcher.
    • The ci job has a 20 minute timeout, so a new hang stops early.

Built files:

  • dist/mpd-parser.min.js is byte identical to the build from main.
  • The other three files have only format differences from newer Babel and rollup versions. Their ASTs are identical.
  • bin/parse.js gives the same output for all 17 test manifests.
  • xmldom is still external in each bundle.
  • npm pack --dry-run gives the same file list as the published mpd-parser 1.4.0 package.

Follow-up items:

  • braces GHSA-vfj7-8cjw-p6xm (high) has no fixed version. It comes from karma, lint-staged, @babel/cli and es-check.
  • sprintf-js GHSA-hp3w-g68c-fv3c (moderate) has no fixed version. It comes from eslint 7 in videojs-standard.
  • A full sprintf-js fix needs a videojs-standard release with a newer eslint.
  • CI does not run Safari now. Before this change, the BrowserStack config also had Safari 15 and 17, but those sessions did not start. To get Safari back, fix the BrowserStack credentials and add the two BROWSER_STACK_* env vars to the ci job again.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

npm 11 kept the resolved versions. It also installs `@babel/cli` automatically, because `@videojs/babel-config` declares it as a peer dependency. The `engines` value is the same as in video.js.
npm 7 and later do not add CHANGELOG.md to the package automatically. The releases made with npm 6 included it.
GitHub deprecated the node16 and node20 action runtimes. Headless browsers do not need xvfb.
All versions stay inside the declared ranges. The lockfile now resolves fixed runtime versions of `@xmldom/xmldom`, `@babel/runtime` and `min-document`.
Karma 5 depends on vulnerable `socket.io`, `engine.io` and `ua-parser-js` versions.
`rollup` 2.79.2 and earlier have a DOM clobbering vulnerability. `rollup-plugin-terser` requires `serialize-javascript` 4.x, which has a known vulnerability. The override forces a fixed version.
`jsdom` 16 depends on vulnerable `http-proxy-agent` versions. With `jsdom` 16, each `npm audit fix` run changed `jsdom` between 16.5.3 and 16.7.0. `jsdom` 30 does not support Node 22.13, so 29 is the newest version that our `engines` allow.
Version 2 brings `doctoc` 1, which depends on vulnerable `underscore` and `trim` versions.

Husky 7 ignores the hooks in `package.json`. Without `.husky/pre-commit` and the `prepare` script, the pre-commit hook stops silently.

Version 3 removes `conventional-changelog-cli` and `not-prerelease`, so the changelog scripts use `vjs-update-changelog`. The changelog output does not change.

`vjsverify` 3 cannot parse the `npm pack --json` output when `prepare` writes to stdout. Without `videojs-generator-verify` 4, `prepublishOnly` fails.
`conventional-changelog-cli` 2 uses `tempfile` 3, which depends on a vulnerable `uuid` version. `tempfile` only calls `uuid.v4()`, and `uuid` 11 keeps that function.

@spuppo-mux spuppo-mux left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CI times out at 6h on unit and coverage with the BrowserStack secrets set, the same hang as http-streaming#1612.

Please bring that change in here: drop the BROWSER_STACK_* env from ci.yml and run karma on local headless browsers in scripts/karma.conf.js. Also add timeout-minutes to the ci job.

Removing xvfb is fine once karma runs headless.

Rest of the diff looks good. Non-blocking: the description says generator-helpers 3 removes conventional-changelog-cli and not-prerelease, but both are still in the lockfile (transitive), and github-release.yml still uses not-prerelease.

BrowserStack sessions never start, so the ci jobs hang until the 6 hour GitHub timeout. Without the BROWSER_STACK_* env, karma detects the runner's local headless browsers. ChromiumHeadless cannot start on ubuntu-latest and Safari has no headless launcher, so both are filtered out. A 20 minute job timeout stops any future hang early.
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.73%. Comparing base (34dfa5f) to head (238c2cc).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
+ Coverage   94.68%   94.73%   +0.04%     
==========================================
  Files          19       19              
  Lines         847      855       +8     
  Branches      259      261       +2     
==========================================
+ Hits          802      810       +8     
  Misses         45       45              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@spuppo-mux spuppo-mux left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice!

@javierarams
javierarams merged commit a8e7bc6 into main Oct 29, 2026
8 checks passed
@javierarams
javierarams deleted the fix/security-audit-and-node-update branch October 29, 2026 14:28
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.

3 participants