Skip to content

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

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

m3u8-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.

CI on main does not run at the moment. GitHub stops all jobs that use actions/cache@v2 in "Set up job", so all recent PRs show a failed check. After that fix, the ci job waits for BrowserStack sessions that do not start, until GitHub cancels the job after 6 hours.

Before, using

  • node: v10.24.1
  • npm: 6.14.12

npm audit showed:

found 337 vulnerabilities (26 low, 99 moderate, 183 high, 29 critical) in 1039 scanned packages

npm 11 counts vulnerabilities per package, not per path. With npm 11, the same lockfile shows 83 vulnerabilities (9 low, 15 moderate, 47 high, 12 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 @babel/runtime and min-document have fixes inside the current ranges.

Replaces #196 with the same rollup update. This PR also repairs CI.

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 6 ignores the overrides field.
    • 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 stops all jobs that use actions/cache@v2.
    • Removed actions/cache@v2. actions/setup-node now does the npm cache.
    • Removed xvfb, because headless browsers do not need it.
  • Ran npm audit fix. Result: 40 vulnerabilities (6 low, 10 moderate, 21 high, 3 critical)
  • Updated karma to 6 and videojs-generate-karma-config to 8.1. Karma 5 depends on vulnerable socket.io, engine.io and ua-parser-js versions.
    • With karma 5, some local runs reported fewer than 171 tests and did not fail. With karma 6, all runs reported 171 tests.
  • 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 @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.
    • For version 7.2.0, 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.
  • Updated videojs-standard to 9.1. Version 8 uses eslint 5, which depends on vulnerable flatted, tmp and trim versions.
    • video.js and mpd-parser already use version 9. The lint result does not change.
  • Removed the BROWSER_STACK_* env from the ci job, so karma runs the local headless browsers of the runner. The change is the same 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.
    • Without BrowserStack sessions, the job does not wait until GitHub cancels it.
    • scripts/karma.conf.js removes Chromium and Safari from the detected browsers. Chromium cannot start on ubuntu-latest, and Safari is not headless.
    • The BrowserStack launchers do not change. If the secrets work again, add the two env vars back to use BrowserStack again.

Built files:

  • The build from main is byte identical to the published m3u8-parser 7.2.0 package.
  • dist/m3u8-parser.cjs.js and dist/m3u8-parser.es.js have only format differences from a newer Babel. Their ASTs are identical.
  • dist/m3u8-parser.js and dist/m3u8-parser.min.js include the extends helper from @babel/runtime. That helper is now the 7.29 version. The parser code does not change.
  • All 60 integration fixtures give the same output with the old and new bundles, in Node and in Chrome.
  • npm pack --dry-run gives the same file list as the published m3u8-parser 7.2.0 package.

Follow-up items:

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 6 ignores the `overrides` field. 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 stops all jobs that use `actions/cache@v2`, so CI fails before the tests start. `actions/setup-node` now does the npm cache. GitHub deprecated the old action runtimes. Headless browsers do not need xvfb.
All versions stay inside the declared ranges. The lockfile now resolves fixed runtime versions of `@babel/runtime` and `min-document`.
Karma 5 depends on vulnerable `socket.io`, `engine.io` and `ua-parser-js` versions. With karma 5, some local runs reported fewer than 171 tests and did not fail. `videojs-generate-karma-config` 8.1 is the release of the shared config for karma 6.
`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.
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.
`videojs-standard` 8 uses eslint 5, which depends on vulnerable `flatted`, `tmp` and `trim` versions. video.js and mpd-parser already use version 9. The lint result does not change.
CI jobs hang on BrowserStack until GitHub cancels them. Without the BrowserStack env, karma detects the local browsers of the runner. Chromium cannot start on ubuntu-latest and Safari is not headless, so the config removes them.
@javierarams
javierarams merged commit 55987b7 into main Oct 29, 2026
4 checks passed
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