Skip to content

fix(2.4.8): replace gosu with setpriv to clear 50 Go stdlib CVEs#226

Merged
ttlequals0 merged 1 commit into
mainfrom
fix/replace-gosu-with-setpriv
May 16, 2026
Merged

fix(2.4.8): replace gosu with setpriv to clear 50 Go stdlib CVEs#226
ttlequals0 merged 1 commit into
mainfrom
fix/replace-gosu-with-setpriv

Conversation

@ttlequals0
Copy link
Copy Markdown
Owner

Summary

Replaces gosu with setpriv (from util-linux) in entrypoint.sh and drops the gosu package from both GPU and CPU images. Clears 50 of 52 vulnerabilities from the current Docker Scout report (3 CRITICAL, 19 HIGH, 26 MEDIUM, 2 LOW) — all from the Go stdlib 1.22.2 baked into Ubuntu 24.04's gosu 1.17 binary.

Why setpriv

  • Already in the base image (util-linux 2.39.3, verified in ubuntu:24.04 and nvidia/cuda:12.9.1-runtime-ubuntu24.04).
  • No Go runtime -> no Go-stdlib CVE drip in future scans.
  • Upstream-recommended gosu alternative; flags reproduce gosu defaults:
    • --reuid=minuspod + --regid=minuspod (setuid+setgid)
    • --init-groups (supplementary groups from /etc/group)
    • --inh-caps=-all (drop inheritable caps)

What changed

  • entrypoint.sh:51gosu minuspod gunicorn ... -> setpriv --reuid=minuspod --regid=minuspod --init-groups --inh-caps=-all -- gunicorn ...
  • Dockerfile + Dockerfile.cpu — removed gosu from apt install, replaced gosu nobody true smoke test with the setpriv equivalent
  • docker-compose.yml + docker-compose.cpu.yml + README.md — comment / docs sync
  • Version bump 2.4.7 -> 2.4.8 (version.py, openapi.yaml, CHANGELOG)

Remaining CVEs

2 torch CVEs (local DoS, LOW + MEDIUM) require a torch 2.6.0 -> 2.8.0 upgrade. Tracked separately; deferred from this PR.

Test plan

  • 1178 pytest tests pass locally
  • Frontend tsc --noEmit clean
  • /simplify + /code-review run, all findings addressed
  • CI green (CodeQL, pip-audit)
  • GPU image builds and trivy scan confirms 50 gosu CVEs gone
  • CPU image builds and trivy scan clean
  • Container starts, gunicorn drops to UID 1000, /api/v1/health returns 200

Ubuntu 24.04 ships gosu 1.17 compiled against Go stdlib 1.22.2, which
carries 50 known CVEs (3 CRITICAL, 19 HIGH, 26 MEDIUM, 2 LOW) per Docker
Scout. setpriv from util-linux is already in the base image, has no Go
runtime, and is the upstream-recommended gosu alternative.

entrypoint.sh privilege-drop flags match gosu defaults:
--reuid=minuspod --regid=minuspod --init-groups --inh-caps=-all

Mirrored across GPU Dockerfile, CPU Dockerfile, both docker-compose
files, and README. The 2 remaining torch CVEs (local DoS, LOW + MED)
need a torch 2.6.0 -> 2.8.0 bump and are tracked separately.
@ttlequals0 ttlequals0 merged commit 74ceaf1 into main May 16, 2026
13 checks passed
@ttlequals0 ttlequals0 deleted the fix/replace-gosu-with-setpriv branch May 16, 2026 00:12
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.

1 participant