Skip to content

Move to Go 1.26.5 and clear reachable dependency vulnerabilities - #394

Open
dpage wants to merge 1 commit into
mainfrom
security-dep-bumps
Open

Move to Go 1.26.5 and clear reachable dependency vulnerabilities#394
dpage wants to merge 1 commit into
mainfrom
security-dep-bumps

Conversation

@dpage

@dpage dpage commented Aug 7, 2026

Copy link
Copy Markdown
Member

Background

Codacy currently reports a large pile of SCA advisories against this
repository, and most of them are noise in the sense that nothing in the
Workbench actually calls the vulnerable code. Rather than bump things on
the strength of the advisory list, I ran govulncheck across all four Go
modules to establish which vulnerabilities are genuinely reachable from
our own call graphs. Four came back, and this change clears all four.

Advisory Component Fixed in Where it is reached
GO-2026-5970 golang.org/x/text v0.33.0 v0.39.0 pgxpool setup in all three services, and server/src/internal/auth/common_passwords.go:105
GO-2026-5856 crypto/tls (ECH privacy leak) go1.26.5 all four modules
GO-2026-5039 net/textproto (unescaped input in errors) go1.26.4 pkg, server, alerter
GO-2026-5037 crypto/x509 (hostname parsing DoS) go1.26.4 all four modules

What changed

The Go version moves to 1.26.5 in the four module files, the three
service Dockerfile builder stages, and the CI and release workflows.

The release workflow is the one that actually mattered: it built the
published binaries with 1.26.2, so the standard library advisories
would have shipped in released artefacts no matter what the module files
said. Codacy was in fact resolving some findings against that pin rather
than against go.mod (affectedVersion: v1.26.2).

Where a workflow repeats the Go version inside an if: guard, the guard
moved along with the matrix value. Bumping only the matrix would have
left those conditions unmatchable and silently stopped the coverage and
publish steps from running, which is a quieter failure than a red build.

golang.org/x/text goes to v0.40.0, the current release, rather than
stopping at the v0.39.0 floor govulncheck reports. go mod tidy also
advanced golang.org/x/sync to v0.22.0 as a resolution side effect.

On the client, ECharts moves to v6.1.0 for a cross-site scripting
advisory, and postcss, js-yaml and brace-expansion are refreshed
transitively via npm audit fix. npm audit now reports no known
vulnerabilities, where it previously reported one moderate and four high.

Verification

  • govulncheck reports zero affected symbols in all four modules,
    down from three, three, four and four respectively. What it still
    lists are golang.org/x/crypto/ssh and ssh/agent advisories that no
    Workbench code calls.
  • All three services build, and pkg, collector and alerter test
    suites pass in full.
  • Client: lint clean (0 errors, 40 pre-existing warnings), production
    build succeeds, and 3,488 tests across 171 files pass.

Two things a reviewer should know rather than discover:

No production code is modified, so there is no new coverage to add.

Related

Separately from this PR, I triaged the 40 code-level Codacy security
findings (SQL injection, hardcoded secrets, cookie flags, timing
attacks) and ignored them with recorded justifications; all 40 were
false positives in test code, with none in production code. Open
security items went from 155 to 115, and the 115 that remain are the
dependency advisories this PR addresses.

Summary by CodeRabbit

  • Security

    • Updated Go and text-processing components to address four reachable vulnerabilities.
    • Updated web charting and related packages, leaving the web client with no known vulnerabilities.
  • Maintenance

    • Standardized builds, releases, and automated checks on Go 1.26.5.
    • Updated the web client’s charting capabilities to ECharts 6.1.0.
  • Documentation

    • Added these security improvements to the unreleased changelog.

Codacy reports a large number of SCA advisories against this repository,
but most of them are not reachable from Workbench code, so I ran
govulncheck across all four Go modules to find the ones that actually
are. Four came back, and this change clears all of them.

Three are standard library issues fixed in the 1.26.4 and 1.26.5 patch
releases: a privacy leak in the crypto/tls Encrypted Client Hello
handling, arbitrary input included unescaped in net/textproto error
messages, and inefficient candidate hostname parsing in crypto/x509.
The fourth is an infinite loop in golang.org/x/text normalisation,
reached through pgxpool connection setup in all three services and
directly from the server's password dictionary handling.

The Go version is raised in the four module files, in the collector,
server and alerter Dockerfile builder stages, and in the CI and release
workflows. The release workflow is the important one, because it
previously built the published binaries with the affected toolchain, so
the advisories would have shipped regardless of what the module files
said. Where a workflow repeats the version in an `if:` guard, the guard
moved with the matrix value; leaving those behind would have silently
stopped the coverage and publish steps from matching.

golang.org/x/text goes to v0.40.0, which is the current release rather
than the v0.39.0 floor govulncheck reports. go mod tidy also advanced
golang.org/x/sync to v0.22.0 as a resolution side effect.

On the client, ECharts moves to v6.1.0 to resolve a cross-site
scripting advisory, and postcss, js-yaml and brace-expansion are
refreshed transitively; npm audit now reports no known vulnerabilities.

govulncheck reports zero affected symbols in all four modules after
this change, down from three, three, four and four. The remaining
advisories it lists are golang.org/x/crypto/ssh and ssh/agent issues
that no Workbench code calls.

No production code changes, so there is no new test coverage to add.
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The PR standardizes Go 1.26.5 across modules, Docker builders, CI, E2E, and release workflows. It updates indirect Go dependencies, upgrades ECharts to 6.1.0, and documents the security-related dependency changes.

Changes

Go toolchain and module updates

Layer / File(s) Summary
Go modules and builder images
alerter/src/go.mod, collector/go.mod, server/src/go.mod, pkg/go.mod, alerter/Dockerfile, collector/Dockerfile, server/Dockerfile
Go modules and builder images now use Go 1.26.5. Service modules update golang.org/x/sync and golang.org/x/text where applicable.

CI and release alignment

Layer / File(s) Summary
CI and release toolchain alignment
.github/workflows/ci-*.yml, .github/workflows/release.yml
CI matrices, quality checks, coverage steps, artifact uploads, E2E setup, and release builds now target Go 1.26.5. PostgreSQL 18 conditions remain unchanged.

Client dependency and changelog updates

Layer / File(s) Summary
Client dependency updates
client/package.json, docs/changelog.md
The client upgrades ECharts to 6.1.0. The changelog records the Go, Go dependency, ECharts, and transitive dependency updates.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: upgrading to Go 1.26.5 and addressing reachable dependency vulnerabilities.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security-dep-bumps

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/go.mod`:
- Line 3: Add pkg/** to the path filters for the lint, vet, and test jobs in
ci-server.yml, ci-alerter.yml, and ci-collector.yml, matching the service image
build behavior in ci-docker.yml.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 55d8e3be-c0c3-4cf2-a662-c30fe3c6ec89

📥 Commits

Reviewing files that changed from the base of the PR and between 19c645d and ccb30ce.

⛔ Files ignored due to path filters (4)
  • alerter/src/go.sum is excluded by !**/*.sum
  • client/package-lock.json is excluded by !**/package-lock.json
  • collector/go.sum is excluded by !**/*.sum
  • server/src/go.sum is excluded by !**/*.sum
📒 Files selected for processing (14)
  • .github/workflows/ci-alerter.yml
  • .github/workflows/ci-collector.yml
  • .github/workflows/ci-e2e.yml
  • .github/workflows/ci-server.yml
  • .github/workflows/release.yml
  • alerter/Dockerfile
  • alerter/src/go.mod
  • client/package.json
  • collector/Dockerfile
  • collector/go.mod
  • docs/changelog.md
  • pkg/go.mod
  • server/Dockerfile
  • server/src/go.mod

Comment thread pkg/go.mod
go 1.26.1

toolchain go1.26.2
go 1.26.5

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 6 'paths:|pkg/\*\*|alerter/\*\*|collector/\*\*|server/\*\*' .github/workflows

Repository: pgEdge/ai-dba-workbench

Length of output: 9785


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Docker workflow ---'
cat -n .github/workflows/ci-docker.yml

printf '%s\n' '--- Go service workflows and referenced build commands ---'
for f in .github/workflows/ci-server.yml .github/workflows/ci-alerter.yml .github/workflows/ci-collector.yml; do
  printf '\n### %s\n' "$f"
  cat -n "$f"
done

printf '%s\n' '--- Dockerfiles and compose references ---'
git ls-files '*Dockerfile' docker-compose.yml
for f in $(git ls-files '*Dockerfile'); do
  printf '\n### %s\n' "$f"
  cat -n "$f"
done

Repository: pgEdge/ai-dba-workbench

Length of output: 40508


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Shared module references ---'
for f in pkg/go.mod server/src/go.mod alerter/src/go.mod collector/go.mod docker-compose.yml; do
  printf '\n### %s\n' "$f"
  cat -n "$f"
done

printf '%s\n' '--- Deterministic workflow coverage check ---'
python3 - <<'PY'
from pathlib import Path
import re

workflow_files = [
    Path(".github/workflows/ci-server.yml"),
    Path(".github/workflows/ci-alerter.yml"),
    Path(".github/workflows/ci-collector.yml"),
    Path(".github/workflows/ci-docker.yml"),
]

for path in workflow_files:
    text = path.read_text()
    paths = re.findall(r"^\s*-\s*'([^']+)'", text, re.MULTILINE)
    print(f"{path}: pkg/**={'pkg/**' in paths}, push={'push:' in text}, pull_request={'pull_request:' in text}")

compose = Path("docker-compose.yml").read_text()
services = re.findall(r"^([A-Za-z0-9_-]+):\s*$", compose, re.MULTILINE)
print("compose services:", services)

for service in ("server", "alerter", "collector"):
    dockerfile = Path(service) / "Dockerfile"
    text = dockerfile.read_text()
    print(f"{dockerfile}: copies pkg={'COPY pkg/' in text}, builds={'RUN CGO_ENABLED=0 go build' in text}")
PY

Repository: pgEdge/ai-dba-workbench

Length of output: 7677


Add pkg/** to the service CI path filters.

ci-docker.yml builds all three service images for pkg/** changes, but ci-server.yml, ci-alerter.yml, and ci-collector.yml skip their lint, vet, and test jobs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/go.mod` at line 3, Add pkg/** to the path filters for the lint, vet, and
test jobs in ci-server.yml, ci-alerter.yml, and ci-collector.yml, matching the
service image build behavior in ci-docker.yml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant