Skip to content

fix(ci): bump the pinned GitHub CLI for CVE-2026-78661 #3881

Closed

Description

@dan-petty

Problem

The checks Runner Image and Service Image of the CI Quality Gate fail on a pull request that changes no image. The step Scan Runner Image for Vulnerabilities and the step Scan Service Image for Vulnerabilities both report one finding with severity HIGH:

usr/local/bin/gh (gobinary)
golang.org/x/net  CVE-2026-78661  HIGH  fixed  installed v0.60.0  fixed in 0.62.0

The Dockerfile pins GitHub CLI v2.102.1 (Dockerfile lines 24 to 28). Release v2.103.3 of cli/cli is available (published 2026-10-26). I have not checked that it holds golang.org/x/net 0.62.0 or newer.

Expected

Both image scans pass on a pull request that changes no image. No release of GitHub CLI has the fix yet, so a time-limited ignore carries the scans until the bump.

Delivered by this item

  • A time-limited .trivyignore entry, CVE-2026-78661 exp:2026-11-21, with its reason and a link to the tracking. The owner allowed it on 2026-11-07. It ends by itself on 2026-11-21.
  • An invariant test that fails when an entry of .trivyignore has no reason, has no exp date, or has an exp date that is past.
  • Runner Image and Service Image pass on a pull request that changes no image, with the entry.

Moved to #3920

  • The pinned GitHub CLI release holds golang.org/x/net at 0.62.0 or newer, shown by the Trivy scan of the image.
  • The entry for CVE-2026-78661 is removed from .trivyignore.

Existing tool considered

Trivy already finds the problem, and a new release of GitHub CLI fixes it. The change adds no tool. Renovate or the existing pin update path may cover the bump.

Related

Seen on the pull request for #3651. The bump of the pin moved to #3920.

Proposed design

Problem statement

The CI Quality Gate fails Runner Image and Service Image on pull requests that change no image input. The scan reports CVE-2026-78661 in golang.org/x/net v0.60.0, which the pinned GitHub CLI v2.102.1 vendors. No released cli/cli version holds the fix yet. This item adds the time-limited .trivyignore entry that the owner allowed on 2026-11-07, with its reason and tracking link, and an invariant test that keeps every entry honest. Both image scans then pass on a pull request that changes no image. The pin bump waits in #3920.

Acceptance criteria

Requirement: Time-limited ignore for CVE-2026-78661

.trivyignore SHALL hold one entry for CVE-2026-78661 with the expiry exp:2026-11-21, a reason and a link to the tracking issue #3920.

Scenario: The entry carries a reason and an expiry

Requirement: Every ignore entry is explained and time-limited

The invariant test SHALL fail when a non-comment line of .trivyignore has no comment above it, no exp: token, or an exp: date before today.

Scenario: A bad entry fails the test

  • WHEN the helper reads a .trivyignore text whose entry has no comment above it, no exp: token, or an exp: date in the past
  • THEN the helper returns one problem for that entry and the test fails with a message that names the line

Requirement: The existing regression test still passes

The change MUST NOT add CVE-2026-78661 to GH_GO_FINDINGS_FIXED_IN_THE_PIN.

Scenario: The new entry stays outside the fixed-findings set

  • WHEN the test test_trivyignore_ignores_no_go_finding_that_the_pinned_gh_fixes runs
  • THEN it passes, because the set holds only CVE-2026-78667, CVE-2026-97031 and CVE-2026-78669

Requirement: The gh pin stays for the bump issue

The change MUST NOT move the GitHub CLI pin in the Dockerfile or the value of GH_VERSION.

Scenario: The pin and the constant keep their version

  • WHEN the tests read the release tag of the Dockerfile and the value of GH_VERSION
  • THEN the tag is v2.102.1 and GH_VERSION is "2.102.1"

Requirement: Image scans pass on an unchanged image input

The Runner Image and Service Image checks SHALL pass on a pull request that changes no image input.

Scenario: Both scans pass with the entry

  • WHEN a pull request that changes src/ but not the Dockerfile runs the CI Quality Gate
  • THEN Runner Image and Service Image pass and neither scan reports CVE-2026-78661

Existing Tool Considered

No alternatives check has run on this item. Trivy (aquasecurity/trivy) is the open, maintained tool that covers both needs: its scan steps find CVE-2026-78661, and its own .trivyignore format holds the time-limited entry with an exp: date and a reason. It lacks a remediation path: it reports the vendored golang.org/x/net version but cannot rebuild or replace the gh binary, so the fix is the upstream cli/cli release that #3920 pins. It also does not report an ignore that matches no finding, so the invariant test holds that. The change adds no tool and builds no code, so it takes no build-and-keep cost. A custom cli/cli build would add a Go build to build, keep and fix until it matches the upstream tool.

Key questions

  • Which mechanism handles CVE-2026-78661 until a cli/cli release carries the fix?: A time-limited .trivyignore entry with a reason and an expiry. The owner allowed the entry on 2026-11-07, so it reads CVE-2026-78661 exp:2026-11-21 and ends by itself on that date. The bump in fix(ci): bump the pinned gh and drop the CVE-2026-78661 ignore #3920 then removes it. (best practice) [sources: CONTEXT.md, docs/adr/0005-review-findings-come-from-tools-not-models.md, openspec/changes/archive/2026-10-28-1492-drop-gh-go-trivy-ignores/proposal.md]
    • Chosen: Time-limited .trivyignore entry. It is the project's own suppression form: a rule with a reason and an expiry. It needs no code, it ends by itself, and the owner allowed it.
    • Rejected: Lower the Trivy severity threshold. It hides every HIGH finding, not one finding, and it weakens the gate that ADR 0004 makes authoritative.
    • Rejected: Remove the gh binary from both images. The Job needs gh at run time: it marks a pull request ready, reads check runs, and git reads its token through gh auth git-credential. That refactor is a large change of its own.
    • Rejected: Build a custom gh binary. It adds a Go build to build, keep and fix until it matches the upstream tool, in place of an open, maintained release.
  • Does a new .trivyignore entry for CVE-2026-78661 break the existing regression test?: No. GH_GO_FINDINGS_FIXED_IN_THE_PIN holds only CVE-2026-78667, CVE-2026-97031 and CVE-2026-78669, and the test fails only when an entry names one of those three. [sources: tests/invariants/test_service_image.py]
  • Which file holds the suppressions, and how does the current test read it?: .trivyignore at the repository root. The test reads REPO_ROOT / ".trivyignore", skips each line that starts with #, and takes the first token of every other line as the finding ID. [sources: tests/invariants/test_service_image.py, .github/workflows/ci.yml]
  • Where does the new invariant test live?: In tests/invariants/test_service_image.py, beside the test that already reads .trivyignore. (best practice) [sources: tests/invariants/test_service_image.py]
    • Chosen: Extend tests/invariants/test_service_image.py. The module already reads .trivyignore and holds the gh pin invariants, so one module keeps the image invariants together.
    • Rejected: Add tests/invariants/test_trivyignore.py. It repeats the file read and splits one file's invariants across two modules, with no gain.
  • How does the test check the reason and the expiry of an entry?: It requires a comment block directly above each entry, and it reads the exp: token of the entry line. It fails when the block is empty, the token is absent, or the date is before today. (best practice) [sources: tests/invariants/test_service_image.py, CONTEXT.md]
    • Chosen: Comment block above the entry, plus the exp: token on the entry line. The test takes the first token of a non-comment line as the finding ID, so the reason must sit in a comment. Trivy keeps the same split.
    • Rejected: Put the reason on the entry line. The reason text would join the ID expression and the test and Trivy would read the wrong ID.
    • Rejected: Keep the reasons in a separate manifest file. It adds a second source of truth that the scan does not read, so the two can drift.
  • Does this item move the gh pin?: No. The pin bump moved to fix(ci): bump the pinned gh and drop the CVE-2026-78661 ignore #3920. This item keeps the Dockerfile tag and GH_VERSION at v2.102.1, and it adds only the time-limited entry and its test. [sources: src/devops_cli/roadmap/runner_tools.py:44, tests/invariants/test_service_image.py:25]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/ci
    status/new
    value/high
    effort/low
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/ci. The (ci) scope of the title gives the scope.
    • Priority: P1-High. A HIGH CVE blocks CI image scans and prevents merges on any pull request.
    • Value: High. Unblocks all CI image checks and removes a known HIGH vulnerability from the shipped image.
    • Effort: Low. Change one version string in the Dockerfile and confirm the Trivy scan passes.
    • Related: fix(docker): the service image installs gh 2.102.1, whose Go toolchain fixes the HIGH crypto/x509 advisory Trivy fails the release on #1800, which asks for a different change. Both bump the gh CLI pin in the Dockerfile to clear a Trivy HIGH finding, but #1800 targets CVE-2026-111943 (crypto/x509) while the candidate targets CVE-2026-78661 (golang.org/x/net).
  3. added
    priority/p1-high
    on Nov 7, 2026
  4. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    The checks Runner Image and Service Image of pull request #3883 fail on the same finding: the scan of the image reports CVE-2026-78661 in golang.org/x/net v0.60.0 (fixed in 0.62.0). That pull request changes no image input. It stays a draft until these two checks pass.

  5. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Pull request #3889 hits the same failure: the Runner Image and Service Image scans (job "Scan ... Image for Vulnerabilities") fail with golang.org/x/net v0.60.0, CVE-2026-78661 (HIGH, fixed in 0.62.0). The pull request changes no image input.

  6. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    PR #3891 (a change to a ConfigMap template only) fails the checks Service Image and Runner Image with this CVE: Trivy reports golang.org/x/net v0.60.0 in usr/local/bin/gh (fixed in 0.62.0), HIGH. The failure does not come from that PR. It stays a draft until this issue is fixed.

  7. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    The premise of this item does not hold today (2026-11-07). No release of GitHub CLI holds golang.org/x/net 0.62.0 or newer, so a bump of the pin cannot fix CVE-2026-78661. I wrote no code.

    Evidence, read with devops gh api repos/cli/cli/contents/go.mod?ref=<ref>:

    • v2.103.3 (newest release, published 2026-10-26): toolchain go1.27.3, golang.org/x/net v0.60.0.
    • trunk (unreleased): toolchain go1.27.3, golang.org/x/net v0.61.0. This is also below 0.62.0.
    • v2.102.1 (the current pin): golang.org/x/net v0.60.0.
    • The release list (repos/cli/cli/releases) has no release after v2.103.3.

    So the scan finding stays on every released gh binary. The fix needs a cli/cli release that moves x/net to 0.62.0 or newer. A suppression in .trivyignore is not allowed. A custom gh build would add a tool to build and keep, against the rule to use an open tool first.

    The item returns to New. Retry when cli/cli publishes a release with x/net 0.62.0 or newer (check go.mod at the tag). Then change Dockerfile (version, both checksums, the path in the install step) and GH_VERSION in src/devops_cli/roadmap/runner_tools.py.

  8. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 163a5c2 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • GitHub CLI (cli/cli) must publish a release whose go.mod requires golang.org/x/net 0.62.0 or newer; the report on the issue of 2026-11-07 shows the newest release v2.103.3 still at 0.60.0 and trunk at 0.61.0.
  9. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Pull request #3900 (a change of Python dependencies, not of the gh pin) also fails Runner Image and Service Image with the same finding: usr/local/bin/gh (gobinary), golang.org/x/net CVE-2026-78661, HIGH, installed v0.60.0, fixed in 0.62.0. The new packages ddgs, primp and lxml show 0 findings in the same scan. #3900 stays a draft until this issue is delivered.

  10. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    The re-scope (remove the gh binary from the Service image and the Runner image) does not hold. I wrote no code and made no branch.

    Premise check (rule 2), read from origin/main at 6d105c2. The runner Job and the Service use the gh binary at run time:

    • src/devops_cli/roadmap/implement_pull.py:383 (mark_ready): run_gh([CONST_GH_CLI, "pr", "ready", ...]). implement_run.py:1416 calls it inside the Job.
    • src/devops_cli/github/check_verdict.py:342 and :465: gh api .../commits/<sha>/status and gh pr checks. implement_run.py:1387, stage_ready.py and plan_check.py read check runs through them.
    • src/devops_cli/github/pr_monitor.py, merge_readiness.py, branch_update.py, issues.py and client.py build gh argv from CONST_GH_CLI.
    • Dockerfile:76-77 and :122-123: git reads its token through gh auth git-credential in both images. ADR 0015 says the same: "git gets it through gh auth git-credential".
    • src/devops_cli/roadmap/runner_tools.py:123 lists gh as a tool of the job.

    If the binary goes, the Job cannot mark a pull request ready, read checks, or run git fetch and git push over HTTPS. A change that moves all of these to REST calls (gidgethub, ADR 0006) and to another git credential helper is a refactor of its own. Nobody named it, so I do not start it here.

    Still true: no released cli/cli version fixes the finding (see the comment of 2026-11-07 02:13Z). A .trivyignore entry, a lowered threshold and a custom gh build are not allowed.

    The owner must decide one of these:

    1. Allow a time-limited .trivyignore entry for CVE-2026-78661 with an expiry date, until cli/cli publishes a release with golang.org/x/net 0.62.0 or newer. This is the project's own mechanism and unblocks feat(k8s): Name one chat model for every slot of the Service #3891 and feat(ai): web search falls back to DuckDuckGo #3900 at once. I recommend this.
    2. Approve a refactor that removes the gh binary from the Job and the Service (REST for every gh call, another git credential helper). This is a large change.

    The item stays in New. The pull requests #3891 and #3900 stay drafts and wait for this decision.

  11. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    PR #3897 (a refactor with no dependency change) fails the Runner Image and Service Image scans on this CVE: golang.org/x/net v0.60.0 in the pinned GitHub CLI, fixed in 0.62.0. The cause is outside that PR.

  12. added
    owner/agent
    on Nov 7, 2026
  13. added
    status/ready
    and removed
    status/new
    on Nov 7, 2026
  14. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at b6af763 (see proposed design in issue body).

  15. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    The checks Runner Image and Service Image fail on draft pull request #3922 (issue #3646) with this finding: Trivy reports CVE-2026-78661 in golang.org/x/net v0.60.0, which the pinned GitHub CLI binary holds (fixed in 0.62.0). The change of #3922 touches no image file. Both checks are not required checks, but devops pr ready refuses a pull request while one of them fails. A pull request that runs these image checks stays draft until the bump of the pinned CLI merges.

  16. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    The checks Service Image and Runner Image of PR #3923 fail on this finding too (Trivy, CVE-2026-78661 in the pinned gh and promtool, fixed in golang.org/x/net 0.62.0). The pull request changes no image input.

  17. added
    status/in-progress
    and removed
    status/ready
    on Nov 7, 2026
  18. removed
    status/in-progress
    owner/agent
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p1-highscope/cisource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions