Skip to content

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

Merged
koala73 merged 2 commits into
mainfrom
fix/consumer-prices-base-image-cves
Jul 5, 2026
Merged

fix(security): patch GnuTLS in consumer-prices-core base image (libgnutls30 deb12u7)#4365
koala73 merged 2 commits into
mainfrom
fix/consumer-prices-base-image-cves

Conversation

@lspassos1

Copy link
Copy Markdown
Collaborator

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 preservedapt-get update keeps its || true, so the Railway build behaviour documented in fix(railway): tolerate Ubuntu apt mirror failures in NIXPACKS builds #3142 doesn't regress.

Scope / what this intentionally leaves out

Type of change

  • 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

…utls30 deb12u7)

The consumer-prices-core image builds on node:20-slim (Debian 12) and installs
Chromium for Playwright, but the Dockerfile only ever ran `apt-get install` --
never `apt-get upgrade`. Pre-installed base-image libraries therefore stayed
frozen at the tag's shipped versions, which is why Snyk flags two critical
GnuTLS issues in libgnutls30:

  - SNYK-DEBIAN12-GNUTLS28-16344325  Improper Null Termination  (CVSS 9.8)
  - SNYK-DEBIAN12-GNUTLS28-16344303  Integer Underflow          (CVSS 9.1)

Both are fixed in libgnutls30 3.7.9-2+deb12u7. `apt-get install <chromium ...>`
won't pull that in because libgnutls30 is already present as a base-image
transitive dependency, so apt has no reason to touch it.

Add an explicit `apt-get upgrade` between update and install so the pre-installed
packages pick up Debian's security point-releases. The existing tolerance for
transient apt mirror failures on `apt-get update` is preserved.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@lspassos1 lspassos1 added security Security-related docker Docker, self-hosting, containers labels Jun 22, 2026
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

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

@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

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"]
Loading
%%{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"]
Loading

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

Comment thread consumer-prices-core/Dockerfile Outdated

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3d21a1f7f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread consumer-prices-core/Dockerfile Outdated
@koala73 koala73 added High Value Meaningful contribution to the project Ready to Merge PR is mergeable, passes checks, and adds value labels Jun 23, 2026
Review feedback (greptile + codex): the new `apt-get upgrade` lacked the
download-failure tolerance that `apt-get update` (|| true) and `apt-get install`
(--fix-missing) already had, so a transient mirror outage during the upgrade
download phase would break the Railway build — a regression to the build
tolerance this PR claims to preserve.

Retry `apt-get update` (up to 3x) so the index refresh is reliable before the
security upgrade, and give the upgrade the same `|| true` tolerance as the other
network steps. Net: the upgrade no longer reduces build resilience, and the
refresh is more reliable than the original single-shot `update || true`.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1787fe5239

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# this step has no less download resilience than the original. The post-deploy
# Snyk scan is the backstop that flags a libgnutls30 left un-upgraded by an outage.
RUN (for i in 1 2 3; do apt-get update && break || sleep 5; done) \
&& (apt-get upgrade -y --no-install-recommends || true) \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fail when the security upgrade does not apply

I checked apt-get --help, where upgrade is the command that performs package upgrades; because this upgrade is wrapped in || true, a successful package-list refresh followed by a failed GnuTLS download or dpkg upgrade still lets Docker continue into the Chromium install and produce an image with the original vulnerable libgnutls30. --fix-missing only applies to the later install, so the CVE fix should either retry/fail closed here or verify the fixed package version before continuing.

Useful? React with 👍 / 👎.

@koala73
koala73 merged commit d40f3dc into main Jul 5, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude Generated with Claude Code docker Docker, self-hosting, containers High Value Meaningful contribution to the project Ready to Merge PR is mergeable, passes checks, and adds value security Security-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants