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
14 changes: 11 additions & 3 deletions .github/actions/setup-node-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
pnpm-version:
description: pnpm version for corepack.
required: false
default: "10.23.0"
default: "10.34.7"
install-bun:
description: Whether to install Bun alongside Node.
required: false
Expand Down Expand Up @@ -52,8 +52,16 @@ runs:
if: inputs.install-bun == 'true'
uses: oven-sh/setup-bun@v2
with:
# Bun has no patched release for CVE-2026-111943. `latest` picks up a fix when one ships.
bun-version: latest

- name: Enforce Node security floor
shell: bash
run: |
bash scripts/docker/ensure-node-floor.sh
bash scripts/docker/ensure-pnpm-floor.sh
node scripts/check-advisory-floors.mjs

- name: Runtime versions
shell: bash
run: |
Expand All @@ -79,5 +87,5 @@ runs:
if [ "${{ inputs.frozen-lockfile }}" = "true" ]; then
LOCKFILE_FLAG="--frozen-lockfile"
fi
pnpm install $LOCKFILE_FLAG --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true || \
pnpm install $LOCKFILE_FLAG --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true
pnpm install $LOCKFILE_FLAG --ignore-scripts=false --config.enable-pre-post-scripts=true || \
pnpm install $LOCKFILE_FLAG --ignore-scripts=false --config.enable-pre-post-scripts=true
2 changes: 1 addition & 1 deletion .github/actions/setup-pnpm-store-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
pnpm-version:
description: pnpm version to activate via corepack.
required: false
default: "10.23.0"
default: "10.34.7"
cache-key-suffix:
description: Suffix appended to the cache key.
required: false
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.12"
check-latest: true

- name: Install detect-secrets
run: |
python -m pip install --upgrade pip
python -m pip install detect-secrets==1.5.0
python -m pip install --upgrade -r scripts/ci/requirements-detect-secrets.txt
bash scripts/docker/ensure-pip-certifi.sh

- name: Detect secrets
run: |
Expand Down Expand Up @@ -363,14 +364,21 @@ jobs:
- name: Setup pnpm + cache store
uses: ./.github/actions/setup-pnpm-store-cache
with:
pnpm-version: "10.23.0"
pnpm-version: "10.34.7"
cache-key-suffix: "node22"

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
# Bun has no patched release for CVE-2026-111943. `latest` picks up a fix when one ships.
bun-version: latest

- name: Enforce Node security floor
run: |
bash scripts/docker/ensure-node-floor.sh
bash scripts/docker/ensure-pnpm-floor.sh
node scripts/check-advisory-floors.mjs

- name: Runtime versions
run: |
node -v
Expand All @@ -389,7 +397,7 @@ jobs:
which node
node -v
pnpm -v
pnpm install --frozen-lockfile --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true || pnpm install --frozen-lockfile --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true
pnpm install --frozen-lockfile --ignore-scripts=false --config.enable-pre-post-scripts=true || pnpm install --frozen-lockfile --ignore-scripts=false --config.enable-pre-post-scripts=true

- name: Configure vitest JSON reports
if: matrix.task == 'test'
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/install-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,20 @@ jobs:
node-version: 22.x
check-latest: true

- name: Enforce Node security floor
run: |
bash scripts/docker/ensure-node-floor.sh
node scripts/check-advisory-floors.mjs

- name: Setup pnpm + cache store
uses: ./.github/actions/setup-pnpm-store-cache
with:
pnpm-version: "10.23.0"
pnpm-version: "10.34.7"
cache-key-suffix: "node22"

- name: Enforce pnpm security floor
run: bash scripts/docker/ensure-pnpm-floor.sh

- name: Install pnpm deps (minimal)
run: pnpm install --ignore-scripts --frozen-lockfile

Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/sandbox-common-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
run: |
set -euo pipefail

docker build -t openclaw-sandbox-smoke-base:bookworm-slim - <<'EOF'
FROM debian:bookworm-slim
docker build -t openclaw-sandbox-smoke-base:trixie-slim - <<'EOF'
FROM debian:trixie-slim
RUN useradd --create-home --shell /bin/bash sandbox
USER sandbox
WORKDIR /home/sandbox
Expand All @@ -43,14 +43,18 @@ jobs:
run: |
set -euo pipefail

BASE_IMAGE="openclaw-sandbox-smoke-base:bookworm-slim" \
TARGET_IMAGE="openclaw-sandbox-common-smoke:bookworm-slim" \
BASE_IMAGE="openclaw-sandbox-smoke-base:trixie-slim" \
TARGET_IMAGE="openclaw-sandbox-common-smoke:trixie-slim" \
PACKAGES="ca-certificates" \
INSTALL_PNPM=0 \
INSTALL_BUN=0 \
INSTALL_BREW=0 \
FINAL_USER=sandbox \
scripts/sandbox-common-setup.sh

u="$(docker run --rm openclaw-sandbox-common-smoke:bookworm-slim sh -lc 'id -un')"
u="$(docker run --rm openclaw-sandbox-common-smoke:trixie-slim sh -lc 'id -un')"
test "$u" = "sandbox"
ca_ver="$(docker run --rm openclaw-sandbox-common-smoke:trixie-slim dpkg-query -W -f '${Version}' ca-certificates)"
dpkg --compare-versions "$ca_ver" ge "20250419+deb13u1"
node_ver="$(docker run --rm --entrypoint /usr/local/bin/node openclaw-sandbox-common-smoke:trixie-slim -p process.versions.node)"
dpkg --compare-versions "$node_ver" ge "22.23.4"
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
allow-build-scripts=@whiskeysockets/baileys,sharp,esbuild,protobufjs,fs-ext,node-pty,@lydell/node-pty,@matrix-org/matrix-sdk-crypto-nodejs
engine-strict=true
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Docs: https://docs.openclaw.ai

### Fixes

- Security: require Node 22.23.4+, 24.22.1+, or 26.12.1+ (`engines` rejects the unfixed 23 and 25 lines). Docker images move to Debian 13 trixie (`node:22-trixie`, `debian:trixie-slim`, `golang:1.27-trixie`) and `apt-get upgrade`, then fail the build below the ca-certificates and OpenSSL floors. CI tracks `setup-node` `22.x`, pnpm 10.34.7+, Go 1.26.10+ or 1.27.3+, pip 26.2.2+, and certifi 2026.10.19+ for the eMudhra trust-store issue (CVE-2026-111943), the Node Brotli decoder fix (CVE-2026-111497), and the bookworm OpenSSL gap (CVE-2026-84782). Production dependencies move to current releases, including simple-git 4.0.2 with a default-export compatibility patch so `node-llama-cpp` still installs. The default sandbox image tag is `openclaw-sandbox:trixie-slim`. Rebuild and redeploy Fly and Render images after upgrading. Node 18 and Node 20 do not receive the Brotli fix. Bun still has no trust-store fix. Ubuntu 24.04 install images stay, with ca-certificates, OpenSSL, and curl floors. Node images replace bundled npm 10 with npm 12.2.1+ so brace-expansion, picomatch, ip-address, pacote, and sigstore meet their floors. Runtime images omit `oxlint-tsgolint` and `@typescript/native-preview`; their newest published binaries were compiled with Go 1.26.0, before the 1.26.10 trust-store floor.
- Fix types in all tests. Typecheck the whole repository.
- Voice-call: auto-end calls when media streams disconnect to prevent stuck active calls. (#18435) Thanks @JayMishra-source.
- Gateway/Channels: wire `gateway.channelHealthCheckMinutes` into strict config validation, treat implicit account status as managed for health checks, and harden channel auto-restart flow (preserve restart-attempt caps across crash loops, propagate enabled/configured runtime flags, and stop pending restart backoff after manual stop). Thanks @steipete.
Expand Down
27 changes: 24 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
FROM node:22-bookworm
FROM node:22-trixie

# Install Bun (required for build scripts)
# Track Node 22 and the distro trust store, then fail the build below the
# security floors (CVE-2026-111497, CVE-2026-111943). Bun has no trust-store
# fix yet, so its installer runs only after ca-certificates is current.
COPY scripts/docker/ensure-ca-certificates.sh /usr/local/bin/openclaw-ensure-ca-certificates
COPY scripts/docker/ensure-node-floor.sh /usr/local/bin/openclaw-ensure-node-floor
COPY scripts/docker/ensure-npm-floor.sh /usr/local/bin/openclaw-ensure-npm-floor
COPY scripts/docker/remove-unpatched-go-prebuilts.sh /usr/local/bin/openclaw-remove-unpatched-go-prebuilts
RUN chmod +x /usr/local/bin/openclaw-ensure-ca-certificates /usr/local/bin/openclaw-ensure-node-floor \
/usr/local/bin/openclaw-ensure-npm-floor /usr/local/bin/openclaw-remove-unpatched-go-prebuilts \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y upgrade \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates \
&& openclaw-ensure-ca-certificates \
&& openclaw-ensure-node-floor \
&& openclaw-ensure-npm-floor \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

# Install Bun (required for build scripts). No eMudhra trust-store fix exists yet.
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:${PATH}"

Expand All @@ -11,6 +29,7 @@ WORKDIR /app
ARG OPENCLAW_DOCKER_APT_PACKAGES=""
RUN if [ -n "$OPENCLAW_DOCKER_APT_PACKAGES" ]; then \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $OPENCLAW_DOCKER_APT_PACKAGES && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*; \
Expand All @@ -30,6 +49,7 @@ RUN pnpm install --frozen-lockfile
ARG OPENCLAW_INSTALL_BROWSER=""
RUN if [ -n "$OPENCLAW_INSTALL_BROWSER" ]; then \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends xvfb && \
node /app/node_modules/playwright-core/cli.js install --with-deps chromium && \
apt-get clean && \
Expand All @@ -41,14 +61,15 @@ RUN pnpm build
# Force pnpm for UI build (Bun may fail on ARM/Synology architectures)
ENV OPENCLAW_PREFER_PNPM=1
RUN pnpm ui:build
RUN openclaw-remove-unpatched-go-prebuilts /app/node_modules && pnpm store prune

ENV NODE_ENV=production

# Allow non-root user to write temp files during runtime/tests.
RUN chown -R node:node /app

# Security hardening: Run as non-root user
# The node:22-bookworm image includes a 'node' user (uid 1000)
# The node:22-trixie image includes a 'node' user (uid 1000)
# This reduces the attack surface by preventing container escape via root privileges
USER node

Expand Down
18 changes: 15 additions & 3 deletions Dockerfile.sandbox
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
FROM debian:bookworm-slim
FROM debian:trixie-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
COPY scripts/docker/ensure-ca-certificates.sh /usr/local/bin/openclaw-ensure-ca-certificates
COPY scripts/docker/ensure-pip-certifi.sh /usr/local/bin/openclaw-ensure-pip-certifi
COPY scripts/docker/requirements-pip-certifi.txt /tmp/requirements-pip-certifi.txt

# Python stdlib uses the distro trust store. pip and certifi ship their own
# bundles, so install at least the patched floors (CVE-2026-111943).
RUN chmod +x /usr/local/bin/openclaw-ensure-ca-certificates /usr/local/bin/openclaw-ensure-pip-certifi \
&& apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y --no-install-recommends \
bash \
ca-certificates \
curl \
git \
jq \
python3 \
python3-pip \
ripgrep \
&& rm -rf /var/lib/apt/lists/*
&& openclaw-ensure-ca-certificates \
&& python3 -m pip install --break-system-packages --ignore-installed --upgrade -r /tmp/requirements-pip-certifi.txt \
&& openclaw-ensure-pip-certifi \
&& rm -rf /var/lib/apt/lists/* /tmp/requirements-pip-certifi.txt

RUN useradd --create-home --shell /bin/bash sandbox
USER sandbox
Expand Down
28 changes: 25 additions & 3 deletions Dockerfile.sandbox-browser
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
FROM debian:bookworm-slim
# noVNC pulls Debian nodejs 18, which never receives the Brotli fix.
# Keep that package for the dependency, then replace the binary with the
# official Node 22 image and fail the build below the floor.
ARG NODE_IMAGE=node:22-trixie-slim
FROM ${NODE_IMAGE} AS node_runtime
FROM debian:trixie-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
COPY --from=node_runtime /usr/local/bin/node /usr/local/bin/node
COPY scripts/docker/ensure-ca-certificates.sh /usr/local/bin/openclaw-ensure-ca-certificates
COPY scripts/docker/ensure-node-floor.sh /usr/local/bin/openclaw-ensure-node-floor
COPY scripts/docker/ensure-pip-certifi.sh /usr/local/bin/openclaw-ensure-pip-certifi
COPY scripts/docker/requirements-pip-certifi.txt /tmp/requirements-pip-certifi.txt

RUN chmod +x /usr/local/bin/openclaw-ensure-ca-certificates \
/usr/local/bin/openclaw-ensure-node-floor \
/usr/local/bin/openclaw-ensure-pip-certifi \
&& apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y --no-install-recommends \
bash \
ca-certificates \
Expand All @@ -14,11 +29,18 @@ RUN apt-get update \
jq \
novnc \
python3 \
python3-pip \
socat \
websockify \
x11vnc \
xvfb \
&& rm -rf /var/lib/apt/lists/*
&& ln -sf /usr/local/bin/node /usr/bin/node \
&& ln -sf node /usr/bin/nodejs \
&& openclaw-ensure-ca-certificates \
&& openclaw-ensure-node-floor \
&& python3 -m pip install --break-system-packages --ignore-installed --upgrade -r /tmp/requirements-pip-certifi.txt \
&& openclaw-ensure-pip-certifi \
&& rm -rf /var/lib/apt/lists/* /tmp/requirements-pip-certifi.txt

COPY scripts/sandbox-browser-entrypoint.sh /usr/local/bin/openclaw-sandbox-browser
RUN chmod +x /usr/local/bin/openclaw-sandbox-browser
Expand Down
57 changes: 49 additions & 8 deletions Dockerfile.sandbox-common
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
ARG BASE_IMAGE=openclaw-sandbox:bookworm-slim
ARG BASE_IMAGE=openclaw-sandbox:trixie-slim
ARG NODE_IMAGE=node:22-trixie-slim
ARG GO_IMAGE=golang:1.27-trixie
FROM ${NODE_IMAGE} AS node_runtime
FROM ${GO_IMAGE} AS go_runtime
FROM ${BASE_IMAGE}

USER root

ENV DEBIAN_FRONTEND=noninteractive

ARG PACKAGES="curl wget jq coreutils grep nodejs npm python3 git ca-certificates golang-go rustc cargo unzip pkg-config libasound2-dev build-essential file"
# Debian's nodejs and golang-go packages lag the security floors. Copy the
# official Node 22 and Go 1.27 toolchains, then fail the build if they are
# below the floors. Debian rustc/cargo stay on the distro packages and use
# the system trust store. Bun has no patched release yet.
ARG PACKAGES="curl wget jq coreutils grep python3 git ca-certificates rustc cargo unzip pkg-config libasound2-dev build-essential file"
ARG INSTALL_PNPM=1
ARG INSTALL_BUN=1
ARG BUN_INSTALL_DIR=/opt/bun
Expand All @@ -17,13 +25,47 @@ ENV BUN_INSTALL=${BUN_INSTALL_DIR}
ENV HOMEBREW_PREFIX=${BREW_INSTALL_DIR}
ENV HOMEBREW_CELLAR=${BREW_INSTALL_DIR}/Cellar
ENV HOMEBREW_REPOSITORY=${BREW_INSTALL_DIR}/Homebrew
ENV PATH=${BUN_INSTALL_DIR}/bin:${BREW_INSTALL_DIR}/bin:${BREW_INSTALL_DIR}/sbin:${PATH}
ENV PATH=${BUN_INSTALL_DIR}/bin:${BREW_INSTALL_DIR}/bin:${BREW_INSTALL_DIR}/sbin:/usr/local/go/bin:${PATH}

RUN apt-get update \
&& apt-get install -y --no-install-recommends ${PACKAGES} \
&& rm -rf /var/lib/apt/lists/*
# node is a real binary. npm, npx, and corepack are symlinks into
# /usr/local/lib/node_modules; copying those paths follows the link and
# breaks npm's relative require('../lib/cli.js'). Recreate the links.
COPY --from=node_runtime /usr/local/bin/node /usr/local/bin/node
COPY --from=node_runtime /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=go_runtime /usr/local/go /usr/local/go
RUN ln -sf ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& ln -sf ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \
&& ln -sf ../lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack

RUN if [ "${INSTALL_PNPM}" = "1" ]; then npm install -g pnpm; fi
COPY scripts/docker/ensure-ca-certificates.sh /usr/local/bin/openclaw-ensure-ca-certificates
COPY scripts/docker/ensure-node-floor.sh /usr/local/bin/openclaw-ensure-node-floor
COPY scripts/docker/ensure-npm-floor.sh /usr/local/bin/openclaw-ensure-npm-floor
COPY scripts/docker/ensure-go-floor.sh /usr/local/bin/openclaw-ensure-go-floor
COPY scripts/docker/ensure-pip-certifi.sh /usr/local/bin/openclaw-ensure-pip-certifi
COPY scripts/docker/ensure-pnpm-floor.sh /usr/local/bin/openclaw-ensure-pnpm-floor
COPY scripts/docker/requirements-pip-certifi.txt /tmp/requirements-pip-certifi.txt

RUN chmod +x /usr/local/bin/openclaw-ensure-ca-certificates \
/usr/local/bin/openclaw-ensure-node-floor \
/usr/local/bin/openclaw-ensure-npm-floor \
/usr/local/bin/openclaw-ensure-go-floor \
/usr/local/bin/openclaw-ensure-pip-certifi \
/usr/local/bin/openclaw-ensure-pnpm-floor \
&& apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y --no-install-recommends ca-certificates ${PACKAGES} \
&& openclaw-ensure-ca-certificates \
&& openclaw-ensure-node-floor \
&& openclaw-ensure-npm-floor \
&& openclaw-ensure-go-floor \
&& if command -v python3 >/dev/null 2>&1; then \
apt-get install -y --no-install-recommends python3-pip \
&& python3 -m pip install --break-system-packages --ignore-installed --upgrade -r /tmp/requirements-pip-certifi.txt \
&& openclaw-ensure-pip-certifi; \
fi \
&& rm -rf /var/lib/apt/lists/* /tmp/requirements-pip-certifi.txt

RUN if [ "${INSTALL_PNPM}" = "1" ]; then npm install -g pnpm && openclaw-ensure-pnpm-floor; fi

RUN if [ "${INSTALL_BUN}" = "1" ]; then \
curl -fsSL https://bun.sh/install | bash; \
Expand All @@ -42,4 +84,3 @@ fi

# Default is sandbox, but allow BASE_IMAGE overrides to select another final user.
USER ${FINAL_USER}

Loading
Loading