Skip to content

fix: force ejs to ^6.0.1 via npm overrides - #709

Merged
shrutiburman merged 7 commits into
twilio:ejs-critical-cve-override_internalfrom
sudhirnarayana:fix/ejs-critical-cve-override
Sep 4, 2026
Merged

fix: force ejs to ^6.0.1 via npm overrides#709
shrutiburman merged 7 commits into
twilio:ejs-critical-cve-override_internalfrom
sudhirnarayana:fix/ejs-critical-cve-override

Conversation

@sudhirnarayana

Copy link
Copy Markdown
Collaborator

Summary

  • JFrog Curation blocks the entire ejs 3.x line (CVE-2023-29827, CVSS 9.8 — "no fixed version" on 3.x). @oclif/core, @oclif/plugin-autocomplete, @oclif/plugin-help, @oclif/plugin-plugins, @oclif/plugin-update, @oclif/plugin-version, @oclif/plugin-warn-if-update-available, and the oclif devDependency all pull in nested ejs@3.x at various versions, some via a nested @oclif/core@2.x.
  • Adds "overrides": {"ejs": "^6.0.1"} to package.json to force every consumer in the tree onto a single patched ejs@6.0.1, without bumping any @oclif/* package.
  • Lockfile updated incrementally (not regenerated from scratch) to keep the diff minimal and avoid unrelated churn.
  • Verified ejs.render() (the only API these packages call, including @oclif/plugin-autocomplete's Zsh/PowerShell completion templating) behaves identically under 6.x.

Test plan

  • npm explain ejs shows a single ejs@6.0.1 resolved everywhere (was ~10 separate nested ejs@3.x installs)
  • npm run lint passes
  • npm test — 209/209 passing

kridai and others added 5 commits August 13, 2026 13:22
- Drop Node 20 from all CI test matrices; minimum is now Node 22
- Update hardcoded node-version '20' → '22' in release jobs
- Switch test job runners to ubuntu-x64
- SHA-pin actions/checkout (v4) and actions/setup-node (v6)
- Add Artifactory OIDC Auth step to all test jobs
- Add ARTIFACTORY_URL env var and id-token: write permissions
- Add lockfile-hygiene job (twilio/sdk-actions/npm-lockfile-hygiene) to cli-test.yml
- Guard test jobs with if: github.repository_owner == 'twilio'
- Fix dead SonarCloud condition (16.x → lts/*)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
JFrog Curation blocks ejs 3.x tree-wide (CVE-2023-29827, CVSS 9.8, no
fixed version on the 3.x line). @oclif/core, @oclif/plugin-autocomplete,
@oclif/plugin-help/plugins/update/version/warn-if-update-available, and
the oclif devDependency all pull in nested ejs 3.x at various versions.
An override forces every consumer in the tree to a single ejs@6.0.1
without needing to bump any oclif package itself.
@sudhirnarayana

Copy link
Copy Markdown
Collaborator Author

Note: this branch merges in the (still-open) #706 CI workflow changes so this PR runs against the real Artifactory/Curation-gated pipeline instead of the old public-registry CI. Once #706 merges to main, this diff will automatically shrink back down to just the ejs override.

npm install was consistently hitting npm's own "Exit handler never
called!" bug on this Windows CI image right after printing ~30
deprecation warnings from the oclif v1 dependency tree, before any
install progress. npm ci skips the resolution/mutation (arborist) code
path most bug reports implicate, using the lockfile directly instead,
and --loglevel=error cuts the volume of synchronous console writes
suspected of racing with npm's exit handling on Windows.
npm ci was still hitting "Exit handler never called!" even without the
resolution/mutation code path (npm ci vs npm install) or verbose log
output as suspects. The npm-cache directory is keyed only on
appveyor.yml, so it survives across builds -- including our own earlier
crashed runs -- and a corrupted/partial cache entry from a killed run
is a well-documented trigger for this exact npm bug. Re-key the cache
on package-lock.json too and clean it defensively before every install.
@shrutiburman
shrutiburman changed the base branch from main to ejs-critical-cve-override_internal September 4, 2026 07:41
@shrutiburman
shrutiburman merged commit 13a3eb0 into twilio:ejs-critical-cve-override_internal Sep 4, 2026
6 of 7 checks passed
@sudhirnarayana

Copy link
Copy Markdown
Collaborator Author

Fixed file-type's moderate-severity vuln (GHSA-5v7r-6r5c-r473, bumped 16.5.4 → 21.3.1 — the actual minimal patched version per the advisory, not the 22.0.2 npm audit fix --force defaults to; both are equally ESM-only so there's no non-breaking option).

Heads up: npm audit --audit-level=moderate --production will likely still fail this job. I confirmed independently (via a worktree off main + #706, no changes from this PR) that main will fail the same gate once #706 merges — 13 pre-existing vulnerabilities in axios, basic-ftp (critical), brace-expansion, follow-redirects, form-data, ip-address, js-yaml, lodash, minimatch, picomatch, qs, ws — all transitive deps of the oclif v1 tree / cli-core, unrelated to this PR's ejs fix. Left out of scope here since it's a much larger effort; flagging for whoever owns the audit-gate rollout.

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