Skip to content

Commit 9ff56b1

Browse files
silvestridclaude
andauthored
chore (deps): upgrade Sentry in the frontend to resolve a security alert with minimatch (baserow#4887)
* upgrade sentry * Add changelog entry * remove OS-level npm from frontend image which is not needed in prod and contains CVEs * Fix dc-prod command * Make sure ci and prod images download the latest packages instead of using the cache * Extract Python base image into a reusable ARG in backend Dockerfile Define PYTHON_BASE_IMAGE once at the top and reference it in all four FROM lines (builder-prod-base, ci, dev, local) to avoid repeating the version string. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 01a1624 commit 9ff56b1

File tree

7 files changed

+293
-245
lines changed

7 files changed

+293
-245
lines changed

backend/Dockerfile

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# syntax=docker/dockerfile:1.4
2+
ARG PYTHON_BASE_IMAGE="python:3.14.3-slim-trixie"
23
ARG UID="9999"
34
ARG GID="9999"
45

@@ -28,7 +29,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
2829
# =============================================================================
2930
# Production base builder stage: builds runtime dependencies only
3031
# =============================================================================
31-
FROM python:3.14.3-slim-trixie AS builder-prod-base
32+
FROM ${PYTHON_BASE_IMAGE} AS builder-prod-base
3233
ARG UID
3334
ARG GID
3435

@@ -174,17 +175,16 @@ RUN --mount=type=cache,target=$UV_CACHE_DIR,sharing=locked,uid=$UID,gid=$GID \
174175
# =============================================================================
175176
# CI Target - lightweight image for pytest and E2E tests
176177
# =============================================================================
177-
FROM python:3.14.3-slim-trixie AS ci
178+
FROM ${PYTHON_BASE_IMAGE} AS ci
178179
ARG UID
179180
ARG GID
180181

181-
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
182-
--mount=type=cache,target=/var/lib/apt,sharing=locked \
183-
apt-get update && \
182+
RUN apt-get update && \
184183
apt-get upgrade -y && \
185184
apt-get install -y --no-install-recommends \
186185
gettext \
187-
xmlsec1
186+
xmlsec1 \
187+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
188188

189189
ENV DOCKER_USER=baserow_docker_user \
190190
BASEROW_IMAGE_TYPE="backend" \
@@ -222,7 +222,7 @@ ENTRYPOINT ["/usr/bin/tini", "--", "/bin/bash", "/baserow/backend/docker/docker-
222222
# Only works mounting the source code as a bind mount. See docker-compose.dev.yml for usage.
223223
# =============================================================================
224224

225-
FROM python:3.14.3-slim-trixie AS dev
225+
FROM ${PYTHON_BASE_IMAGE} AS dev
226226
ARG UID="9999"
227227
ARG GID="9999"
228228

@@ -321,10 +321,12 @@ CMD ["django-dev"]
321321
# =============================================================================
322322
# Production target
323323
# =============================================================================
324-
FROM python:3.14.3-slim-trixie AS local
324+
FROM ${PYTHON_BASE_IMAGE} AS local
325325
ARG UID
326326
ARG GID
327327

328+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
329+
328330
ENV POSTGRES_VERSION=15 \
329331
DOCKER_USER=baserow_docker_user \
330332
BASEROW_IMAGE_TYPE="backend" \
@@ -334,10 +336,8 @@ ENV POSTGRES_VERSION=15 \
334336
PYTHONPATH="/baserow/backend/src:/baserow/premium/backend/src:/baserow/enterprise/backend/src" \
335337
DJANGO_SETTINGS_MODULE='baserow.config.settings.base'
336338

337-
# Runtime dependencies only - this layer is always cached
338-
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
339-
--mount=type=cache,target=/var/lib/apt,sharing=locked \
340-
apt-get update && \
339+
# Runtime dependencies only
340+
RUN apt-get update && \
341341
apt-get upgrade -y && \
342342
apt-get install -y --no-install-recommends curl ca-certificates gnupg \
343343
&& curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --batch --dearmor -o /usr/share/keyrings/pgdg.gpg \
@@ -346,7 +346,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
346346
&& apt-get install -y --no-install-recommends \
347347
xmlsec1 \
348348
gettext \
349-
postgresql-client-${POSTGRES_VERSION}
349+
postgresql-client-${POSTGRES_VERSION} \
350+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
350351

351352
RUN groupadd --system --gid $GID ${DOCKER_USER} && \
352353
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "refactor",
3+
"message": "Upgrade sentry to resolve a CVE in minimatch",
4+
"issue_origin": "github",
5+
"issue_number": null,
6+
"domain": "core",
7+
"bullet_points": [],
8+
"created_at": "2026-02-27"
9+
}

deploy/all-in-one/Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ ENV DOCKER_USER=baserow_docker_user \
2626
BASEROW_PLUGIN_DIR=/baserow/data/plugins
2727

2828
# Runtime dependencies
29-
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
30-
--mount=type=cache,target=/var/lib/apt,sharing=locked \
31-
apt-get update && \
29+
RUN apt-get update && \
3230
apt-get upgrade -y && \
3331
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y \
3432
curl gnupg2 ca-certificates && \
@@ -44,6 +42,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
4442
gettext \
4543
tini \
4644
tzdata-legacy \
45+
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
4746
&& \
4847
# Setup user and group with fixed UID/GID for volume permission consistency
4948
getent group "$GID" || groupadd --system --gid "$GID" "${DOCKER_USER}" && \
@@ -117,15 +116,15 @@ ARG GID
117116
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
118117

119118
# Install postgres + redis (PGDG repo already added in base stage)
120-
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
121-
--mount=type=cache,target=/var/lib/apt,sharing=locked \
122-
curl -fsSL https://packages.redis.io/gpg | gpg --batch --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg && \
119+
RUN curl -fsSL https://packages.redis.io/gpg | gpg --batch --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg && \
123120
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb trixie main" > /etc/apt/sources.list.d/redis.list && \
124121
apt-get update && \
125122
apt-get install --no-install-recommends -y \
126123
"postgresql-${POSTGRES_VERSION}" \
127124
"postgresql-${POSTGRES_VERSION}-pgvector" \
128-
redis && \
125+
redis \
126+
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
127+
&& \
129128
# Setup redis
130129
usermod -a -G tty redis && \
131130
sed -i 's/daemonize yes/daemonize no/g' /etc/redis/redis.conf && \

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ dc-prod *ARGS:
830830
if [ -z "{{ ARGS }}" ]; then
831831
just _dc_help
832832
else
833+
export BASEROW_PUBLIC_URL="${BASEROW_PUBLIC_URL:-http://localhost}"
833834
VERSION="${BASEROW_VERSION:-latest}"
834835
if [ "$VERSION" = "latest" ] || [ -z "$BASEROW_VERSION" ]; then
835836
# Build locally for latest/unset

web-frontend/Dockerfile

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# syntax=docker/dockerfile:1.4
2+
ARG NODE_BASE_IMAGE="node:24.14.0-trixie-slim"
23
ARG UID="9999"
34
ARG GID="9999"
45

@@ -27,7 +28,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
2728
# =============================================================================
2829
# CI builder stage
2930
# =============================================================================
30-
FROM node:24.13.0-trixie-slim AS builder-ci
31+
FROM ${NODE_BASE_IMAGE} AS builder-ci
3132
ARG UID
3233
ARG GID
3334

@@ -51,7 +52,7 @@ RUN --mount=type=cache,target=$YARN_CACHE_FOLDER,uid=$UID,gid=$GID,sharing=locke
5152
# =============================================================================
5253
# Production builder stage
5354
# =============================================================================
54-
FROM node:24.13.0-trixie-slim AS builder-prod
55+
FROM ${NODE_BASE_IMAGE} AS builder-prod
5556
ARG UID
5657
ARG GID
5758

@@ -99,12 +100,16 @@ FROM busybox:musl AS busybox-helper
99100
# =============================================================================
100101
# CI target - used in CI pipelines
101102
# =============================================================================
102-
FROM node:24.13.0-trixie-slim AS ci
103+
FROM ${NODE_BASE_IMAGE} AS ci
103104
ARG UID
104105
ARG GID
105106

106107
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
107108

109+
# Upgrade OS packages to patch CVEs in base image
110+
RUN apt-get update && apt-get upgrade -y --no-install-recommends \
111+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
112+
108113
ENV DOCKER_USER=baserow_docker_user \
109114
APP_ENV=test \
110115
BASEROW_IMAGE_TYPE="web-frontend"
@@ -150,7 +155,7 @@ CMD ["nuxt-prod"]
150155
# =============================================================================
151156
# Development target - used for local development with live reload
152157
# =============================================================================
153-
FROM node:24.13.0-trixie-slim AS dev
158+
FROM ${NODE_BASE_IMAGE} AS dev
154159
ARG UID
155160
ARG GID
156161

@@ -238,7 +243,7 @@ CMD ["nuxt-dev"]
238243
# =============================================================================
239244
# Production target - minimal image with only runtime requirements
240245
# =============================================================================
241-
FROM node:24.13.0-trixie-slim AS local
246+
FROM ${NODE_BASE_IMAGE} AS local
242247
ARG UID
243248
ARG GID
244249

@@ -254,8 +259,12 @@ COPY --from=tool-builder /usr/local/bin/su-exec /usr/local/bin/su-exec
254259
COPY --from=tool-builder /usr/bin/tini /usr/bin/tini
255260
COPY --from=busybox-helper /bin/wget /usr/local/bin/wget
256261

257-
# Update npm to patch CVEs in its bundled deps (glob, tar, @isaacs/brace-expansion)
258-
RUN npm install -g npm@latest
262+
# Upgrade OS packages to patch CVEs in base image
263+
RUN apt-get update && apt-get upgrade -y --no-install-recommends \
264+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
265+
266+
# Remove npm (not needed at runtime) to eliminate CVEs in its bundled deps (minimatch, glob, etc.)
267+
RUN rm -rf /usr/local/lib/node_modules/npm /usr/local/bin/npm /usr/local/bin/npx
259268

260269
RUN groupadd --system --gid $GID ${DOCKER_USER} && \
261270
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER}

web-frontend/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
},
3232
"dependencies": {
3333
"@nuxtjs/i18n": "10.2.1",
34-
"@sentry/node": "^10.38.0",
35-
"@sentry/nuxt": "^10.38.0",
36-
"@sentry/vue": "^10.38.0",
34+
"@sentry/node": "10.40.0",
35+
"@sentry/nuxt": "10.40.0",
36+
"@sentry/vue": "10.40.0",
3737
"@tiptap/core": "^3.13.0",
3838
"@tiptap/extension-blockquote": "^3.13.0",
3939
"@tiptap/extension-bold": "^3.13.0",

0 commit comments

Comments
 (0)