worldmonitor icon indicating copy to clipboard operation
worldmonitor copied to clipboard

fix(security): patch GnuTLS in consumer-prices-core base image (libgnutls30 deb12u7)

Open lspassos1 opened this issue 5 months ago • 2 comments

Summary

consumer-prices-core builds on node:20-slim (Debian 12) and apt-get installs Chromium for Playwright — but the Dockerfile only ever ran install, never upgrade. That leaves the base image's pre-installed system libraries frozen at whatever the tag shipped, which is how Snyk ends up flagging two critical GnuTLS issues in libgnutls30:

Snyk advisory Issue CVSS
SNYK-DEBIAN12-GNUTLS28-16344325 Improper Null Termination 9.8
SNYK-DEBIAN12-GNUTLS28-16344303 Integer Underflow 9.1

Both are fixed in libgnutls30 3.7.9-2+deb12u7. apt-get install <chromium ...> doesn't pull that in, because libgnutls30 is already present as a base-image transitive dependency — so apt has no reason to touch it, and it stays at the vulnerable deb12u6.

Fix

Add an explicit apt-get upgrade -y between update and install, so the pre-installed packages pick up Debian's security point-releases (libgnutls30 → 3.7.9-2+deb12u7). One-line behavioural change; the package list is untouched.

RUN (apt-get update || true) \
    && apt-get upgrade -y --no-install-recommends \
    && apt-get install -y --fix-missing \
    chromium \
    ...

A couple of deliberate choices:

  • upgrade, not --only-upgrade libgnutls30. This is a Chromium-heavy image with a large system-library surface; upgrading the whole base keeps it current against future Debian CVEs rather than playing whack-a-mole with one package at a time.
  • The existing transient-mirror-failure tolerance is preserved — apt-get update keeps its || true, so the Railway build behaviour documented in #3142 doesn't regress.

Scope / what this intentionally leaves out

  • The sibling zlib1g finding (SNYK-DEBIAN12-ZLIB-6008963, CVSS 9.8) has no Debian fix and can't be cleared by apt-get upgrade. Bundling a .snyk ignore or a base-image swap here would muddy the diff, so it's triaged separately in #4364.
  • Base-image digest pinning is its own supply-chain concern, already tracked in #3552 — left out on purpose to keep this focused on the active CVEs.
  • This image is also still on Node 20 while the rest of the repo (and .nvmrc) is on 22; that drift is noted in #4364 as part of the longer-term Alpine option.

Type of change

  • [x] CI / Build / Infrastructure (container base-image hardening)

Verification

3.7.9-2+deb12u7 is the exact fixed version Snyk lists for both advisories, and it's the current Bookworm security release for gnutls28, so the next image rebuild + rescan should drop both GnuTLS findings. No application code paths change — this only affects the OS layer of the consumer-prices-core container image (Railway build).

🤖 Generated with Claude Code

lspassos1 avatar Jun 22 '26 23:06 lspassos1

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
worldmonitor Ignored Ignored Preview Jun 27, 2026 6:29pm

Request Review

vercel[bot] avatar Jun 22 '26 23:06 vercel[bot]

Greptile Summary

Adds apt-get upgrade -y --no-install-recommends to the consumer-prices-core/Dockerfile RUN step so that pre-installed Debian base-image packages (specifically libgnutls30) are patched to the security point-release (3.7.9-2+deb12u7) that clears two critical GnuTLS CVEs (CVSS 9.8 and 9.1) that apt-get install alone would never touch.

  • One-line change, no package-list modifications: the only addition is the apt-get upgrade step between update and install, with the existing || true mirror-failure tolerance preserved on the update call.
  • Scope is intentionally narrow: the sibling zlib1g finding (no Debian fix), Node 20 → 22 drift, and digest pinning are all called out as tracked in separate issues.

Confidence Score: 4/5

Safe to merge — the change correctly patches the flagged GnuTLS CVEs and touches no application code.

The upgrade step does not carry the same download-failure tolerance (--fix-missing or || true) that guards both the update and install steps, so a mirror outage during the download phase of apt-get upgrade would now break the Railway build where it previously would have succeeded. The risk window is small (requires a simultaneous update failure and an upgrade download failure) but it is a real behavioral change from the pre-PR state.

consumer-prices-core/Dockerfile — specifically the apt-get upgrade line and its interaction with the || true on apt-get update.

Important Files Changed

Filename Overview
consumer-prices-core/Dockerfile Adds apt-get upgrade -y --no-install-recommends between update and install to patch pre-installed base-image packages (libgnutls30 deb12u7). The upgrade step lacks the download-resilience that apt-get install --fix-missing provides, so a mirror failure during the upgrade download phase will now break the build where it previously would not.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["apt-get update"] -->|success| B["apt-get upgrade -y\n--no-install-recommends"]
    A -->|failure swallowed by OR-true| B
    B -->|success| C["apt-get install -y --fix-missing\nchromium + Playwright deps"]
    B -->|failure - no resilience guard| X["Build fails"]
    C -->|success| D["rm -rf /var/lib/apt/lists/*"]
    C -->|missing pkg tolerated by fix-missing| D
    D --> E["Layer complete\nlibgnutls30 3.7.9-2+deb12u7"]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["apt-get update"] -->|success| B["apt-get upgrade -y\n--no-install-recommends"]
    A -->|failure swallowed by OR-true| B
    B -->|success| C["apt-get install -y --fix-missing\nchromium + Playwright deps"]
    B -->|failure - no resilience guard| X["Build fails"]
    C -->|success| D["rm -rf /var/lib/apt/lists/*"]
    C -->|missing pkg tolerated by fix-missing| D
    D --> E["Layer complete\nlibgnutls30 3.7.9-2+deb12u7"]

Reviews (1): Last reviewed commit: "fix(security): patch GnuTLS in consumer-..." | Re-trigger Greptile

greptile-apps avatar Jun 22 '26 23:06 greptile-apps