Skip to content

[APS-9999] security omnibus: consolidate cypress-cli dep bumps (APS-21205 · APS-21226) - #1185

Open
jasbir-browserstack wants to merge 5 commits into
masterfrom
APS-9999-cypress-cli-security-omnibus-sep2026
Open

jasbir-browserstack wants to merge 5 commits into
masterfrom
APS-9999-cypress-cli-security-omnibus-sep2026

Conversation

@jasbir-browserstack

@jasbir-browserstack jasbir-browserstack commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Consolidated security PR replacing #1183 so both SLA-tracked CVEs land under a single omnibus branch (matching the same pattern used for the SeleniumHub batch in browserstack/SeleniumHub#14734). No logic changes vs the source — same lockfile diff, freshly branched off current master.

What's in this PR

Source PR Branch Scope
#1183 security/APS-21226-21205-dep-bumps-sep2026 Bump vulnerable transitives via npm audit fix (no overrides, no package.json change)

Tickets covered

Ticket Package Advisory Now @
APS-21205 js-yaml GHSA-52cp-r559-cp3m 3.15.2 / 4.3.2
APS-21226 brace-expansion GHSA-3jxr-9vmj-r5cp 1.1.18 / 2.1.4

Why land this despite the repo being public

browserstack-cypress-cli runs on customer CI machines and parses customer-supplied inputs:

  • browserstack.ymljs-yaml (DoS in merge-key handling; a crafted YAML anchor chain can hang the CI worker)
  • Cypress spec / exclude glob patterns → brace-expansion via minimatch (DoS in {} expansion; a crafted glob can hang for minutes)

Not data-exfil, but a customer could accidentally hang their own CI, so the patched transitives are worth landing.

Files

Single-file diff: package-lock.json (+131 / −131). No package.json changes, no runtime code changes.

Test plan

  • npm test on branch: 711 passing / 2 pending / 16 failing — matches baseline on master. All 16 failures are pre-existing, no regression from the bump.
  • npm audit: neither target advisory resolves against the tree.
  • Repo CI on this Draft — expected to pass everywhere it passes on master.

Note to CLI-team reviewer

Because this SDK ships to customers, a bad bump breaks their CI. This PR is a pure lockfile refresh, no API surface change, but please confirm before undrafting that a representative browserstack.yml parses identically on the branch.

Note

Source PR #1183 remains open pending confirmation this consolidated one is preferred for merge — will close once this lands.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated package version selections for several components. No user-facing changes are noted.

jasbir-browserstack and others added 3 commits September 18, 2026 10:17
…APS-21226, APS-21205)

Refreshes package-lock.json so `npm audit` no longer flags:

- APS-21205  js-yaml         GHSA-52cp-r559-cp3m  → 3.15.2 and 4.3.2
- APS-21226  brace-expansion GHSA-3jxr-9vmj-r5cp  → 1.1.18 and 2.1.4

Both are transitive; `npm audit fix` alone was sufficient — no
`overrides` change needed. package.json is unchanged.

Runtime reachability rationale: this CLI runs on customer CI machines
and parses customer-supplied `browserstack.yml` (js-yaml) and Cypress
spec/exclude glob patterns (brace-expansion via minimatch). Both CVEs
are DoS-class and reachable through inputs the customer's build
controls, so landing the patched transitives is worth doing even
though the SDKs sit in a public repo.

Verification:
- `npm test` on branch: **711 passing / 2 pending / 16 failing** —
  identical to baseline on `master`. All 16 failures are pre-existing
  and unrelated to this bump.
- `npm audit` no longer resolves either target advisory against this
  repo's dependency tree.

Follow-up (out of scope): Dependabot should be disabled on the
`browserstack/*` public sample SDK repos so per-package CVEs stop
auto-filing SLA-tracked Jira against Automate. Tracked separately.
This PR is scoped to browserstack-cypress-cli specifically because
the runtime reachability rationale above makes it a genuine customer
concern, unlike the pure-sample SDK repos.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ps-sep2026' into APS-9999-cypress-cli-security-omnibus-sep2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited), Workspace UI (inherited)

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: bd7e3ec6-0515-4897-856c-3e45f291b83d

📥 Commits

Reviewing files that changed from the base of the PR and between 5558d60 and 4e3233c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (5)
Source excerpt: **Never** log raw `bsConfig` — it carries `auth.username` and `auth.access_key`.

📄 CodeRabbit inference engine (browserstack/browserstack-ai-harness:stacks/stack-domain-browserstack-cypress-cli/rules/security.md)

Files:

  • package.json
Source excerpt: **npm** — comes with Node.

📄 CodeRabbit inference engine (browserstack/browserstack-ai-harness:stacks/stack-domain-browserstack-cypress-cli/knowledge/SETUP.md)

Files:

  • package.json
Source excerpt: [ ] Net-new dependency?

📄 CodeRabbit inference engine (browserstack/browserstack-ai-harness:stacks/stack-domain-browserstack-cypress-cli/skills/stack:code-review/references/checklist.md)

Files:

  • package.json
Source excerpt: Dependencies (`package.json` / `package-lock.json`)

📄 CodeRabbit inference engine (browserstack/browserstack-ai-harness:stacks/stack-domain-browserstack-cypress-cli/agents/stack-code-reviewer.md)

Files:

  • package.json
Source excerpt: Version bumps in `package.json` are part of a release commit, not a feature commit.

📄 CodeRabbit inference engine (browserstack/browserstack-ai-harness:stacks/stack-domain-browserstack-cypress-cli/rules/commit-conventions.md)

Files:

  • package.json

📝 Walkthrough

Walkthrough

The package overrides now pin js-yaml versions 3 and 4, and brace-expansion versions 1 and 2. The existing serialize-javascript override remains unchanged.

Changes

Dependency Overrides

Layer / File(s) Summary
Override constraints
package.json
The overrides configuration pins js-yaml@3 to 3.15.2, js-yaml@4 to 4.3.2, brace-expansion@1 to 1.1.18, and brace-expansion@2 to 2.1.4. The serialize-javascript override remains unchanged.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4e323

This change pins patched js-yaml and brace-expansion versions in the repository's own dependency tree. Customer installs of the CLI can already resolve the patched versions under the existing version ranges. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies a security dependency update and its consolidation across the referenced issues. It clearly relates to the changes for js-yaml and brace-expansion.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

A rabbit checks the versions in line
Four pinned paths now neatly align
YAML hops with care
Braces bloom fair
While serialize stays fine

Comment @coderabbitai help to get the list of available commands.

@jasbir-browserstack
jasbir-browserstack marked this pull request as ready for review September 21, 2026 12:26
@Ravneet2003

Copy link
Copy Markdown
Collaborator

Deep-dive review — no status posted, per request.

The two CVE targets landed correctly: js-yaml 3.14.2→3.15.2 & 4.1.1→4.3.2 (GHSA-52cp-r559-cp3m), brace-expansion 1.1.14→1.1.18 & 2.1.0→2.1.4 (GHSA-3jxr-9vmj-r5cp). ✅

[Medium] Scope is wider than the description. The PR says "Bump vulnerable transitives via npm audit fix … js-yaml + brace-expansion", but the lockfile actually bumps 27 packages, including two that aren't transitive-only:

  • axios 1.16.1 → 1.20.0 — a direct dep (^1.15.0), a minor bump, not a patch. axios is the HTTP client the CLI uses against BrowserStack APIs.
  • form-data 4.0.5 → 4.0.6 (direct, ^4.0.0).
  • plus the whole @babel/* toolchain (16 pkgs), browserslist data, ws, qs, semver, glob, etc.

npm audit fix cascades npm update across the tree, so this is expected behaviour — but for a security PR that emphasises a minimal, independently-reviewable/rollback-able diff, dragging a minor axios bump into a 'two-CVE' change is worth either (a) documenting the full set + confirming the CLI test suite passes against axios 1.20.0, or (b) using targeted overrides for just js-yaml + brace-expansion to keep the fix surgical. CodeQL/Semgrep/Analyze are green, which helps, but they won't catch an axios behavioural change.

Replaces the `npm audit fix` cascade approach with targeted npm
overrides so only the two SLA-tracked CVE packages move.

Per Ravneet's [Medium] finding on PR #1183 / #1185: the `npm audit fix`
run cascaded to 27 packages including axios 1.16.1 → 1.20.0 (a *direct*
dep and minor bump on the HTTP client used against BrowserStack APIs)
plus form-data 4.0.5 → 4.0.6, @babel/*, browserslist, ws, qs, semver,
glob, etc. For a security PR framed as "just js-yaml + brace-expansion",
dragging a minor axios bump in expanded the risk surface for a CLI that
ships to customer CI machines.

This commit resets `package-lock.json` to master's baseline and adds
per-major overrides in `package.json`:

  "js-yaml@3": "3.15.2"       (GHSA-52cp-r559-cp3m)
  "js-yaml@4": "4.3.2"        (GHSA-52cp-r559-cp3m)
  "brace-expansion@1": "1.1.18" (GHSA-3jxr-9vmj-r5cp)
  "brace-expansion@2": "2.1.4"  (GHSA-3jxr-9vmj-r5cp)

Verified via `npm install --package-lock-only`:
  - js-yaml:        4.1.1 → 4.3.2,  3.14.2 → 3.15.2
  - brace-expansion: 1.1.14 → 1.1.18, 2.1.0 → 2.1.4
  - axios:           1.16.1 (unchanged)
  - form-data:       4.0.5 (unchanged)

`package-lock.json` diff shrinks from 262 lines to 42; both target
CVEs are absent from `npm audit`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jasbir-browserstack

Copy link
Copy Markdown
Collaborator Author

Addressed the [Medium] scope-cascade finding in b7472d5.

Approach: switched from npm audit fix cascade to targeted npm overrides. Reset package-lock.json to master's baseline, then added per-major overrides in package.json:

"js-yaml@3": "3.15.2",
"js-yaml@4": "4.3.2",
"brace-expansion@1": "1.1.18",
"brace-expansion@2": "2.1.4"

Verified via npm install --package-lock-only:

Package Master After PR
js-yaml (root) 4.1.1 4.3.2
js-yaml (nested @istanbuljs) 3.14.2 3.15.2
brace-expansion (root) 1.1.14 1.1.18
brace-expansion (nested mocha/readdir-glob) 2.1.0 2.1.4
axios 1.16.1 1.16.1 (unchanged)
form-data 4.0.5 4.0.5 (unchanged)
  • package-lock.json diff shrunk from +131/-131 (27 packages) to +21/-21 (4 packages).
  • Both target CVEs absent from npm audit.
  • @babel/*, browserslist, ws, qs, semver, glob — all untouched. No direct-dep bump, no cascade.

The trade-off you noted (surgical vs cascade) is now surgical. Please re-review when you get a chance.

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