Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(ci): audit the dashboard dependency tree on the PR and tag paths

Yudhi Armyndharis666e77bd362b
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 65513525e..fb5898dae 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -94,6 +94,10 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
+ # Both trees are installed below, so both lockfiles belong in the cache key.
+ cache-dependency-path: |
+ package-lock.json
+ dashboard/package-lock.json
- name: Install dependencies
run: npm ci
@@ -101,10 +105,22 @@ jobs:
- name: Security audit
# high (not critical): the `overrides` in package.json clear the root tree's HIGH advisories
# (brace-expansion CVE-2026-14257, js-yaml GHSA-pm4m-ph32-ghv5), so this threshold now fences
- # HIGH regressions instead of only catching criticals. Scoped to the root tree; the dashboard
- # carries its own `overrides` and its remaining HIGH pair (react-router) rides Dependabot.
+ # HIGH regressions instead of only catching criticals.
run: npm audit --audit-level=high
+ # The dashboard is a SECOND dependency tree, and it is the one that reaches a browser: its
+ # runtime deps are bundled into dashboard/dist, which the production image copies and serves.
+ # It went unscanned by every job in both the PR and the tag path — the image scan sees OS
+ # packages and the bundled output, not the npm graph behind it — so a HIGH advisory in a
+ # runtime dep could ride a release undetected. Audited here rather than as a step in the
+ # `dashboard` job for the same reason this job exists at all: an advisory must not abort that
+ # job's lint, typecheck, i18n, build and unit tests before they run.
+ - name: Install dashboard dependencies
+ run: cd dashboard && npm ci
+
+ - name: Security audit (dashboard)
+ run: cd dashboard && npm audit --audit-level=high
+
test:
name: Test
runs-on: ubuntu-latest
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index f7b5f0cdb..fa74a9e7f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -38,6 +38,11 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
+ # Both trees are installed in this job (the dashboard audit below), so both lockfiles
+ # belong in the cache key.
+ cache-dependency-path: |
+ package-lock.json
+ dashboard/package-lock.json
- name: Install dependencies
run: npm ci
@@ -62,6 +67,16 @@ jobs:
# PR gate, or a HIGH advisory blocked on every PR would still sail through at tag time.
run: npm audit --audit-level=high
+ # Second tree, same rule. The dashboard's runtime deps are bundled into dashboard/dist and the
+ # published image serves them to every operator's browser, so the tag path must scan them for
+ # the same reason ci.yml's audit job now does — otherwise this gate is laxer than the PR gate
+ # for exactly the dependencies that reach a user.
+ - name: Install dashboard dependencies
+ run: cd dashboard && npm ci
+
+ - name: Security audit (dashboard)
+ run: cd dashboard && npm audit --audit-level=high
+
- name: Run ESLint
run: npm run lint
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4a05dac7c..0462bc6d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
+- The dashboard's dependency tree is now audited on both the PR and the tag path. It went unscanned by every job: `npm audit` ran against the root tree only, and the image scan sees OS packages and the built bundle rather than the npm graph behind it — so a HIGH advisory in a dependency that reaches an operator's browser could ride a release undetected. Two were present at this baseline: `socket.io-parser` (bundled into `dashboard/dist` via `socket.io-client`) and `brace-expansion` (dev-only, via ESLint), the latter pinned to a vulnerable version by an override that had not been bumped. Both are now overridden to patched releases.
+
- `.env.example` shipped five keys the Infrastructure dashboard owns — `POSTGRES_BUILTIN`, `DATABASE_SSL`, `DATABASE_SSL_REJECT_UNAUTHORIZED`, `REDIS_BUILTIN` and `MINIO_BUILTIN` — uncommented, so an operator who followed the documented `cp .env.example .env` pinned them: the dashboard control still saved and reported success while the running value never changed, most consequentially leaving a Postgres connection unencrypted after the operator enabled SSL. The file's own header already promised a gate against this, but that gate only reached keys docker-compose forwards blank; it now covers every key the dashboard writes.
- Two enabled instances of one integration plugin that share a session scope no longer collapse onto a single config, so an ingress delivery authenticated with one instance's secret is no longer handled with the credentials of whichever instance was provisioned last. Dispatch now layers the instance's own config over the base config and any per-session override.
diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json
index 17c8f0e23..dd3011472 100644
--- a/dashboard/package-lock.json
+++ b/dashboard/package-lock.json
@@ -875,9 +875,6 @@
"arm64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -895,9 +892,6 @@
"arm64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -915,9 +909,6 @@
"ppc64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -935,9 +926,6 @@
"s390x"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -955,9 +943,6 @@
"x64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -975,9 +960,6 @@
"x64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1673,9 +1655,9 @@
}
},
"node_modules/brace-expansion": {
- "version": "5.0.8",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz",
- "integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==",
+ "version": "5.0.9",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
+ "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2850,9 +2832,6 @@
"arm64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -2874,9 +2853,6 @@
"arm64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -2898,9 +2874,6 @@
"x64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -2922,9 +2895,6 @@
"x64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -3579,9 +3549,9 @@
}
},
"node_modules/socket.io-parser": {
- "version": "4.2.6",
- "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.6.tgz",
- "integrity": "sha512-asJqbVBDsBCJx0pTqw3WfesSY0iRX+2xzWEWzrpcH7L6fLzrhyF8WPI8UaeM4YCuDfpwA/cgsdugMsmtz8EJeg==",
+ "version": "4.2.7",
+ "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.7.tgz",
+ "integrity": "sha512-IH/iSeO9T6gz1KkFleGDWkG9N3dl4jXVYUtMhIqH10Md0ttMer8nUNWiP1DKuNrybD2xBrixLJdCC9J6ECoYkg==",
"license": "MIT",
"dependencies": {
"@socket.io/component-emitter": "~3.1.0",
diff --git a/dashboard/package.json b/dashboard/package.json
index 318295da7..a773e155b 100644
--- a/dashboard/package.json
+++ b/dashboard/package.json
@@ -51,6 +51,7 @@
"vite": "^8.2.1"
},
"overrides": {
- "brace-expansion": "^5.0.8"
+ "brace-expansion": "^5.0.9",
+ "socket.io-parser": "^4.2.7"
}
}
diff --git a/docs/09-testing-strategy.md b/docs/09-testing-strategy.md
index 31b69a89a..c062dd548 100644
--- a/docs/09-testing-strategy.md
+++ b/docs/09-testing-strategy.md
@@ -237,7 +237,7 @@ Main CI is defined in `.github/workflows/ci.yml`.
| Job | Checks |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `lint` | backend ESLint, full-program TypeScript check, formatting, version consistency, .dockerignore context, OpenAPI snapshot, SDK routes and webhook events against the contract, contract coverage per SDK, SDK docs against the shipped client surface |
-| `audit` | dependency security audit |
+| `audit` | dependency security audit of BOTH npm trees (root and `dashboard/`) |
| `test` | backend coverage run, script unit tests (node:test), e2e smoke tests, Codecov upload |
| `test-postgres` | real PostgreSQL 16 service, backend build, migration smoke, and PostgreSQL FTS provider spec |
| `dashboard` | dashboard install, lint, formatting, type-check, i18n parity, build, unit tests |