fix: [CI-21185]: Upgrade Go to 1.25.7 and run as non-root user#51
Merged
spahuja-harness merged 1 commit intomainfrom Mar 4, 2026
Merged
fix: [CI-21185]: Upgrade Go to 1.25.7 and run as non-root user#51spahuja-harness merged 1 commit intomainfrom
spahuja-harness merged 1 commit intomainfrom
Conversation
Security fixes: 1. Upgrade Go from 1.25 to 1.25.7 to fix critical CVEs: - CVE-2025-68121 (critical, CVSS 10.0) - crypto/tls session resumption issue - CVE-2025-61726 (high, CVSS 7.5) - net/url query parameter limit - CVE-2025-61730 (medium, CVSS 5.3) - crypto/tls handshake boundary issue 2. Run container as non-root user (uid:gid 65534:65534): - Added USER directive to run as nobody:nobody - Copied /etc/passwd for user resolution - Prevents privilege escalation and improves container security Changes: - Updated base image: golang:1.25-alpine3.21 → golang:1.25.7 - Changed from apk (alpine) to apt-get (debian) for Go 1.25.7 image - Added non-root user configuration in final scratch image Tested: - Binary builds successfully - --version flag works: returns build version - Non-root user (65534:65534) enforced - Permission restrictions validated
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.
Summary
Fixes critical security vulnerabilities by upgrading Go version and implementing non-root user execution.
Security Fixes
1. Go Version Upgrade: 1.25 → 1.25.7
Addresses three CVEs:
2. Non-Root User Implementation
nobody:nobody(uid:gid 65534:65534)/etc/passwdfor proper user resolutionChanges
Dockerfile Updates:
golang:1.25-alpine3.21→golang:1.25.7apk→apt-get(Go 1.25.7 uses Debian base)USER 65534:65534directiveCOPY --from=builder /etc/passwd /etc/passwdTesting
✅ Build validation:
✅ Version check:
docker run plugin-test:latest /binaries/plugin --version # Output: test-1.0.0 (build version embedded via ldflags)✅ User validation:
✅ Permission validation:
Related
release/*for Harness CI PATCH releases