Skip to content

Bump x/net, x/crypto/, x/text, use debian:13-slim - #600

Merged
y4ssi merged 4 commits into
zcash:masterfrom
zecrocks:be/cve-dep-bumps
Sep 2, 2026
Merged

Bump x/net, x/crypto/, x/text, use debian:13-slim#600
y4ssi merged 4 commits into
zcash:masterfrom
zecrocks:be/cve-dep-bumps

Conversation

@emersonian

@emersonian emersonian commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Bumps dependencies to mitigate the CVEs found by the Trivy scan of electriccoinco/lightwalletd:v0.5.4 (the zcash-stack Artifact Hub security report), and uses a build stage in the Dockerfile to slim down lightwalletd's release image since it is a statically-linked golang application (it does not need things like perl installed and triggering security reports).

Dependency bumps

CVE Severity Module Fix
CVE-2026-56852 HIGH golang.org/x/text v0.37.0 → v0.39.0
CVE-2026-46600 HIGH golang.org/x/net v0.55.0 → v0.56.0
CVE-2026-56854 golang.org/x/crypto v0.52.0 → v0.55.0

Why debian-slim?

The released image was the heavy golang:1.25 build image, so the Go toolchain, binutils, perl, python3, git and openssh-client all shipped to production and accounted for most of Trivy's findings.

CVE-2026-56852 (HIGH): golang.org/x/text is vulnerable to a denial of
service via invalid UTF-8 input. Fixed in v0.39.0; the v0.5.4 release
image ships v0.37.0.

Reported by the Trivy scan of electriccoinco/lightwalletd:v0.5.4 on the
zcash-stack chart's Artifact Hub security report.
CVE-2026-46600 (HIGH): golang.org/x/net/dns/dnsmessage is vulnerable to
a denial of service via invalid DNS record parsing. Fixed in v0.56.0;
the v0.5.4 release image ships v0.55.0.

x/net v0.56.0 pulls golang.org/x/crypto to v0.53.0 and golang.org/x/sys
to v0.46.0 through minimal version selection.

Reported by the Trivy scan of electriccoinco/lightwalletd:v0.5.4 on the
zcash-stack chart's Artifact Hub security report.
CVE-2026-56854: the source-address critical option in the Permissions
returned by golang.org/x/crypto/ssh authentication callbacks is not
enforced. Fixed in v0.55.0; the v0.5.4 release image ships v0.52.0.

x/crypto v0.55.0 pulls golang.org/x/net to v0.57.0, golang.org/x/text to
v0.41.0 and golang.org/x/sys to v0.47.0 through minimal version
selection.

This leaves GO-2026-5932 (golang.org/x/crypto/openpgp is unmaintained)
outstanding. It has no fixed version, and lightwalletd imports neither
that package nor x/crypto/ssh directly; both arrive through the gRPC
dependency tree.

Reported by the Trivy scan of electriccoinco/lightwalletd:v0.5.4 on the
zcash-stack chart's Artifact Hub security report.
The released image was the golang:1.25 build image with the binary added
to it, so the Go toolchain, binutils, perl, python3, git, curl and
openssh-client all shipped to production. Those packages, not
lightwalletd, accounted for essentially every finding in the v0.5.4
scan: 1890 vulnerabilities, 1142 distinct CVEs.

Building in a stage and copying only the binary onto debian:13-slim
drops 1059 of those distinct CVEs (1890 -> 135 findings) and takes the
image from 1.9 GB to 193 MB. Nothing in the runtime image has a fix
available afterwards; the remainder are unfixed Debian issues in base
packages.

Both CRITICALs that leave entirely:

  CVE-2026-43185  linux-libc-dev   ksmbd signedness bug (kernel headers,
                                   present only to compile against)
  CVE-2026-60002  openssh-client   use-after-free during host key
                                   re-exchange

CVE-2026-13221, CVE-2026-42496 and CVE-2026-8376 (perl) stay, at
CRITICAL: they no longer arrive via perl, libperl5.40 and
perl-modules-5.40, but perl-base is part of debian:13-slim and none of
the three has a fixed version. Dropping to a distroless base would clear
them and take the image to 42 MB with 1 finding, at the cost of the
shell and of uid 2002; that is a separate call.

CGO_ENABLED=0 makes the binary static, so the runtime stage needs no
toolchain libraries. ca-certificates is installed for TLS to an RPC
endpoint that is not on localhost.

Behaviour is unchanged: same uid 2002 lightwalletd user and home, same
/var/lib/lightwalletd/db ownership, same /bin/bash for the debugging
entrypoint commented out in docker-compose.yml, same entrypoint, and
`lightwalletd version` still reports the git describe stamp.
@y4ssi
y4ssi self-requested a review September 2, 2026 00:06

@y4ssi y4ssi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested ACK

@y4ssi
y4ssi enabled auto-merge September 2, 2026 00:08
@y4ssi
y4ssi merged commit 51aba68 into zcash:master Sep 2, 2026
2 checks passed
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.

2 participants