Security: harden CI workflow, deps, CODEOWNERS, and config merge#81
Open
AakashHotchandani wants to merge 1 commit into
Open
Conversation
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>
rounak610
approved these changes
May 27, 2026
pranay-v29
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
actions/checkoutandactions/setup-nodeto commit SHAscommit_shamerge-base --is-ancestor origin/masterguardoverridesforceserialize-javascript@^7.0.3(resolved 7.0.5).github/*→.github/**for..in→Object.keys(...).forEach(...)Changes
.github/CODEOWNERS:.github/*→.github/**so workflow-file PRs require@browserstack/asi-devsreview..github/workflows/reviewing_changes.yml: SHA-pinactions/checkout(692973e3v4.1.7) andactions/setup-node(1e60f620v4.0.3); validatecommit_shais 40-hex and reachable fromorigin/masterbefore secrets are exposed; add workflow- and job-levelpermissions:blocks; moveBROWSERSTACK_*from job-level to step-level env on only the two test steps;npm install→npm ci;persist-credentials: false.nightwatch.conf.js:for..in→Object.keys(...).forEach(...)so prototype-pollution keys can't entertest_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
reviewing_changes.ymlfrom this fork with a valid master SHA; confirm the matrix runs green.commit_sha(e.g.abcor a fork PR ref); confirm it fails at the validation step before secrets are in scope.npm cisucceeds;node -e "require('./nightwatch.conf.js')"exits 0.require('serialize-javascript/package.json').version≥ 7.0.3.🤖 Generated with Claude Code