From 610b00353541ade9202ab315c882c738630f61c1 Mon Sep 17 00:00:00 2001 From: Davide Angelocola Date: Fri, 26 Jun 2026 22:11:53 +0200 Subject: [PATCH 1/2] security: pin setup-zig to a commit SHA; mark temp-dir vuln reviewed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolve the SECURITY-category Sonar findings: - S7637: pin the third-party mlugg/setup-zig action to a full commit SHA (d1434d0, v2) in ci/sonar/publish workflows, so a moved tag can't swap the action under us. The first-party actions/* are not flagged. - S5443: NativeLibrary extracts the bundled library into an owner-only directory (Files.createTempDirectory, 0700 on POSIX) — the rule's warning is already mitigated with no further code change available, so suppress it for that file via sonar.issue.ignore with a documented why. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/sonar.yml | 2 +- pom.xml | 8 ++++++++ zstd/src/main/java/io/github/dfa1/zstd/ZstdFrame.java | 4 ++-- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 929e145..d9c2be9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: cache: maven - name: Set up Zig - uses: mlugg/setup-zig@v2 + uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2 with: version: 0.16.0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4ba160f..9c60b1c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,7 +31,7 @@ jobs: gpg-passphrase: GPG_PASSPHRASE - name: Set up Zig - uses: mlugg/setup-zig@v2 + uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2 with: version: 0.16.0 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 3a84c41..2b00bd7 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -28,7 +28,7 @@ jobs: cache: maven - name: Set up Zig - uses: mlugg/setup-zig@v2 + uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2 with: version: 0.16.0 diff --git a/pom.xml b/pom.xml index 93b8b69..a2308be 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,14 @@ https://sonarcloud.io dfa11 dfa1_zstd-java + + tempdir + java:S5443 + **/NativeLibrary.java - tempdir - java:S5443 - **/NativeLibrary.java