Skip to content

Commit db3cdb7

Browse files
jhrozekclaude
andauthored
Add vulnerability exclusion support to govulncheck workflow (#2972)
Add a post-processing step to the govulncheck GitHub Action that allows excluding specific vulnerabilities with documented justification. The govulncheck tool does not currently support excluding vulnerabilities via config file or flag. This feature is tracked in golang/go#61211. Until that is implemented, we use a post-processing approach similar to GitLab's Gitaly project. Use JSON output format since it returns success even when vulnerabilities are found, allowing the exclusion check step to run. Exclude GO-2025-4192 (CVE-2025-66564): sigstore/timestamp-authority excessive memory allocation vulnerability. This is an indirect dependency via sigstore-go used for container signature verification. The vulnerability affects timestamp-authority server request parsing, but ToolHive only uses sigstore-go as a client - it does not expose any timestamp-authority server endpoints. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent 79edd58 commit db3cdb7

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/security-scan.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,50 @@ jobs:
7272
go-version-file: go.mod
7373
go-package: ./...
7474
repo-checkout: false
75+
output-format: json
76+
output-file: govulncheck-output.json
77+
78+
- name: Check for vulnerabilities (with exclusions)
79+
run: |
80+
# Ignored vulnerabilities with justification:
81+
# GO-2025-4192: sigstore/timestamp-authority excessive memory allocation (CVE-2025-66564)
82+
# Indirect dependency via sigstore-go (used for container signature verification).
83+
# The vulnerability affects timestamp-authority server request parsing endpoints.
84+
# ToolHive only uses sigstore-go as a client to verify signatures, it does not
85+
# expose any timestamp-authority server endpoints. Fix requires sigstore-go to
86+
# upgrade to timestamp-authority/v2 which hasn't been released yet.
87+
IGNORED_VULNS="GO-2025-4192"
88+
89+
# Show the raw output for debugging
90+
echo "::group::govulncheck raw output"
91+
cat govulncheck-output.json
92+
echo "::endgroup::"
93+
94+
# Extract vulnerability IDs that have actual findings (called symbols)
95+
# The JSON has "finding" objects with "osv" field only for vulnerabilities
96+
# where vulnerable code paths are actually called
97+
FOUND_VULNS=$(jq -r 'select(.finding != null) | .finding.osv' govulncheck-output.json | sort -u | grep -E '^GO-' || true)
98+
99+
if [ -z "$FOUND_VULNS" ]; then
100+
echo "✅ No vulnerabilities found"
101+
exit 0
102+
fi
103+
104+
echo "Found vulnerabilities: $FOUND_VULNS"
105+
106+
# Check if all found vulnerabilities are in the ignore list
107+
UNIGNORED=""
108+
for vuln in $FOUND_VULNS; do
109+
if ! echo "$IGNORED_VULNS" | grep -qw "$vuln"; then
110+
UNIGNORED="$UNIGNORED $vuln"
111+
fi
112+
done
113+
UNIGNORED=$(echo "$UNIGNORED" | xargs)
114+
115+
if [ -z "$UNIGNORED" ]; then
116+
echo "⚠️ All vulnerabilities are ignored: $FOUND_VULNS"
117+
exit 0
118+
fi
119+
120+
echo "❌ Vulnerabilities need attention: $UNIGNORED"
121+
exit 1

0 commit comments

Comments
 (0)