vulncheck workflow: the filed issue loses the head of the report, so findings stay hidden #886

Closed
opened 2026-10-12 20:23:24 +00:00 by Cordy · 2 comments
Owner

Found on 2026-10-12 while fixing #875 and #884.

What happens

.forgejo/workflows/vulncheck.yml cuts the govulncheck output twice:

  • line 58 keeps only tail -60 /tmp/vuln.txt for the report;
  • line 76 keeps only the last 6000 characters of that report (read()[-6000:]) for the issue body.

govulncheck prints its vulnerabilities in order, so long trace lists push the early ones out. #875 showed 13 standard-library findings, but 4 reachable golang.org/x/net findings (e.g. GO-2026-6603) were cut away. They only showed up when the scan ran again after the Go fix, which filed #884.

The dedupe check also seems to miss existing issues: #884 was filed while #875 was still open, despite the "an open govulncheck issue already exists" check. #875 had already been closed by the PR merge a few minutes before, so this may be correct behaviour. Check it when fixing.

Fix ideas

  • Put a summary first: one line per vulnerability (ID, module, found in, fixed in). Use govulncheck -format json or parse the Vulnerability #N: blocks. Put the shortened traces after it.
  • Never cut the summary. Shorten only the traces, and note "N more trace lines omitted".
  • Attach the full output as a workflow artifact, or link the run, so nothing is lost.
  • Name the exact fix in the body: go@patch for the standard library, and the module bumps (golang.org/x/net@v0.60.0).

Low priority. Main is clean as of v0.6.334.

Found on 2026-10-12 while fixing #875 and #884. ## What happens `.forgejo/workflows/vulncheck.yml` cuts the govulncheck output twice: - line 58 keeps only `tail -60 /tmp/vuln.txt` for the report; - line 76 keeps only the last 6000 characters of that report (`read()[-6000:]`) for the issue body. govulncheck prints its vulnerabilities in order, so long trace lists push the early ones out. #875 showed 13 standard-library findings, but 4 reachable `golang.org/x/net` findings (e.g. GO-2026-6603) were cut away. They only showed up when the scan ran again after the Go fix, which filed #884. The dedupe check also seems to miss existing issues: #884 was filed while #875 was still open, despite the "an open govulncheck issue already exists" check. #875 had already been closed by the PR merge a few minutes before, so this may be correct behaviour. Check it when fixing. ## Fix ideas - Put a **summary first**: one line per vulnerability (ID, module, found in, fixed in). Use `govulncheck -format json` or parse the `Vulnerability #N:` blocks. Put the shortened traces after it. - Never cut the summary. Shorten only the traces, and note "N more trace lines omitted". - Attach the full output as a workflow artifact, or link the run, so nothing is lost. - Name the exact fix in the body: `go@patch` for the standard library, and the module bumps (`golang.org/x/net@v0.60.0`). Low priority. Main is clean as of v0.6.334.
Author
Owner

Correction to the dedupe note above: #875 was closed at 19:19 UTC by the PR #883 merge, and #884 was filed at 19:25 UTC. The dedupe check worked correctly; only the truncation is a real problem.

Correction to the dedupe note above: #875 was closed at 19:19 UTC by the PR #883 merge, and #884 was filed at 19:25 UTC. The dedupe check worked correctly; only the truncation is a real problem.
Author
Owner

Shipped in v0.6.338 (PR #894).

  • New internal/tools/vulnsummary reads govulncheck -format json. It counts a vulnerability as reachable when a finding's trace[0].function is set, the same rule as text mode. Its report has three parts, in this order:
    1. Summary: one row per reachable vulnerability (ID, module, found and fixed versions). Never cut.
    2. Fix: exact go get go@… and go get <module>@… lines, using the highest fixed version per module.
    3. Traces: up to 3 per vulnerability, then "N more omitted".
  • The tool exits 0 when clean, 3 when something is reachable, and 1 on empty or invalid input.
  • The workflow builds the tool rather than go run-ing it, because go run turned exit 3 into 1 (caught in review).
  • The issue body is cut only inside the traces, at 60,000 characters, and links the run, whose log has everything.
  • New: if govulncheck itself fails, the workflow files a deduplicated issue, "govulncheck: the weekly scan could not run".
  • The dedupe check is unchanged; it was correct (see the comment above).

Live: I dispatched it on main (e3b6ffb1) and it ran against real govulncheck output: "No reachable vulnerabilities", job succeeded, no issue filed.

**Shipped in v0.6.338** (PR #894). - New `internal/tools/vulnsummary` reads `govulncheck -format json`. It counts a vulnerability as reachable when a finding's `trace[0].function` is set, the same rule as text mode. Its report has three parts, in this order: 1. **Summary:** one row per reachable vulnerability (ID, module, found and fixed versions). Never cut. 2. **Fix:** exact `go get go@…` and `go get <module>@…` lines, using the highest fixed version per module. 3. **Traces:** up to 3 per vulnerability, then "N more omitted". - The tool exits 0 when clean, 3 when something is reachable, and 1 on empty or invalid input. - The workflow builds the tool rather than `go run`-ing it, because `go run` turned exit 3 into 1 (caught in review). - The issue body is cut only inside the traces, at 60,000 characters, and links the run, whose log has everything. - New: if govulncheck itself fails, the workflow files a deduplicated issue, "govulncheck: the weekly scan could not run". - The dedupe check is unchanged; it was correct (see the comment above). **Live:** I dispatched it on main (e3b6ffb1) and it ran against real govulncheck output: "No reachable vulnerabilities", job succeeded, no issue filed.
Cordy closed this issue 2026-10-13 20:56:57 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#886
No description provided.