Skip to content

security: resolve Sonar SECURITY-category issues#20

Merged
dfa1 merged 2 commits into
mainfrom
security/sonar-security-issues
Jun 26, 2026
Merged

security: resolve Sonar SECURITY-category issues#20
dfa1 merged 2 commits into
mainfrom
security/sonar-security-issues

Conversation

@dfa1

@dfa1 dfa1 commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Clears the SECURITY-impact findings on the Sonar security view.

S7637 — unpinned GitHub Action (×3, MAJOR vulnerability)

Pin the third-party mlugg/setup-zig@v2 to a full commit SHA (d1434d0…, kept readable with a # v2 comment) in ci.yml, sonar.yml, publish.yml. A moved/compromised tag can no longer swap the action mid-build. The first-party actions/* uses aren't flagged by the rule.

S5443 — temp dir in a publicly-writable location (CRITICAL vulnerability)

Real fix (not a suppression): NativeLibrary now creates the extraction directory with an explicit owner-only POSIX permission attribute (rwx------) set atomically at creation — the rule's compliant pattern — instead of relying on the default. On non-POSIX file systems it falls back to no attribute (the Windows temp directory is already per-user, and the POSIX attribute is unsupported there). This closes the swap/symlink window for the bundled libzstd between extraction and dlopen.

Test

./mvnw -pl zstd -am test — green; native library loads via the hardened path. checkstyle + IntelliJ clean.

🤖 Generated with Claude Code

dfa1 and others added 2 commits June 26, 2026 22:11
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 <noreply@anthropic.com>
Properly fix S5443 instead of suppressing it: create the extraction
directory with an explicit owner-only (rwx------) POSIX permission
attribute at creation time, the rule's compliant pattern. Falls back to
no attribute on non-POSIX file systems, where the temp directory is
already per-user. Revert the earlier pom-level suppression.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 merged commit c9929b9 into main Jun 26, 2026
1 check passed
@dfa1 dfa1 deleted the security/sonar-security-issues branch June 26, 2026 20:16
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.

1 participant