Skip to content

Commit f335401

Browse files
fix(security): harden CI workflow and disable Maven auto-release [APS-19020]
CI / release supply-chain hardening: - .github/workflows/ci.yml: * pin actions/checkout from @v2 to commit SHA 34e114876b0b11c390a56381ad16ebd13914f8d5 (v4.3.1) * pin actions/setup-java from @V3 to commit SHA c1e323688fd81a25caa38c78aa6df2d33d3e20d9 (v4.8.0) * add top-level `permissions: contents: read` block (mirrors the pattern already used in .github/workflows/Semgrep.yml in this repo). Token-scope minimization for the workflow. - pom.xml: nexus-staging-maven-plugin's <autoReleaseAfterClose> flipped true -> false. After mvn release:perform, the staged release on OSSRH must now be promoted manually. The release runbook will be updated separately. - CHANGELOG.md: new file with an Unreleased section summarizing all three security fixes (APS-19018, APS-19019, APS-19020) and calling out the setProxy behaviour change for consumers. Resolves: APS-19020
1 parent ba24f7b commit f335401

3 files changed

Lines changed: 46 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ on:
88
branches:
99
- master
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
build:
1316
runs-on: ubuntu-latest
1417

1518
steps:
16-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1720
- name: Set up JDK 8
18-
uses: actions/setup-java@v3
21+
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
1922
with:
2023
java-version: 8
2124
distribution: 'temurin'

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [Unreleased]
6+
7+
### Security
8+
9+
- **SSRF guard on `AutomateClient.getSessionLogs`** — the URL returned by the
10+
BrowserStack API is now validated before being fetched. Only `https` URLs whose
11+
host (parsed via `java.net.URI`) ends in `.browserstack.com` are accepted; all
12+
other URLs throw `AutomateException`. This prevents a maliciously-crafted
13+
session record from causing the client to issue requests against an attacker
14+
endpoint. (APS-19018)
15+
16+
- **`setProxy` is now per-instance** — previously, calling
17+
`BrowserStackClient.setProxy(...)` mutated a JVM-wide `static HTTP_TRANSPORT`
18+
field, so a proxy configured on one client instance leaked to every other
19+
instance running in the same JVM (and a non-proxied client could end up using
20+
another tenant's proxy). The transport is now an instance field. **Anyone
21+
whose code relied on cross-instance proxy state must now call `setProxy` on
22+
each `BrowserStackClient` / `AutomateClient` they construct.** (APS-19019)
23+
24+
- **`checkAuthState` now throws when EITHER credential is missing** — previously
25+
the guard only fired when both `username` and `accessKey` were `null`,
26+
meaning a client with one credential set and one missing would proceed and
27+
produce a malformed `Authorization: Basic` header. The condition is now
28+
`username == null || accessKey == null`. (APS-19019)
29+
30+
### CI / Release
31+
32+
- **GitHub Actions hardening**`.github/workflows/ci.yml` actions are now
33+
pinned to commit SHAs (`actions/checkout@v4.3.1`,
34+
`actions/setup-java@v4.8.0`) and a top-level `permissions: contents: read`
35+
block has been added. (APS-19020)
36+
37+
- **Maven release auto-promote disabled**`nexus-staging-maven-plugin`'s
38+
`autoReleaseAfterClose` is now `false`. Staged releases must be manually
39+
promoted via OSSRH after a `mvn release:perform`. See the BrowserStack
40+
internal release runbook for the manual promotion step. (APS-19020)

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<configuration>
9090
<serverId>ossrh</serverId>
9191
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
92-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
92+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
9393
</configuration>
9494
</plugin>
9595
<plugin>

0 commit comments

Comments
 (0)