Skip to content

fix(deps): upgrade open to 11 and @oclif/core to 4.14 to clear Snyk findings - #286

Merged
Harshi-Shah-CS merged 5 commits into
developmentfrom
CL-0000_snyk-development
Nov 17, 2026
Merged

Harshi-Shah-CS merged 5 commits into
developmentfrom
CL-0000_snyk-development

Conversation

@Harshi-Shah-CS

Copy link
Copy Markdown
Contributor

What

Clears the Snyk pre-commit gate on development (snyk test --fail-on=all), which currently blocks every V1 commit.

  • open 8.4.2 → 11.0.4 (SNYK-JS-OPEN-22112123, High: Windows/WSL command escaping, fixed only in 11). open 11 is ESM-only, so the three browser-open call sites now go through src/util/open-url.ts, which loads it with a native dynamic import. The GitHub-connect step and launch:open await it (on Windows, open 11 must finish before the process exits). Opening stays best effort: every caller prints the URL first, so a failure is ignored instead of failing the command.
  • @oclif/core 4.11.14 → 4.14.0, lockfile only (within ^4.2.7): drops the ejs > jake > filelist > minimatch@5.1.9 path (SNYK-JS-MINIMATCH-22111072). Adds the @oclif/core > minimatch ^11.0.1 override already on v2-dev.
  • Still reported, not ignored. Neither has an upgrade, so neither fails the gate: adm-zip 0.6.1, and open 8.4.2 inside @contentstack/cli-utilities (CLI team's package; its latest, 2.0.2, still pins ^8.4.2).

The first commit (style:) is lint-only: lint-staged runs eslint --fix on staged files, and base-class.ts / open.ts had existing errors. No functional change, so review the second commit for the fix. .talismanrc gets a checksum entry for base-class.ts (false positives on key type annotations).

The third commit (test:) fixes the integration harness when it runs from the pre-push hook: git exports GIT_DIR to hooks, so the harness's git init/config/commit/remote add in its temp projects hit this repository instead (junk commits, and user.* / core.bare written to .git/config). jest.global-setup.ts now clears git's repo-local env vars.

Tests

  • snyk test --all-projects --fail-on=all passes
  • npm test: unit + Jest 140 passed, integration 31 passed (new unit test for the best-effort path)
  • Integration tests mock util/open-url instead of open, and stub @oclif/core's getPlatform (4.14 calls a native import('wsl-utils') that Jest's VM can't run)
  • Compiled openUrl run in plain Node 22: loads open 11 and opens the browser

#claude_code#
🤖 Generated with Claude Code

Harshi-Shah-CS and others added 3 commits November 16, 2026 16:56
The next commit changes both files, and lint-staged runs eslint --fix on
every staged file, so their existing errors would block it.

eslint --fix: indentation, quote style, let to const, Array<T> to T[].
By hand: drop an unused catch parameter, wrap two JSDoc lines, and add
eslint-disable-next-line for long user-facing strings, one URL and the
require() of the user's config file, so none of that text or behaviour
changes. No functional change.

.talismanrc gets a checksum entry for base-class.ts: Talisman flags the
moved "key" type annotations (parseEnvVariablesString, envKeys) as
potential secrets; they are not.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…indings

open@8.4.2 (SNYK-JS-OPEN-22112123, High) is fixed only in open 11, which
is ESM-only. The CLI compiles to CommonJS, where TypeScript turns import()
into require(), so the three browser-open call sites now go through
util/open-url.ts, which loads open with a native dynamic import. The
GitHub-connect step and launch:open await it, so the process cannot exit
before the browser starts; the delayed deployment-URL open keeps its
fire-and-forget timer. Opening the browser stays best effort: open 11
rejects when the launcher fails, and every caller prints the URL first,
so openUrl swallows that instead of failing the command (or crashing
with an unhandled rejection after a successful deploy).

@oclif/core moves from 4.11.14 to 4.14.0 within the existing ^4.2.7 range
(lockfile only). 4.14 uses ejs 6, which drops the ejs > jake > filelist >
minimatch@5.1.9 path behind SNYK-JS-MINIMATCH-22111072. An override pins
@oclif/core's own minimatch to ^11.0.1, as on v2-dev.

Two findings remain reported, not ignored. Neither has an upgrade, so
neither fails --fail-on=all: adm-zip@0.6.1 (SNYK-JS-ADMZIP-21707815), and
open@8.4.2 pulled in by @contentstack/cli-utilities, whose latest release
(2.0.2) still depends on open ^8.4.2.

Integration tests now mock util/open-url instead of open, and stub
@oclif/core's getPlatform, which 4.14 implements with a native
import('wsl-utils') that Jest's VM cannot run.

.talismanrc: base-class.ts checksum refreshed for its new content.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…un from a hook

Git exports GIT_DIR and the other repo-local variables to hooks, and the
pre-push hook runs npm test. With them set, the harness's git init,
config, commit and remote add in its temp projects acted on this
repository: a push from a worktree left "initial commit" commits on the
branch and set user.name, user.email, commit.gpgsign and core.bare in the
shared .git/config.

jest.global-setup.ts now clears the variables `git rev-parse
--local-env-vars` lists. It runs in Jest's parent process, so the child
processes the harness and the CLI spawn inherit the clean environment
(setupFiles only change the sandbox's copy of process.env).

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Harshi-Shah-CS
Harshi-Shah-CS requested a review from a team as a code owner November 16, 2026 14:15
@snyk-io

snyk-io Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 2 2 25 ✅ Passed
🟡 Medium Severity 0 1 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 2
  • Medium without fixes: 1
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@dhruv-parekh-cs dhruv-parekh-cs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the whole PR (9a39697).

  • Low package.json:26 (off-diff): @oclif/core stays ^4.2.7, so the 4.14 Snyk fix is lockfile-only and the root overrides don't apply to plugin installs; an install that keeps an existing 4.11.x still has the flagged path. Fix: raise the range to ^4.14.0.

Not approved: 6 low findings open (more than 3).

— 🤖 launch-pr-review-agent (Claude)


Generated by Claude Code

Comment thread src/util/open-url.ts Resolved
Comment thread src/util/open-url.ts Resolved
Comment thread src/util/open-url.test.ts Resolved
Comment thread test/integration/jest.setup.ts Resolved
Comment thread package-lock.json Resolved
- open-url.ts: create the dynamic importer lazily inside openUrl's try.
  Built at module load, new Function threw EvalError under
  --disallow-code-generation-from-strings, so every command importing the
  helper crashed instead of just not opening a browser.
- openUrl takes an optional loader, and the tests inject a fake open to
  cover the success path (called with the URL) plus both failure paths,
  instead of relying on Jest's VM rejecting the native import.
- Drop the code comments added in this PR (AGENTS.md: no code comments);
  the rationale lives in the commit messages and the PR description.
- AGENTS.md: the integration harness now replaces src/util/open-url and
  @oclif/core's getPlatform rather than the open package, and
  jest.global-setup.ts clears git's repo-local env vars.
- @oclif/core range raised to ^4.14.0 so installs cannot keep a 4.11.x
  that still carries the flagged minimatch path.
- package-lock.json: restore the 23 "libc" fields npm 10 dropped, copied
  from development for the same package versions. npm 11 (release CI)
  re-resolves the file without changes.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 2 2 25 ✅ Passed
🟡 Medium Severity 0 1 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 2
  • Medium without fixes: 1
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@Harshi-Shah-CS

Copy link
Copy Markdown
Contributor Author

/ship 2b summary (re: @dhruv-parekh-cs's review of 9a39697). All 6 findings were valid and are fixed in 081d551:

  • Fixed open-url.ts:5: importer built lazily inside the try; loads under --disallow-code-generation-from-strings (verified).
  • Fixed open-url.ts:3: code comments removed from all four files.
  • Fixed open-url.test.ts:6: injectable loader; success path asserts open is called with the URL; two failure paths.
  • Fixed jest.setup.ts:1: AGENTS.md harness section updated.
  • Fixed package-lock.json: the 23 libc fields are restored; npm 11 leaves the file unchanged.
  • Fixed (review body, off-diff) package.json:26: @oclif/core raised to ^4.14.0, so an install can no longer keep 4.11.x.

Left for human: none. Inline threads: 6 replied and resolved. Checks: npm test passes (unit + Jest 142, integration 31); Snyk --fail-on=all passes. Snyk now also reports a newly published papaparse@5.7.0 High (SNYK-JS-PAPAPARSE-22566253) via @contentstack/cli-utilities. It has no upgrade yet, comes from the CLI team's package, and doesn't fail the gate.

Next: needs re-approval.

@dhruv-parekh-cs dhruv-parekh-cs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review since 9a39697 (commit 081d551).

All six earlier findings are fixed at this head: the importer is created inside the try, the comments are gone, the success path is tested, the AGENTS.md harness section is updated, the libc fields are restored, and @oclif/core is ^4.14.0.

2 new low findings are inline. Approved: no high or medium finding is open, and 2 lows are open (the limit is 3).

— 🤖 launch-pr-review-agent (Claude)


Generated by Claude Code

Comment thread AGENTS.md Resolved
Comment thread src/util/open-url.test.ts Resolved
- AGENTS.md: the "all run for real" sentence had been joined onto the
  new git-env bullet; it closes the "Only these are replaced" bullet
  again, so the harness contract reads as before.
- open-url.test.ts: the failure-path tests now keep the happy path's
  assertions (AGENTS.md: do not skip assertions in edge-case tests). The
  load-failure test checks the loader was called; the open-failure test
  checks open was called with the URL.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 2 2 25 ✅ Passed
🟡 Medium Severity 0 1 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 2
  • Medium without fixes: 1
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@dhruv-parekh-cs dhruv-parekh-cs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review since 081d551 (commit ccdb47a).

Both lows from the last review are fixed: the "run for real" sentence is back on the replaced-modules bullet, and the edge-case tests now assert the loader and open calls.

No new findings. Approved.

— 🤖 launch-pr-review-agent (Claude)


Generated by Claude Code

@Harshi-Shah-CS
Harshi-Shah-CS merged commit 080cd70 into development Nov 17, 2026
7 checks passed
@Harshi-Shah-CS
Harshi-Shah-CS deleted the CL-0000_snyk-development branch November 17, 2026 05:34
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.

2 participants

⌂ Proxy