Draft
Fix critical CVEs: build go-replace from source with Go 1.22+ instead of pre-built Go 1.19.1 binary#568
Conversation
…d of pre-built binary The pre-built go-replace binary v22.10.0 was compiled with Go v1.19.1 which contains critical CVEs: CVE-2023-24538, CVE-2023-24540, CVE-2024-24790. Update the goreplace macro in tools.jinja2 and the generated toolbox Dockerfile to build go-replace from source using Alpine's Go package (1.22+ on alpine:latest), which fixes the vulnerable stdlib by compiling with an up-to-date Go toolchain. Closes #567
Use explicit mv with fallback for architecture-specific vs generic bin paths:
- Cross-compile (e.g., amd64 host building arm64): binary at /tmp/go-build/bin/linux_${TARGETARCH}/go-replace
- Native compile: binary at /tmp/go-build/bin/go-replace
The or-pattern (try arch-specific first, fall back to generic) handles both cases
explicitly rather than relying on find's silent failure behavior.
Copilot
AI
changed the title
[WIP] Fix critical CVEs in webdevops/php-nginx:8.4-alpine
Fix critical CVEs: build go-replace from source with Go 1.22+ instead of pre-built Go 1.19.1 binary
Jul 7, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The bundled
go-replacebinary (v22.10.0) was compiled with Go 1.19.1, exposing all images that include it to three critical CVEs inhtml/templateandnet/netip(CVE-2023-24538, CVE-2023-24540, CVE-2024-24790). No newer pre-built release exists, so the fix is to compile from source with the current Go toolchain.Changes
template/Dockerfile/tools.jinja2— Rewrites thegoreplacemacro to build from source using Alpine'sgopackage (1.22+ onalpine:latest) with a virtual build dep that is removed post-install, rather than downloading a pre-built binary:The binary path fallback (
linux_${TARGETARCH}→ generic) handles both cross-compilation and native builds correctly.docker/toolbox/latest/Dockerfile— Regenerated to reflect the updated macro output.