Skip to content

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

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

shrutiburman merged 16 commits into
twilio:fix/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), which breaks installs since @oclif/core@^1.16.0 and the nested @oclif/core@2.16.0 pulled in by @oclif/plugin-help@^5.1.3 both depend on ejs@^3.x.
  • Adds "overrides": {"ejs": "^6.0.1"} to package.json to force every consumer in the dependency 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) behaves identically under 6.x.

Test plan

  • npm explain ejs shows a single ejs@6.0.1 resolved everywhere (was two nested copies of ejs@3.x)
  • npm run lint passes
  • npm test — 205/205 passing

kridai and others added 16 commits August 13, 2026 13:09
- 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-core-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>
The npm-lockfile-hygiene gate failed: all 878 resolved URLs in
package-lock.json pointed at npmjs.artifacts.twilio.com, which an external
consumer cannot reach. The action allows only registry.npmjs.org,
registry.yarnpkg.com, github.com and codeload.github.com.

- rewrote all 878 resolved URLs to registry.npmjs.org. Package set is unchanged:
  1136 entries, identical versions and integrity hashes, so the same tarballs
  still verify
- `make install` no longer does `rm -f package-lock.json`. Deleting it forced a
  full re-resolution on every run, which is why CI began failing without any
  code change: GitHub moved the runners to Node 24 (Node 20 deprecation),
  changing the bundled npm and therefore the resolved tree. It also regenerated
  the lockfile through whatever registry the developer had configured, which is
  how the Artifactory URLs got committed
- `npm install --no-optional` -> `npm ci --omit=optional`. --no-optional is a
  deprecated alias npm warns about on every run, and npm ci installs the
  committed tree instead of re-resolving. Verified package.json and the lockfile
  are in sync (lockfileVersion 3), so npm ci will not fail on drift

This does not unblock CI on its own. Two packages in the tree are still refused
by jfrog curation:

  npm@7.24.2  via @semantic-release/npm (^7.0.0), CVE-2021-43616 CVSS 9.8.
              Fix exists at >= 8.4.1, but ^7.0.0 cannot reach it, and
              @semantic-release/npm@7.1.3 is transitive, so it needs a
              semantic-release upgrade
  ejs@3.1.10  via @oclif/core@1.26.2 and a nested copy under
              @oclif/plugin-help. CVE-2023-29827 CVSS 9.8, and curation reports
              no version resolves it, so it needs either an exception or
              dropping @oclif/core v1
Adds an informational step that tries `npm pack` for ejs 3.1.10 and 6.0.1 through
the registry CI is authenticated against, and reports allowed/blocked in the job
summary. 3.1.10 is what @oclif/core <= 4.13.3 pulls; 6.0.1 is what >= 4.13.4
pulls, so this answers whether upgrading past that boundary clears the block --
without committing to the upgrade first.

It has to run in CI. A local probe cannot answer it: developer npm points at
npmjs.artifacts.twilio.com/virtual-npm-twilio, which allows ejs 3.1.10, while the
403 in CI came from twilio.jfrog.io/virtual-npm-thirdparty. Different Artifactory
repositories carry different curation policies, and local credentials get E401
against the CI one, so only a CI run is authoritative.

continue-on-error, since it is a question rather than a gate.

Also trims the trailing internal catalog URL out of the failure reporting added
earlier, for both the curation notice and the 403 line -- the tarball filename is
enough to identify the package.
Removes the failure-only step that grepped the install log for curation blocks,
and restores `- run: make install` to its original form -- the tee to
/tmp/install.log and the step id existed only to feed it.

The curation probe still reports which ejs versions are allowed, which is the
question that actually needed answering.
JFrog Curation blocks ejs 3.x tree-wide (CVE-2023-29827, CVSS 9.8, no
fixed version on the 3.x line), which breaks installs since @oclif/core
and the nested @oclif/core pulled in by @oclif/plugin-help both depend
on ejs@^3.x. An override forces every consumer in the tree to a single
ejs@6.0.1 without needing to bump any oclif package itself.
…itical-cve-override

# Conflicts:
#	package-lock.json
@sudhirnarayana

Copy link
Copy Markdown
Collaborator Author

Note: this branch merges in the (still-open) #312 CI/publishing changes so this PR runs against the real Artifactory/Curation-gated pipeline (the same pipeline whose CI log first surfaced the ejs 3.x Curation block this fix addresses). Once #312 merges to main, this diff will automatically shrink back down to just the ejs override.

@shrutiburman
shrutiburman changed the base branch from main to fix/ejs-critical-cve-override_internal September 4, 2026 07:33
@shrutiburman
shrutiburman merged commit 824d267 into twilio:fix/ejs-critical-cve-override_internal Sep 4, 2026
7 of 10 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