Skip to content

Security: harden CI workflow, deps, CODEOWNERS, and config merge#81

Open
AakashHotchandani wants to merge 1 commit into
browserstack:masterfrom
AakashHotchandani:security/sdk-6064-6065-6066-6073-6077-fixes
Open

Security: harden CI workflow, deps, CODEOWNERS, and config merge#81
AakashHotchandani wants to merge 1 commit into
browserstack:masterfrom
AakashHotchandani:security/sdk-6064-6065-6066-6073-6077-fixes

Conversation

@AakashHotchandani
Copy link
Copy Markdown
Collaborator

@AakashHotchandani AakashHotchandani commented May 27, 2026

Fork-based PR (replaces #80, which was branch-based) so the workflow can be run from a fork.

Summary

Closes the security-AI-review findings assigned on the SDK Jira board:

Ticket Type Fix
SDK-6064 — F-002 Unpinned GitHub Actions High Pin actions/checkout and actions/setup-node to commit SHAs
SDK-6065 — F-003 Unvalidated commit_sha High 40-hex regex + merge-base --is-ancestor origin/master guard
SDK-6066 — F-006 serialize-javascript RCE High npm overrides force serialize-javascript@^7.0.3 (resolved 7.0.5)
SDK-6073 — C-001 CODEOWNERS gap Critical (chain) .github/*.github/**
SDK-6074 — C-002 commit_sha → RCE Critical (chain) via SDK-6065 chain-breaker
SDK-6075 — C-003 commit_sha → postinstall exfil Critical (chain) via SDK-6065 chain-breaker
SDK-6076 — C-004 unpinned action substitution Critical (chain) via SDK-6064 chain-breaker
SDK-6077 — C-005 proto-pollution → auth hijack High (chain) for..inObject.keys(...).forEach(...)

Changes

  • .github/CODEOWNERS: .github/*.github/** so workflow-file PRs require @browserstack/asi-devs review.
  • .github/workflows/reviewing_changes.yml: SHA-pin actions/checkout (692973e3 v4.1.7) and actions/setup-node (1e60f620 v4.0.3); validate commit_sha is 40-hex and reachable from origin/master before secrets are exposed; add workflow- and job-level permissions: blocks; move BROWSERSTACK_* from job-level to step-level env on only the two test steps; npm installnpm ci; persist-credentials: false.
  • nightwatch.conf.js: for..inObject.keys(...).forEach(...) so prototype-pollution keys can't enter test_settings.
  • package.json / package-lock.json: overrides: { "serialize-javascript": "^7.0.3" }; lockfile regenerated → 7.0.5 (GHSA-5c6j-r48x-rmvq patched).
  • .github/dependabot.yml (new): weekly npm + github-actions updates.

Test plan

  • Dispatch reviewing_changes.yml from this fork with a valid master SHA; confirm the matrix runs green.
  • Dispatch with an invalid commit_sha (e.g. abc or a fork PR ref); confirm it fails at the validation step before secrets are in scope.
  • npm ci succeeds; node -e "require('./nightwatch.conf.js')" exits 0.
  • require('serialize-javascript/package.json').version ≥ 7.0.3.

🤖 Generated with Claude Code

Closes SDK-6064, SDK-6065, SDK-6066, SDK-6073, SDK-6074, SDK-6075,
SDK-6076, SDK-6077.

- .github/CODEOWNERS: change `.github/*` -> `.github/**` so PRs touching
  workflow files require @browserstack/asi-devs review (SDK-6071/SDK-6073).
- .github/workflows/reviewing_changes.yml: pin actions/checkout and
  actions/setup-node to commit SHAs; validate commit_sha against a
  40-char hex pattern and reject any SHA not reachable from origin/master
  before secrets are exposed; add workflow- and job-level permissions
  blocks; move BROWSERSTACK_* secrets from job-level to step-level env on
  only the test steps; switch `npm install` -> `npm ci`; set
  persist-credentials: false on checkout (SDK-6064, SDK-6065, SDK-6074,
  SDK-6075, SDK-6076).
- nightwatch.conf.js: replace for..in over additonalEnvironments.test_settings
  with Object.keys(...).forEach so prototype-pollution keys cannot be
  injected into the Nightwatch config (SDK-6072/SDK-6077).
- package.json: add npm overrides to force serialize-javascript ^7.0.3,
  resolving GHSA-5c6j-r48x-rmvq (RCE via RegExp.flags) transitively via
  nightwatch -> mocha; lockfile regenerated (SDK-6066).
- .github/dependabot.yml: enable weekly npm and github-actions updates so
  future transitive CVEs surface as PRs (F-010 amplifier).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AakashHotchandani AakashHotchandani requested a review from a team as a code owner May 27, 2026 06:47
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