Skip to content

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

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

aes-decrypter 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 320 vulnerabilities (25 low, 93 moderate, 175 high, 27 critical) in 1033 scanned packages

npm 11 counts vulnerabilities per package, not per path. With npm 11, the same lockfile shows 82 vulnerabilities (9 low, 16 moderate, 46 high, 11 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. npm audit --omit=dev shows 0 vulnerabilities.

CI cannot run on main now. GitHub stops each job that uses actions/cache@v2 at job setup.

Replaces #90 with the same rollup update and the same AppArmor step in CI.

Specific Changes proposed

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

  • Updated Node to 24 in .nvmrc 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. The old actions use the node12 runtime, which GitHub no longer supports.
    • Removed the actions/cache@v2 step. setup-node now caches the npm files.
    • Added the AppArmor step from chore: Update CI actions vhs-utils#46. Without it, Chrome headless cannot start on ubuntu-24.04.
    • 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. Karma 5 depends on vulnerable socket.io, engine.io and ua-parser-js versions.
    • videojs-generate-karma-config 8.1 also updates karma-coverage to 2.
  • 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-standard to 9. Version 8 uses eslint 5 and eslint-plugin-markdown 1, which depend on vulnerable flatted and inquirer versions.
    • Version 9 uses eslint 7, the same as in video.js. The lint result does not change.
  • 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 4.0.3, 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.
  • Changed the ci job to run karma on local headless browsers instead of BrowserStack. This is 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 do not start, so the job stays in run npm test until GitHub cancels it after 6 hours.
    • Removed the BROWSER_STACK_* env vars from the ci job. Then videojs-generate-karma-config uses the local Chrome and Firefox of the runner.
    • scripts/karma.conf.js removes the local Safari and Chromium launchers from the detected list. Local Safari needs AppleScript permission, and Chromium only repeats the Chrome tests.
    • The BrowserStack launchers do not change. If the two env vars come back, the old behavior comes back.

Built files:

  • dist/aes-decrypter.min.js is byte identical to the build from main.
  • The other three files have only format differences from newer Babel versions. Their ASTs are identical.
  • The old and new bundles give the same result when they decrypt test data in Node and in Chrome.
  • @videojs/vhs-utils and pkcs7 are still external in each bundle.
  • npm pack --dry-run gives the same file list as the published aes-decrypter 4.0.2 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 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.
The old actions use the node12 runtime, which GitHub no longer supports. GitHub stops each job that uses `actions/cache@v2`, so `setup-node` now caches the npm files. Chrome headless cannot start on ubuntu-24.04 while AppArmor restricts unprivileged user namespaces. 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. `videojs-generate-karma-config` 8.1 also updates `karma-coverage` to 2.
`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 8 uses eslint 5 and `eslint-plugin-markdown` 1, which depend on vulnerable `flatted` and `inquirer` versions. Version 9 uses eslint 7, the same as in video.js. The lint result does not change.
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.
The CI job stops in "run npm test" because the BrowserStack sessions do not start. Without the BrowserStack env vars, karma uses the local browsers of the runner. Local Safari and Chromium launchers are removed from the detected list. The BrowserStack launchers do not change.
Comment thread .github/workflows/ci.yml
- name: checkout code
uses: actions/checkout@v2
- name: Disable apparmor, which breaks chromium headless
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

note(non-blocking): this may no longer be needed

@javierarams
javierarams merged commit 4a50923 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