Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(docker): move the image npm to 12.1.0 and record its open advisories

Yudhi Armyndharis3602736eb4c5
diff --git a/.trivyignore b/.trivyignore
index e2700f213..fb450b9f9 100644
--- a/.trivyignore
+++ b/.trivyignore
@@ -2,39 +2,34 @@
# Everything else — anything in the application's own dependency tree, and every OS package —
# still blocks promotion (see the image-scan job in .github/workflows/release.yml).
-# CVE-2026-14257 and CVE-2026-69152 — brace-expansion ReDoS, and the follow-up that bypasses the
-# first one's mitigation. Fixed upstream in 5.0.8 and 5.0.9 respectively.
-#
-# The only copies left in the image are the ones bundled inside the npm CLI
-# (/usr/local/lib/node_modules/npm/node_modules/brace-expansion, currently 5.0.7). npm is never on
-# the request path: the entrypoint runs `node dist/main`, and npm is present only for the
-# documented operator runbooks (`docker exec openwa npm run cli …`). Reaching this code requires an
+# CVE-2026-102276 and CVE-2026-102278 (GHSA-6j4f-fj2g-mc7p, GHSA-qhr7-859c-m2p7): brace-expansion
+# denial of service through uncontrolled recursion, fixed upstream in 5.0.10 and 5.0.11.
+#
+# The only copy left in the image is the one bundled inside the npm CLI
+# (/usr/local/lib/node_modules/npm/node_modules/brace-expansion, 5.0.9 in npm 12.1.0, the newest
+# release and the one the Dockerfile installs). npm is never on the request path: the entrypoint
+# runs `node dist/main`, and npm is present only for the documented operator runbooks
+# (`docker compose run --rm openwa-api npm run migration:run:prod`). Reaching this code requires an
# operator to run an npm command with an attacker-chosen glob inside the container.
#
-# npm 12 — the newest release, already installed by the Dockerfile — still bundles 5.0.7, so there
-# is currently no npm version that clears either finding. Drop both entries once npm ships a bundle
-# with brace-expansion >= 5.0.9.
-#
-# These are ID-level ignores, so they would also silence the same CVEs in the APPLICATION tree,
+# These are ID-level ignores, so they would also silence the same CVEs in the application tree,
# which this file otherwise refuses to do. What keeps that honest is the root `overrides` entry
-# pinning brace-expansion to ^5.0.9: npm cannot resolve the application tree below the fixed
+# pinning brace-expansion to ^5.0.12: npm cannot resolve the application tree below the fixed
# version, so there is no app-tree finding for these ids to hide. Raise that floor alongside any
-# future brace-expansion advisory rather than widening this list.
-CVE-2026-14257
-CVE-2026-69152
+# future brace-expansion advisory rather than widening this list. Drop both entries once npm ships a
+# bundle with brace-expansion >= 5.0.11.
+CVE-2026-102276
+CVE-2026-102278
-# CVE-2026-69192 — ip-address SSRF-adjacent parsing flaw, fixed upstream in 10.3.1.
-#
-# Same shape as the two above: the only copy in the image is the one bundled inside the npm CLI
-# (/usr/local/lib/node_modules/npm/node_modules/ip-address, 10.2.0 in npm 12.0.2 — the newest
-# release, and what the Dockerfile installs). npm is not on the request path, so reaching it means
-# an operator running an npm command inside the container.
-#
-# The application tree is independently above the fix: package-lock.json resolves the sole
-# node_modules/ip-address at 10.4.0, and the root `overrides` entry pins `ip-address` to ^10.4.0 so
-# it cannot regress below it — the same invariant the brace-expansion note describes, which is what
-# keeps an ID-level ignore honest. Drop this entry once npm ships a bundle with ip-address >= 10.3.1.
-CVE-2026-69192
+# CVE-2026-19534 (GHSA-rfgv-xxqx-mfg5): undici denial of service, fixed upstream in 6.28.1, 7.29.1
+# and 8.10.2.
+#
+# Same shape as the entries above: the only affected copy is the one bundled inside the npm CLI
+# (/usr/local/lib/node_modules/npm/node_modules/undici, 6.28.0 in npm 12.1.0). The application tree
+# is at the fix on its own: undici is a direct dependency at ^8.10.2, which package-lock.json
+# resolves to 8.10.2, so this ID-level ignore cannot hide an application-tree finding. Drop this
+# entry once npm ships a bundle with undici >= 6.28.1.
+CVE-2026-19534
# Chromium: no entry, and the two architectures are not scanned alike.
#
@@ -57,17 +52,3 @@ CVE-2026-69192
# lockfile names it, so neither the OS nor the library scanner can see it: a clean amd64 scan says
# nothing about the browser. Its version is the pin in the Dockerfile, and no scan will flag that pin
# as outdated.
-
-# CVE-2026-73566 — node-tar denial of service via a crafted long-path archive entry, fixed
-# upstream in 7.5.21.
-#
-# Same shape as the entries above: the only copy in the image is the one bundled inside the npm CLI
-# (/usr/local/lib/node_modules/npm/node_modules/tar, 7.5.19 in the npm release the Dockerfile
-# installs). The application tree carries no tar at all, and npm is not on the request path — the
-# entrypoint runs `node dist/main`, so reaching this code means an operator running an npm command
-# against an attacker-chosen archive inside the container.
-#
-# Drop this entry once npm ships a bundle with tar >= 7.5.21. As with brace-expansion above, the
-# root `overrides` entry pins `tar` to ^7.5.21 so this ID-level ignore cannot hide an app-tree
-# finding: npm cannot resolve the application tree below the fixed version.
-CVE-2026-73566
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3a01bfba2..a7d1fceaf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -201,6 +201,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `js-yaml` 5.2.2 to 5.4.2 via an override, closing a moderate-severity CPU denial-of-service advisory. It reaches the runtime tree through `@nestjs/swagger`.
- `fast-uri` 3.1.7 to 3.1.8 via an override, closing a moderate-severity host-normalization advisory. It reaches the runtime tree through `@modelcontextprotocol/sdk`.
- `@humanfs/node` 0.16.7 to 0.16.8 in the dashboard tree, closing a moderate-severity advisory. Dev-only, so nothing that ships changes.
+- The image's npm CLI 12.0.2 to 12.1.0, clearing four advisories in its own bundled dependencies. npm is not on the request path; it runs only for the documented migration commands.
### Upgrade notes (behavior changes)
diff --git a/Dockerfile b/Dockerfile
index c5c87f5bc..bd21d6c7b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -223,14 +223,14 @@ RUN npm ci --omit=dev --ignore-scripts \
# Replace the npm the base image bundles. npm is not on the request path — the entrypoint runs
# `node dist/main` — but it stays in the image because the operator runbooks drive it
-# (`docker exec openwa npm run cli …`, `npm run export`), and its own bundled dependency tree is
-# what the release image scan reports. node:22-slim ships npm 10.9 (10.9.9 at the pinned digest),
+# (`docker compose run --rm openwa-api npm run migration:run:prod`), and its own bundled dependency
+# tree is what the release image scan reports. node:22-slim ships npm 10.9 (10.9.9 at the pinned digest),
# whose bundle has carried a critical node-tar advisory plus sigstore/picomatch ones; npm 12 fixes
# all three.
# Deliberately AFTER `npm ci`, so the application tree is still resolved by the npm the lockfile
# was generated with and only the global CLI is swapped. Pinned to the exact patch release —
# a floating npm@12 would make the image's bundled npm tree depend on when the build happened.
-RUN npm install -g [email protected] && npm cache clean --force
+RUN npm install -g [email protected] && npm cache clean --force
# amd64: download Chrome for Testing via Puppeteer and symlink it.
# arm64: use Debian's chromium installed above (a choice; see the note at that install).