Repository navigation
Closed
Labels
Description
Summary
The dev frontend image deletes the lockfile before installing:
# docker/frontend/Dockerfile:9
RUN rm -f package-lock.json && npm install
docker-compose.yml builds the frontend service from this file, so every dev-stack build resolves every semver range to whatever is newest on the registry at that moment. src/frontend/package-lock.json is ignored.
Context
- Origin.
7c6469742(2026-01-28, "fix: Frontend Docker build for cross-platform native binaries") replacednpm ciwith the line above. It worked around the npm optional-dependency problem: a lockfile generated on macOS arm64 could lack the linux build of native packages (rollup), sonpm cifailed inside the container. - Prod was hardened later, dev was not.
docker/frontend/Dockerfile.prod:14runsnpm ci(comment cites CSO M4). The dev file kept the workaround. - Not affected: published images (
publish-images.yml),docker-compose.prod.yml, anddeploy-dev.yml— all build fromDockerfile.prod.container-security.ymlonly renders the dev compose config, it does not build from it.
Measured on dev 13d32e22f, 2026-11-10, linux x64
rm lockfile && npm install (today) |
npm ci |
|
|---|---|---|
Installed versions that differ from package-lock.json |
119 of 447 lockfile entries | 0 of 421 |
| Versions published less than 14 days before the build | about 90 | 2 |
| Youngest installed version | about 2 hours old | 4.7 days old |
| Build | ok | ok, first try, no missing native binary |
Versions under one day old in the floating build included axios, vite, rolldown and its linux binding, marked and lilconfig.
Why it matters
- Supply chain. A hijacked release inside any semver range in the tree is installed on the next dev build, with no review and no soak time. The dev container runs as root, has network access, and bind-mounts
src/frontendread-write, so such a package can modify the contributor's checkout, and the JS it serves runs in the browser with the logged-in session. Registry signatures do not help here: a stolen maintainer account publishes validly signed packages. - Dev and release test different code. A UI result on the dev stack is not evidence about the shipped bundle, because roughly a quarter of the dependency tree is at a different version.
No compromise was observed. This is exposure to the class, found while checking a fresh dev build against current npm incident indicators.
Acceptance Criteria
-
docker/frontend/Dockerfileinstalls withnpm cifrom the committed lockfile; the lockfile is not deleted or bypassed. - The dev frontend builds on linux x64, linux arm64 and from a macOS arm64 host (the case the January workaround was written for). If a native binary is missing on one of them, the fix goes into
package-lock.json, not into bypassing it. -
src/frontend/Dockerfileis removed. Nothing builds it (already noted as stale indocs/security-reports/cso-2026-09-30.json), and it also runsnpm installwith no lockfile. - A CI guard fails when a Dockerfile in the repo installs project dependencies with
npm installinstead ofnpm ci, or removes a lockfile. Pinned global tool installs (npm install -g <pkg>@<version>) are out of scope for the guard.
Technical Notes
- Local workaround until this lands: change line 9 to
RUN npm ci, thendocker compose build --no-cache frontend && docker compose up -d --no-deps --force-recreate -V frontend. The-Vmatters:/app/node_modulesis an anonymous volume and otherwise keeps the old tree. 7c6469742also added the rollup platform binaries topackage.jsonas optional dependencies, which is probably whynpm cinow succeeds on linux x64. Not verified on arm64.- Comparison method: diff
node_modules/.package-lock.jsonin the running container againstsrc/frontend/package-lock.json; publish age from the registrytimefield per installed version.
Activity
obasilakis commentedon Nov 10, 2026
/claim
github-actions commentedon Nov 10, 2026
Claimed by @obasilakis. Label
status-in-progressadded.Next steps:
feature/4435-<short-slug>Fixes #4435fix(docker): dev frontend installs from the lockfile with npm ci (#4435…
fix(opencode): clear the 5xx-text and npm-ci guards, wire provider en…