Commit 8ade0a3
fix(security): bundle for APS-19076 / APS-19077 / APS-19078
- APS-19076 (CVSS 9.3, env-var injection): allowlist env-var names
exported from the BrowserStack rerun API in setBStackRerunEnvVars.
Adds ALLOWED_RERUN_ENV_VARS (BROWSERSTACK_RERUN, BROWSERSTACK_RERUN_TESTS,
BROWSERSTACK_BUILD_NAME) to setup-env/config/constants.js; filtered
loop in setup-env/src/actionInput/index.js calls core.exportVariable
only for allowlisted keys and core.warning for everything else.
Updates existing test, adds negative-case test, rebuilds dist.
- APS-19077 (CVSS 8.7, supply chain + token scope): pins
actions/setup-node@v4.4.0 and actions/checkout@v4.2.2 by SHA in both
.github/workflows/setup-env.yml and setup-local.yml; adds top-level
permissions: { contents: read } block to give the GITHUB_TOKEN least
privilege (these workflows only run unit tests).
- APS-19078 (CVSS 7.6, stored XSS via report HTML): adds sanitize-html
to browserstack-report-action; sanitizes basicHtml/richHtml in
ReportProcessor.js with a strict allowlist (no inline event handlers,
no javascript: URLs); strips JS hooks from richCss with sanitizeCss();
injects CSP meta (script-src 'none'; default-src 'none') into the
artifact HTML head in UploadFileForArtifact.js as defense-in-depth;
rebuilds dist.
Tests: setup-env 37 passing (was 36, +1 negative-case); report-action
18 passing (no regression). Standalone XSS-strip sanity covers six
payloads including <img src=x onerror=alert(1)>, <script>, javascript:
URLs, <svg onload>, <iframe javascript:>; all stripped, safe HTML
preserved.
Resolves: APS-19076, APS-19077, APS-19078
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d6cb8ba commit 8ade0a3
11 files changed
Lines changed: 23411 additions & 6131 deletions
File tree
- .github/workflows
- browserstack-report-action
- dist
- src
- services
- utils
- setup-env
- config
- dist
- src/actionInput
- test/actionInput
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
20 | | - | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | | - | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
20 | | - | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | | - | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
0 commit comments