Fix failing Trivy (Go SDK) check: bump x/text + split scan from gate#371
Conversation
Sensitive Change Detection (shadow mode)This PR modifies control-plane files:
|
Fixes CVE-2026-56852: infinite loop in norm.Iter on invalid UTF-8 (severity UNKNOWN, fixed in v0.39.0). Indirect dependency; sibling golang.org/x/* modules bump alongside via go mod tidy.
There was a problem hiding this comment.
Pull request overview
This PR fixes a newly surfaced Trivy finding in the Go SDK by updating the affected indirect Go dependency, and adjusts the Security workflow so Trivy results remain visible in GitHub code scanning (SARIF) while enforcement is applied separately using a severity-gated scan.
Changes:
- Bump
golang.org/x/text(and related indirectgolang.org/x/*modules via tidy) to versions that address the reported CVE. - Split each Trivy job into (1) full-severity SARIF scan + (2) SARIF upload + (3) a separate HIGH/CRITICAL “gate” scan that can fail the job.
- Apply the same scan+gate structure consistently across Go, TypeScript, and Ruby Trivy jobs.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| go/go.mod | Updates indirect golang.org/x/* module versions, including x/text to address the Trivy finding. |
| go/go.sum | Records the new resolved module versions and checksums from the dependency update. |
| .github/workflows/security.yml | Restructures Trivy jobs into SARIF scan + upload + HIGH/CRITICAL gate to align enforcement with the intended severity policy while preserving full visibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
trivy-action in SARIF mode ignores the severity input unless limit-severities-for-sarif is set, so exit-code: 1 was gating on any fixable finding of any severity — not the declared HIGH/CRITICAL policy. That's what turned the Trivy (Go SDK) check red when severity-UNKNOWN CVE-2026-56852 entered the DB on 2026-07-15. Each Trivy job now runs two steps: 1. SARIF scan with no exit code — all severities stay visible in the Security tab. 2. Table-format gate with severity: HIGH,CRITICAL and exit-code: 1 — table mode passes the severity filter through, so the gate matches the declared policy. Reuses the first step's trivy install and DB (skip-setup-trivy, TRIVY_SKIP_DB_UPDATE, cache disabled). The gate no longer fails on LOW/MEDIUM findings (including secret rules); those remain visible in SARIF, and Gitleaks remains the primary repo-wide secret gate.
* origin/main: Split Trivy jobs into full-severity SARIF scan + HIGH/CRITICAL gate Bump golang.org/x/text to v0.39.0
* origin/oauth-discovery-transition: Split Trivy jobs into full-severity SARIF scan + HIGH/CRITICAL gate Bump golang.org/x/text to v0.39.0
What happened
The `Trivy (Go SDK)` check went red on #369/#370 on 2026-07-15 (main last passed 2026-07-14). This was not a trivy 0.69.1 vs 0.70.0 scanner/DB discrepancy, and not a HIGH/CRITICAL advisory:
Changes
Commit 1 — bump `golang.org/x/text` to v0.39.0 (`go/go.mod`, `go/go.sum`). Sibling indirect x/* modules bump alongside via `go mod tidy`. Fixes today's finding at the root.
Commit 2 — restructure all 3 Trivy jobs into scan + gate:
Policy change (deliberate narrowing): the gate now enforces HIGH/CRITICAL severity for both vulnerability and secret findings. Previously, SARIF mode's severity-filter bypass meant the job failed on any severity — including LOW/MEDIUM secret rules (Stripe publishable keys, Slack webhooks, Twilio keys). LOW/MEDIUM findings remain visible in SARIF but no longer fail the Trivy job; Gitleaks remains the primary repo-wide secret gate.
Verification
Rollout to the OAuth stack
A bare rerun of #370 does not pick up this fix. After merge:
Summary by cubic
Fixes the failing
Trivy (Go SDK)check by upgradinggolang.org/x/textto v0.39.0 and separatingTrivyscans from the enforcement gate. The gate now enforces only HIGH and CRITICAL while keeping full SARIF results visible.Bug Fixes
Trivyjobs (Go, TypeScript, Ruby) into a full-severity SARIF scan (no exit) and a table-format gate withseverity: HIGH,CRITICALandexit-code: '1'(reuses DB viaTRIVY_SKIP_DB_UPDATE,skip-setup-trivy,cache: 'false').Dependencies
golang.org/x/textto v0.39.0 to address CVE-2026-56852; indirectgolang.org/x/*modules updated viago mod tidy.Written for commit 28023b3. Summary will update on new commits.