Skip to content

Commit 62bd371

Browse files
EItanyaCopilot
andauthored
fix: remediate CVEs in app image dependencies (#1896)
## Summary Remediates the actionable CVEs from a recent trivy + grype scan of the `app` image built from `main`. - Bumps vulnerable transitive Python deps via `uv` constraint-dependencies in `python/pyproject.toml`: - aiohttp 3.13.3 → 3.13.5 (CVE-2026-22815, -34515, -34516, -34525) - cryptography 46.0.5 → 48.0.0 (CVE-2026-39892) - mako 1.3.10 → 1.3.12 (CVE-2026-44307, -41205) - python-dotenv 1.1.1 → 1.2.2 (CVE-2026-28684) - requests 2.32.5 → 2.34.2 (CVE-2026-25645) - sqlparse 0.5.3 → 0.5.5 (GHSA-27jp-wm6q-gp25) - Installs `uv` from upstream `ghcr.io/astral-sh/uv:0.11.15` via multi-stage COPY in `python/Dockerfile` instead of the Wolfi `apk` package, so the uv binary (and its Rust deps like `rkyv`) is pinned and bumpable independent of the Wolfi release cadence. - Overrides `brace-expansion` to 5.0.6 in the sandbox-runtime npm tree (CVE-2026-45149), mirroring the existing lodash-es override. CVEs left unaddressed are not actionable here: CPython CVEs marked `n/a` (no upstream fix yet), pip CVE-2026-3219 (`not-fixed`), Alpine `busybox`/`git` findings in `skills-init` (no upstream patch). ## Test plan - [x] `uv lock --check` passes - [x] `docker build -f python/Dockerfile ./python` succeeds - [x] Built image: `uv --version` reports 0.11.15 - [x] Built image: aiohttp 3.13.5, cryptography 48.0.0, mako 1.3.12, python-dotenv 1.2.2, requests 2.34.2, sqlparse 0.5.5 installed - [x] Built image: `/opt/sandbox-runtime/node_modules/brace-expansion/package.json` reports 5.0.6 - [ ] Re-run trivy + grype on the `app` image built from this branch to confirm CVE counts drop --- _PR opened by Claude on behalf of @EItanya._ --------- Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 03ad0e6 commit 62bd371

6 files changed

Lines changed: 204 additions & 187 deletions

File tree

python/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
### STAGE 1: base image
22
ARG BASE_IMAGE_REGISTRY=cgr.dev
3+
ARG UV_VERSION=0.11.15
4+
FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv-bin
35
FROM $BASE_IMAGE_REGISTRY/chainguard/wolfi-base:latest AS base-os
46

57
# Build arg to control SSL verification (set DISABLE_SSL_VERIFY=1 to skip SSL checks)
@@ -14,12 +16,16 @@ RUN --mount=type=cache,target=/var/cache/apk,rw \
1416
if [ "$DISABLE_SSL_VERIFY" = "1" ]; then \
1517
echo "WARNING: Disabling SSL verification for apk (development only)"; \
1618
apk update --no-check-certificate && apk add --no-check-certificate \
17-
curl openssl bash git ca-certificates uv libstdc++; \
19+
curl openssl bash git ca-certificates libstdc++; \
1820
else \
1921
apk update && apk add \
20-
curl openssl bash git ca-certificates uv libstdc++; \
22+
curl openssl bash git ca-certificates libstdc++; \
2123
fi
2224

25+
# Install uv from upstream so we control the version and pick up rkyv fixes
26+
# independently of the Wolfi apk release cadence.
27+
COPY --from=uv-bin /uv /uvx /usr/local/bin/
28+
2329
### STAGE 2: python
2430
FROM base-os AS python-os
2531
ARG TOOLS_PYTHON_VERSION=3.13
@@ -74,6 +80,7 @@ RUN --mount=type=cache,target=/root/.npm \
7480
git clone --depth 1 --revision=ef4afdef4d711ba21a507d7f7369e305f7d3dbfa https://github.com/anthropic-experimental/sandbox-runtime.git && \
7581
cd sandbox-runtime && \
7682
npm install --save-exact lodash-es@4.18.1 @types/lodash-es@4.17.12 && \
83+
npm install --save-exact brace-expansion@5.0.6 && \
7784
npm run build && \
7885
# CVE-2026-26996: all minimatch instances (3.1.2, 9.0.5) are transitive dev
7986
# deps (eslint, typescript-eslint). Prune dev deps after build to remove them.

python/pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ dev = [
1111

1212
[tool.uv]
1313
constraint-dependencies = [
14-
"cryptography>=46.0.5",
14+
"aiohttp>=3.13.5",
15+
"cryptography>=48.0.0",
1516
"jaraco-context>=6.1.0",
17+
"mako>=1.3.12",
1618
"pyasn1>=0.6.3",
1719
"pyopenssl>=26.0.0",
20+
"python-dotenv>=1.2.2",
21+
"requests>=2.34.2",
22+
"sqlparse>=0.5.5",
1823
"wheel>=0.46.2",
1924
]
2025

0 commit comments

Comments
 (0)