Repository navigation
fix(backend): upgrade OS packages in runtime Dockerfiles (#7136) - #11188
Conversation
…re#7136) Patch Debian/Ubuntu packages in final image stages so service layers pick up security updates beyond the shared slim-forky base. Co-authored-by: Cursor <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
2 issues found across 12 files
Confidence score: 4/5
- In
backend/agent_vm/Dockerfile, using plainapt-get upgradecan leave back security updates that require new dependencies, which increases the chance of shipping a base image with known vulnerabilities — switch todist-upgrade/full-upgrade(or equivalent update strategy) to avoid held packages. - In
backend/Dockerfile,--no-install-recommendsonapt-get upgradeis ineffective and can create a false sense of hardening, making maintenance intent less clear — remove the flag there or apply it only toapt-get installsteps.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/Dockerfile">
<violation number="1" location="backend/Dockerfile:49">
P3: `--no-install-recommends` is a no-op on `apt-get upgrade`: upgrade only updates already-installed packages and never pulls Recommended packages, so the flag does nothing here (it's meaningful only on the `install` command). It gives a misleading impression of minimalism and the regression test hard-codes the redundant string — drop it from the upgrade line and update the test assertion to match.</violation>
</file>
<file name="backend/agent_vm/Dockerfile">
<violation number="1" location="backend/agent_vm/Dockerfile:22">
P2: Consider `apt-get -y dist-upgrade --no-install-recommends` (or `full-upgrade`) instead of plain `upgrade`: plain `upgrade` holds back any package whose update pulls in a new dependency or conflict, so those security fixes silently never apply. That directly undercuts the CVE-remediation purpose of this PR. Note the change also needs the test contract string in `test_backend_runtime_os_upgrade.py` updated in tandem.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| ENV PATH="/opt/bun/bin:/opt/venv/bin:$PATH" | ||
|
|
||
| # Patch OS packages before Playwright's --with-deps apt installs (#7136). | ||
| RUN apt-get update && apt-get -y upgrade --no-install-recommends && rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
P2: Consider apt-get -y dist-upgrade --no-install-recommends (or full-upgrade) instead of plain upgrade: plain upgrade holds back any package whose update pulls in a new dependency or conflict, so those security fixes silently never apply. That directly undercuts the CVE-remediation purpose of this PR. Note the change also needs the test contract string in test_backend_runtime_os_upgrade.py updated in tandem.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/agent_vm/Dockerfile, line 22:
<comment>Consider `apt-get -y dist-upgrade --no-install-recommends` (or `full-upgrade`) instead of plain `upgrade`: plain `upgrade` holds back any package whose update pulls in a new dependency or conflict, so those security fixes silently never apply. That directly undercuts the CVE-remediation purpose of this PR. Note the change also needs the test contract string in `test_backend_runtime_os_upgrade.py` updated in tandem.</comment>
<file context>
@@ -18,6 +18,9 @@ WORKDIR /app
ENV PATH="/opt/bun/bin:/opt/venv/bin:$PATH"
+# Patch OS packages before Playwright's --with-deps apt installs (#7136).
+RUN apt-get update && apt-get -y upgrade --no-install-recommends && rm -rf /var/lib/apt/lists/*
+
COPY --from=bun /usr/local/bin/bun /opt/bun/bin/bun
</file context>
|
|
||
| RUN apt-get update && apt-get -y install ffmpeg curl libjemalloc2 && rm -rf /var/lib/apt/lists/* | ||
| # Patch OS packages in this layer before installing runtime deps (#7136). | ||
| RUN apt-get update && apt-get -y upgrade --no-install-recommends \ |
There was a problem hiding this comment.
P3: --no-install-recommends is a no-op on apt-get upgrade: upgrade only updates already-installed packages and never pulls Recommended packages, so the flag does nothing here (it's meaningful only on the install command). It gives a misleading impression of minimalism and the regression test hard-codes the redundant string — drop it from the upgrade line and update the test assertion to match.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/Dockerfile, line 49:
<comment>`--no-install-recommends` is a no-op on `apt-get upgrade`: upgrade only updates already-installed packages and never pulls Recommended packages, so the flag does nothing here (it's meaningful only on the `install` command). It gives a misleading impression of minimalism and the regression test hard-codes the redundant string — drop it from the upgrade line and update the test assertion to match.</comment>
<file context>
@@ -45,7 +45,10 @@ WORKDIR /app
-RUN apt-get update && apt-get -y install ffmpeg curl libjemalloc2 && rm -rf /var/lib/apt/lists/*
+# Patch OS packages in this layer before installing runtime deps (#7136).
+RUN apt-get update && apt-get -y upgrade --no-install-recommends \
+ && apt-get -y install --no-install-recommends ffmpeg curl libjemalloc2 \
+ && rm -rf /var/lib/apt/lists/*
</file context>
| RUN apt-get update && apt-get -y upgrade --no-install-recommends \ | |
| RUN apt-get update && apt-get -y upgrade \ |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for taking on the backend OS-package CVE cleanup — this is the right area to harden, and the PR is honest about the remaining scanner/rebuild work.
I'm going to hold this for changes because the current contract and patch scope are not complete enough for this security/workflow-sensitive change:
- The new test lists the runtime Dockerfiles covered by the contract, but there are still Debian/Python-slim plugin images in the repo, e.g.
plugins/Dockerfile.datadog,plugins/composio/Dockerfile,plugins/hume-ai/Dockerfile, andplugins/omi-github-app/Dockerfile, that are not patched or explicitly excluded. Please either include the relevant shipped backend/plugin service images in the patch/test, or narrow the PR/test wording so maintainers can see exactly which images remain out of scope. - The test should validate the effective final-stage
RUNinstruction, not just the presence of a literal string in the final-stage text. Otherwise a comment or unrelated command can satisfy the guard while the shipped image no longer performs the upgrade. - Because this is intended to remediate OS CVEs, maintainers should still rebuild the affected images and verify the vulnerability-scanner delta before merge/redeploy.
No sign of anything malicious here; this just needs tighter coverage and verification before it is safe to merge as a CVE-remediation change.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
Use dist-upgrade for covered runtime images, include shipped Debian plugin images, and assert the effective final-stage RUN instruction. Failure-Class: none Co-authored-by: CommandCodeBot <[email protected]>
kodjima33
left a comment
There was a problem hiding this comment.
OS package upgrades across runtime Dockerfiles look right and are covered by a contract test — holding the merge because this rebuilds every prod runtime image and should land with a deploy window.
|
@Git-on-my-level / @kodjima33 follow-up: PR #11188 is fully CI-green at 7efb792. The requested plugin coverage, final-stage RUN contract, dist-upgrade, and no-install-recommends fixes are present; focused contract test passes, and @kodjima33 approved. The remaining block is the stale CHANGES_REQUESTED plus the maintainer decision on rebuild/scanner validation and deploy window. Please dismiss the stale CR or call out any remaining issue. |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the follow-up. I rechecked the current head and the previous automation blockers look addressed: the shipped backend/plugin Debian/Ubuntu runtime Dockerfiles now use dist-upgrade, the extra plugin runtime images are included, and the regression test checks effective final-stage RUN instructions instead of just matching text.
I’m not formally approving this one because it is a workflow/security-sensitive runtime-image change and still needs human maintainer sign-off on the rebuild/scanner validation and deploy window. From the diff, though, I do not see a remaining code-level blocker in the PR itself; the important pre-merge step is for maintainers to rebuild the affected images and confirm the vulnerability-scanner delta before deploy.
I’m also clearing the stale needs-tests signal and dismissing my stale change-request review for the old head, since the test/coverage issues it called out have been addressed.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
Stale automation change request from older head; current head adds plugin coverage, uses dist-upgrade, and validates effective final-stage RUN instructions. Remaining scanner/deploy validation is maintainer follow-up, not a code-change request.
|
@Git-on-my-level need human response — author-side is clear on #11188. Current head
What’s left is the human maintainer gate you already named: rebuild affected runtime images, confirm vulnerability-scanner delta, and pick a deploy window (this touches every prod runtime image). Please either:
Happy to help with any follow-up once the deploy window is set. Failure-Class: none. |
kodjima33
left a comment
There was a problem hiding this comment.
apt-get upgrade in runtime Dockerfile final stages — approve only; this makes every prod image build non-deterministic, so Nik should land it deliberately.
|
@kodjima33 @beastoin @Git-on-my-level need human response — deploy-window merge for #11188. Author-clear on tip
Remaining gate is the one you already named: rebuild affected images → vulnerability-scanner delta → deliberate deploy window, then merge. Honest gaps unchanged: no in-repo Trivy/Grype delta here; parakeet/NeMo + shared custom base still out of scope. |
|
Tip refresh landed: |
|
@kodjima33 @beastoin need human response — deploy-window merge for #11188. Author-clear on tip
Remaining gate is the one you already named: rebuild affected images → vulnerability-scanner delta → deliberate deploy window, then merge. Honest gaps unchanged: no in-repo Trivy/Grype delta here; Please merge when the deploy window is set, or say if you want this held until a specific rebuild/scanner pass is scheduled. |
…IPE flake Co-authored-by: Cursor <[email protected]>
|
@kodjima33 @beastoin tip push to clear CI: Backend unit suite red on
Retriggering CI. Deploy-window merge call still stands once green again. |
|
@kodjima33 @beastoin deploy-window ping: current head is APPROVED, MERGEABLE/CLEAN, and checks are green. Remaining action is the runtime image rebuild/scanner comparison, then merge. |
What changed and why
Adds
apt-get -y upgrade --no-install-recommendsto the final stage of Debian/Ubuntu-based backend/plugin runtime Dockerfiles so each service image applies available OS security updates on top ofpython:3.11-slim-forky(and the NLLB CUDA Ubuntu base). Fixes #7136 for the service-layer slice of OS CVEs.Honest scope: #7157 already moved services to Forky / trimmed CUDA. Remaining scanner findings that live only in the shared custom base image (or NVIDIA NeMo/parakeet) still need a base-image rebuild / CUDA-image owner path — this PR cannot clear those in isolation. There is no in-repo Trivy/Grype gate to print a CVE delta here.
Product invariants affected
none
How it was verified
backend/.venv/ nearby pytest:backend/tests/unit/test_backend_runtime_os_upgrade.py— 1 passed (asserts every listed final stage contains the upgrade).Tests
backend/tests/unit/test_backend_runtime_os_upgrade.py— regression contract so the upgrade line cannot be dropped from final stages silently.Failure class (fixes)
Failure-Class: none
Images touched
backend/Dockerfile,Dockerfile.desktop_backend,pusher,agent-proxy,agent_vmmodal(+ notifications + memory-maintenance jobs),diarizer,nllb_translationplugins/Dockerfilebackend/parakeet/Dockerfile(NVIDIA NeMo base — different OS/toolchain; needs separate owner)