Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
node-version-file: .nvmrc
cache: npm

# --ignore-scripts skips the better-sqlite3 native build, which
# --ignore-scripts skips every dependency install script, which
# eslint/prettier/stylelint do not need.
- name: Install dependencies (no native builds)
run: npm ci --ignore-scripts
Expand Down
27 changes: 16 additions & 11 deletions Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ FROM node:26-slim

WORKDIR /app

# Fail the build on a runtime that predates the October 2026 Node.js security
# Fail the build on a runtime that predates the November 2026 Node.js security
# release instead of shipping a stale node:26-slim from the layer cache.
# 26.12.1 fixes the Brotli decoder out-of-bounds write (CVE-2026-111497), the
# TLS certificate hostname bypasses (CVE-2026-106069, CVE-2026-105483,
# CVE-2026-106072) and the dns.resolve NUL truncation (CVE-2026-105482), all of
# which are reachable through the outbound calls to Paperless-ngx and the AI
# providers.
ARG MIN_NODE_VERSION=26.12.1
# 26.13.1 fixes the HTTP parser re-entry on empty writes (CVE-2026-123864), SNI
# changes through TLS resumption and renegotiation (CVE-2026-123872), a
# remotely reachable TLS crash (CVE-2026-126051) and the shared https.Agent TLS
# policy keys (CVE-2026-123877). It includes the October release 26.12.1 with
# the Brotli decoder out-of-bounds write (CVE-2026-111497), the TLS certificate
# hostname bypasses (CVE-2026-106069, CVE-2026-105483, CVE-2026-106072) and the
# dns.resolve NUL truncation (CVE-2026-105482). All of them are reachable
# through the outbound calls to Paperless-ngx and the AI providers.
ARG MIN_NODE_VERSION=26.13.1
RUN MIN_NODE_VERSION="${MIN_NODE_VERSION}" node -e "const parse=(v)=>v.split('.').map(Number); const [a,b,c]=parse(process.versions.node); const [x,y,z]=parse(process.env.MIN_NODE_VERSION); if (a<x || (a===x && (b<y || (b===y && c<z)))) { console.error('Node '+process.versions.node+' predates the required security release '+process.env.MIN_NODE_VERSION); process.exit(1); }"

# Install system dependencies including build tools for better-sqlite3 and
# poppler-utils (pdftoppm/pdfinfo) for multi-page PDF OCR rendering
# Install system dependencies: poppler-utils (pdftoppm/pdfinfo) for multi-page
# PDF OCR rendering, plus python3, make and g++ as build tools for native
# modules. better-sqlite3 no longer needs them since v13 (prebuilt binaries).
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
Expand All @@ -37,8 +41,9 @@ RUN npm install pm2 -g
COPY package*.json ./

# Install node dependencies with clean install using cache mount
# npm >= 12 blocks dependency install scripts unless allowlisted via
# the "allowScripts" field in package.json (needed for better-sqlite3)
# npm >= 12 runs dependency install scripts only when "allowScripts" in
# package.json allows them. better-sqlite3 is denied on purpose: v13 loads the
# prebuilt binary it ships, and its implicit node-gyp step is not needed.
RUN --mount=type=cache,target=/root/.npm \
npm ci --omit=dev

Expand Down
Loading