Title: [APS-19017] fix: pin Semgrep CI image to sha256 digest by Rohannagariya1 · Pull Request #1129 · browserstack/browserstack-cypress-cli · GitHub
Open Graph Title: [APS-19017] fix: pin Semgrep CI image to sha256 digest by Rohannagariya1 · Pull Request #1129 · browserstack/browserstack-cypress-cli
X Title: [APS-19017] fix: pin Semgrep CI image to sha256 digest by Rohannagariya1 · Pull Request #1129 · browserstack/browserstack-cypress-cli
Description: Security Fix: APS-19017 (Low, supply-chain hygiene) Single-item PR — pins the Semgrep CI image from a mutable tag to its immutable digest. The other four items in APS-19017 were reviewed and are not included in this PR — reasoning at the bottom. Actual diff .github/workflows/Semgrep.yml: - image: returntocorp/semgrep:1.166.0 + image: returntocorp/semgrep:1.166.0@sha256:c180f0c93a17b420c0af5006214a29d3c747c5459c732b740191adf657dd0068 Why (INF-007) A version tag (:1.166.0) can be re-published by whoever owns the Docker Hub account at any time. Attack chain: Return-to-corp's Docker Hub account gets compromised (credential leak, MFA phishing, insider). Attacker re-publishes returntocorp/semgrep:1.166.0 with malicious layers added. Every subsequent CI run of this repo pulls the compromised image on next Semgrep step. Attacker's code executes inside our CI runner with access to GitHub Actions secrets — including the npm publish token for browserstack-cypress-cli. Attacker publishes a malicious version of the CLI to every BrowserStack Cypress customer's install. A sha256 digest is cryptographically immutable — Docker refuses to pull anything whose bytes don't hash to c180f0c9.... Even if Return-to-corp's account is compromised and the tag is re-published, Docker rejects the pull unless the digest matches the specific bytes we pinned to today. Verification Digest resolved via Docker Hub manifest API on 2026-09-16 — same image bytes master runs against today, just addressed by content-hash instead of tag. CI green post-change: CodeQL x3, semgrep/ci, Semgrep OSS, CodeRabbit. Other APS-19017 items — NOT in this PR INF-001 (axios ≥ 1.15.0) — already on master Confirmed via npm ls axios. No change needed. INF-005 (mocha → devDependencies) — REJECTED Ticket proposed this to shed the transitive serialize-javascript CVE (GHSA-5c6j-r48x-rmvq). Two problems: CVE is already mitigated on master. package.json has "overrides": { "serialize-javascript": ">=7.0.5" } — npm respects this override during resolution, so mocha's transitive serialize-javascript resolves to the patched version regardless of mocha's dependency section. The scanner that generated the ticket didn't account for the existing override. The move would break TestObservability for every default-config Cypress ≥ 10 customer. bin/testObservability/reporter/index.js:12 has: const Runnable = require('mocha/lib/runnable'); // need to handle as this isn't present in older mocha versions This is a regular require, not the requireModule() helper. Regular require walks up from the file's own location — from a globally-installed CLI's /usr/local/lib/node_modules/browserstack-cypress-cli/bin/testObservability/reporter/, it cannot reach the customer's project node_modules. Combined with: The CLI is globally installed per BS's official docs TestObservability is enabled by default for Cypress ≥ 10 → moving mocha to devDeps → npm install -g browserstack-cypress-cli uses --production → mocha not installed → next customer session → Runnable require throws MODULE_NOT_FOUND → TestObservability crashes on startup for every default-config Cypress ≥ 10 customer. INF-008 (files allowlist in package.json) — REJECTED The files this would hide from the npm tarball (.github/, CODEOWNERS, .eslintrc*, .editorconfig) are already public in this GitHub repo. Excluding them from the tarball doesn't protect any information that isn't already at github.com/browserstack/browserstack-cypress-cli. Framed as security in the ticket; is actually hygiene. Deferred as an optional hygiene PR if we want it later. CSL-003 (constants.js:401 md5 → sha256) — DEFERRED Changes the upload-dedup hash algorithm. A client-only bump would leave the CLI sending SHA-256 hashes that BS's server-side dedup (currently keyed on MD5 length/format) doesn't recognize → every next upload for every customer becomes a full re-upload until the SHA-256 cache warms. Needs client+server coordination and one-time bandwidth-spike acceptance. Separate ticket. Jira Ticket https://browserstack.atlassian.net/browse/APS-19017
Open Graph Description: Security Fix: APS-19017 (Low, supply-chain hygiene) Single-item PR — pins the Semgrep CI image from a mutable tag to its immutable digest. The other four items in APS-19017 were reviewed and are no...
X Description: Security Fix: APS-19017 (Low, supply-chain hygiene) Single-item PR — pins the Semgrep CI image from a mutable tag to its immutable digest. The other four items in APS-19017 were reviewed and are no...
Opengraph URL: https://github.com/browserstack/browserstack-cypress-cli/pull/1129
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4d837bd3-0f7a-0cd0-7dda-6eea843f05eb |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BAA2:321B08:2451F7:321866:6B04B698 |
| html-safe-nonce | 53a8f5d14249ab36f72a2dd419ee1afa2207e054b790df2fc4d34d0dee7d1bb6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUEyOjMyMUIwODoyNDUxRjc6MzIxODY2OjZCMDRCNjk4IiwidmlzaXRvcl9pZCI6Ijc3MDMwMDQ3NDMxNTY5MzgzOTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a12e30463260af7b4b7abcb5890822684ce0505bebdfcfe5e4c98520704d6eb4 |
| hovercard-subject-tag | pull_request:3865974452 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/browserstack/browserstack-cypress-cli/pull/1129/files |
| twitter:image | https://avatars.githubusercontent.com/u/142411639?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/142411639?s=400&v=4 |
| og:image:alt | Security Fix: APS-19017 (Low, supply-chain hygiene) Single-item PR — pins the Semgrep CI image from a mutable tag to its immutable digest. The other four items in APS-19017 were reviewed and are no... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/browserstack/browserstack-cypress-cli git https://github.com/browserstack/browserstack-cypress-cli.git |
| octolytics-dimension-user_id | 1119453 |
| octolytics-dimension-user_login | browserstack |
| octolytics-dimension-repository_id | 242935045 |
| octolytics-dimension-repository_nwo | browserstack/browserstack-cypress-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 242935045 |
| octolytics-dimension-repository_network_root_nwo | browserstack/browserstack-cypress-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b032e77f1ea437ede6c115446a0a467709b468e7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width