Skip to content

fix(docker): rebuild image on patched base images to clear Wiz HIGH (c0df3804) - #151

Merged
prasadlohakpure merged 4 commits into
mainfrom
fix/patch-container-base-images
Oct 15, 2026
Merged

prasadlohakpure merged 4 commits into
mainfrom
fix/patch-container-base-images

Conversation

@oly-agents

@oly-agents oly-agents Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rebuilds the internet-facing heimdall container image on patched, actively-maintained base images and patches a critical Next.js RCE, clearing the OS/package and application vulnerabilities Wiz flagged as HIGH (issue c0df3804, due ~Nov 6) that enable initial access.

The build definition is a single multi-stage Dockerfile. The runtime stage copies the Go toolchain out of the builder (COPY --from=go-builder /usr/local/go), so the golang base version is part of the shipped image surface, not just a build-time concern.

Changes

  • golang:1.25.0 → golang:1.27.2 — Go 1.25 reached end-of-life on 2026-08-19 and no longer receives security fixes; 1.27.2 (2026-10-08) is current. go.mod declares go 1.25.0 with no toolchain directive, so 1.27.2 builds it with no source changes.
  • node:20-bookworm / node:20-bookworm-slim → node:24-bookworm / node:24-bookworm-slim — Node 20 reached EOL on 2026-04-30 and is now unpatched; 24 is the active LTS. Next 16 / React 19 / pnpm 10.28.2 all support Node 24.
  • Next.js ^16.1.6 → exact 16.3.8 (both next and eslint-config-next in web/package.json) — clears GHSA-2xp9-vwfh-vxw4, a critical unauthenticated RCE affecting next >=16.0.0 <16.3.3. The lockfile resolves next and eslint-config-next to 16.3.8 with no 16.1.x remaining; the transitive sharp 0.34→0.35 bump requires node >=20.9.0, satisfied by Node 24. Moving from a caret range to an exact pin tightens pinning rather than loosening it.

OS package freshness (no blanket apt-get upgrade)

An earlier revision added apt-get upgrade -y to the apt-using stages; it was deliberately removed (commit 0e7c0be, "avoid blanket package upgrades") to avoid pulling in unrelated, non-security package changes at build time that make the image non-reproducible and widen the diff beyond the flagged CVEs. The base images are pinned to current, in-support tags (node:24-bookworm{,-slim}, golang:1.27.2), which already carry the patched Debian bookworm packages as published.

Base-image freshness is guaranteed by rebuilds: docker-image.yml rebuilds and pushes on every push to main and on v*/latest tags, and each build re-pulls the base image tags, so a merge (or re-tag) picks up newer bookworm security packages without a blanket in-image upgrade. If future Wiz scans flag a bookworm package CVE that is patched upstream but not yet in the base tag, the narrower remediation is to apt-get install --only-upgrade the specific affected packages rather than reintroduce a blanket upgrade.

Pinning / behavior

  • Pinning style preserved: explicit patch tag for golang, major tag for node, exact version for next — matching or tightening the repo's existing convention (not loosened).
  • Entrypoint (/usr/local/bin/entrypoint.sh), exposed port (9090), and runtime behavior unchanged. No application logic changed beyond the base-image bumps and the Next.js version pin.

Follow-up: CI Go version (out of scope here)

.github/workflows/build.yml still pins setup-go to the now-EOL 1.25.0. Aligning it to 1.27.2 would be consistent with this change, but the oly-agents[bot] App lacks workflows permission, so it is left for a human to update.

On the "admin path / cleartext cloud key" question

The Slack request asked whether the Wiz admin-privilege path is real, noting it's "often a cleartext cloud key on the box." I checked: no cloud credentials are baked into this image or repo. configs/local.yaml (shipped to /etc/heimdall/heimdall.yaml) contains only DB/plugin/command config and no secrets; AWS credentials are supplied purely via environment variables at runtime (docker-compose.yaml), and .dockerignore excludes **/.env, **/*.pem, and **/.aws. So within this repo there is no cleartext cloud key to remediate. If Wiz still reports a reachable admin path after this rebuild, it is likely rooted in the deployment environment (instance/task role, env injection) rather than the image contents, and should be triaged there.

Validation

This environment has no Docker, Go, or Node toolchain, so I could not run the image build or test suite locally. The changes are self-consistent (compatible version directives, preserved pnpm/corepack setup, lockfile resolves the pinned Next.js). Build + test run in CI (build.yml → ./build.sh --go --ui --test) and the image build in docker-image.yml; please confirm both pass before merge.


Oly run: https://oly.pattern.com/runs/01a132c9-68fe-7739-871b-3029f35cf8db
Requested by: mayuresh.pawar@pattern.com

🤖 Generated with Claude Code

Bump the build and runtime base images off EOL releases to patched,
actively-maintained tags and refresh OS packages during build, clearing
the OS/package vulnerabilities Wiz flagged (issue c0df3804) on the
internet-facing heimdall image.

- golang:1.25.0 -> golang:1.27.2 (Go 1.25 reached EOL 2026-08-19; the Go
  toolchain is also copied into the runtime stage, so this patches the
  shipped image too)
- node:20-bookworm / node:20-bookworm-slim -> node:24-* (Node 20 reached
  EOL 2026-04-30 and is unpatched; 24 is the active LTS)
- add `apt-get upgrade -y` to both apt-using stages so installed Debian
  bookworm packages are upgraded to current security-patched versions

Pinning style is preserved (explicit patch tag for golang, major tag for
node, matching the prior convention). Entrypoint, exposed ports, and
runtime behavior are unchanged; no application logic changed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@argus-pattern argus-pattern 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.

Reviewed Dockerfile at a08e6b0: golang:1.25.0 → 1.27.2, node:20-bookworm(-slim) → node:24-bookworm(-slim), and apt-get upgrade -y in the builder and runtime stages.

What I checked:

  • go.mod declares go 1.25.0 with no toolchain line, so Go 1.27.2 builds it with the same language semantics and GODEBUG defaults.
  • The unsuffixed golang tag is trixie-based for both the old and new versions. The builder OS and glibc are therefore unchanged relative to the bookworm runtime.
  • Node 24 still bundles corepack, so corepack prepare pnpm@10.28.2 keeps working in the web-builder and runtime stages.
  • The entrypoint, CMD, runtime layout and copied artifacts are unchanged.
  • Version pinning is preserved: a patch tag for Go, a major tag for Node.
  • The changes meet the acceptance criteria for the requested scope (patched base images plus package upgrades) with no app logic changes.

Nothing to flag. The CI setup-go 1.25.0 mismatch is already called out in the PR as a follow-up.

The base-image bump does not touch the Next.js app the container serves.
next@16.1.6 is affected by the unauthenticated image-optimization RCE
fixed in 16.3.3 (GHSA-2xp9-vwfh-vxw4). Pin Next and eslint-config-next
to 16.3.8 so the rebuilt image no longer ships that vulnerability.
Comment thread Dockerfile

@argus-pattern argus-pattern 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.

Re-reviewed at 0e7c0be. Two commits are new since the last Argus pass (a08e6b0): 0dd9c6c bumps Next.js and 0e7c0be removes apt-get upgrade.

  • Next.js bump (0dd9c6c) looks correct. GHSA-2xp9-vwfh-vxw4 is a critical unauthenticated RCE affecting next >=16.0.0 <16.3.3, so 16.3.8 clears it. The lockfile resolves next and eslint-config-next to 16.3.8 with no 16.1.x left. Its transitive sharp 0.34→0.35 bump requires node >=20.9.0, which Node 24 satisfies. Changing the version from ^16.1.6 to an exact pin tightens pinning rather than loosening it.
  • The PR description is out of date. It still lists "apt-get upgrade -y added to both apt-using stages" as a change, which 0e7c0be reverted. It also does not mention the Next.js RCE fix, which is the most security-relevant change in the PR. Please update the Summary/Changes so reviewers and the Wiz ticket reflect what actually ships.
  • See the inline comment on Dockerfile:38 about removing the package upgrade.

@oly-agents

oly-agents Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the re-review @argus-pattern. Addressed the PR-description points:

  • Next.js RCE — now called out in the Changes section (GHSA-2xp9-vwfh-vxw4, ^16.1.6 → exact 16.3.8 for both next and eslint-config-next, lockfile clean of 16.1.x, sharp 0.35 OK on Node 24).
  • Stale apt-get upgrade bullet — removed. Replaced with an "OS package freshness" section explaining the 0e7c0be removal decision and how base-image freshness is guaranteed (rebuild-on-push re-pulls the pinned in-support base tags; narrower --only-upgrade for any future per-package CVE).

Inline thread on Dockerfile:38 resolved with the same rationale.

@prasadlohakpure
prasadlohakpure merged commit 9a4254e into main Oct 15, 2026
1 check passed
@prasadlohakpure
prasadlohakpure deleted the fix/patch-container-base-images branch October 15, 2026 04:20
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