Skip to content

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

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

jasbir-browserstack wants to merge 4 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

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

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: fa372708-da79-4e90-918b-cc41f3a05867

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

2 participants