fix(security): scope glob and minimatch overrides to affected parents

This commit is contained in:
victorsteele428 committed 2026-11-22 14:33:36 +00:00
1 parent 43eee54e7a
commit 66cfed5a8b
25 files changed
+331 -138

No files matched your search

+1
View File
@@ -13,5 +13,6 @@ This is the chronological **index**. Phase-specific scope/implementation evidenc
| 2026-11-22 | P05-CI-02 | Narrow Auth.js TS2345 fix, CI negative tests, advisory triage and post-run portless override | Run #83: Account/Login/Security PASS, Docker FAIL on host 8080; cleanup PASS; portless override unverified. [Evidence](P05-CI-02.md) |
| 2026-11-22 | P05-CI-03 | Backend-only Gitea verification of portless Compose, 4 services, Postgres persistence, OIDC/JWKS and safe cleanup | **Run #86 SUCCESS** on `03fb589`, no unrelated suites rerun; [evidence](P05-CI-03.md) |
| 2026-11-22 | P05-SEC-01 | Next.js 16.4.6, compatible OTel instrumentation, frozen locks and strict advisory gates | Run #87: 3 PASS/1 FAIL; 17/19 prior findings no longer reported, 2 Moderate Login blockers. [Evidence](P05-SEC-01.md) |
| 2026-11-22 | P05-SEC-02 | Seven exact parent overrides for glob/minimatch, pinned PNPM lock metadata and focused Login-only CI | Source prepared, one CI acceptance run pending. [Plan/evidence](P05-SEC-02.md) |
Rules: Append new phases or fixes; never silently rewrite a past result. Separate **implemented**, **verified**, **blocked**, and **proposed**. Never log a user secret or personal data.
+1
View File
@@ -9,6 +9,7 @@
| [P05-CI-02.md](P05-CI-02.md) | Auth.js narrow patch, isolated Gitea CI gate, advisory triage and exact acceptance evidence | P05-CI-02 / run #83 completed; residual Docker gate blocked |
| [P05-CI-03.md](P05-CI-03.md) | Backend-only pre-change scope, disposable CI run evidence and exact acceptance result | P05-CI-03 / Run #86 SUCCESS; acceptance complete |
| [P05-SEC-01.md](P05-SEC-01.md) | Pre-change security scope, remediation, exact advisory evidence, one CI run and closure | P05-SEC-01 / Run #87 completed, 2 Moderate open |
| [P05-SEC-02.md](P05-SEC-02.md) | Exact root chain, seven PNPM parent overrides, one focused Gitea CI and closure evidence | P05-SEC-02 / source prepared, run pending |
| [CHANGELOG.md](CHANGELOG.md) | Short append-only chronological phase log and links to detailed reports | DOCS-01 / active |
Update this manifest whenever any direct child file or directory changes. Use **actual source state**; a planned file must be labeled planned, not present.
+34
View File
@@ -0,0 +1,34 @@
# ZitPlane P05-SEC-02 — Final Transitive Dependency Remediation
**Date:** 2026-11-22
**Approved baseline:** `43eee54e7ad6b647e38491ac4dc28703547cf410`
**Prior evidence:** Gitea Run [#87](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/87): 3 PASS / 1 FAIL, Login security 2 Moderate; Account vulnerability audit 0; Login frozen install + production build + 1219/1219 unit tests PASS.
**State:** APPROVED / PRE-CHANGE SCOPE LOCK — no P05-SEC-02 source edits yet.
## Exact approved Scope Lock
Allowed source writes: `auth/ui/v2/pnpm-workspace.yaml`, `auth/ui/v2/pnpm-lock.yaml`, and only if justified `auth/ui/v2/package.json`, `auth/ui/v2/apps/login/package.json`; narrowly related `.gitea/workflows/p05-security-acceptance.yml`, `tests/ci/**`; `notes/**`, `project/**`, relevant `docs/**` and applicable README/MINIFEST.
Read-only: original official Login V2 application/auth/UI source, `users/ui/**`, `core/backend/zitadel/**`, `deployment/docker/**`, other packages, production configuration, secrets and unrelated files. Preserve untracked `AI_INSTRUCTIONS.md`.
No local application builds, installs, tests, dev servers or Docker. **Only a pinned pnpm metadata-only lockfile reconciliation is authorized locally**; do not install dependencies, run application code, or rewrite extra files. Exactly **one** focused Gitea CI cycle after source commit/push; no repeated loops. Record actual PASS/FAIL, cleanup and remote SHA.
## Pre-edit exact root-cause proof (read-only source lock + live npm registry metadata)
**Advisories:**
1. `GHSA-3g3m-2fjr-6pw4` — vulnerable `glob@10.5.0`, advisory affected >=9.0.0 <=14.0.1, patched >=14.0.2. Current graph only **2 direct vulnerable edges**: `rimraf@5.0.10 → glob@10.5.0` (parent range `^10.3.7`), `archiver-utils@5.0.2 → glob@10.5.0` (parent range `^10.0.0`). An additional `glob@10.5.0 → minimatch@9.0.9` edge will disappear when its parent is no longer installed.
2. `GHSA-g3hv-75wg-m249` — vulnerable `minimatch@10.2.5/10.2.6` and `minimatch@9.0.9` through old glob, affected >=7.0.0 <11.0.1, patched >=11.0.1. Five direct pinned edges: `@eslint/config-array@0.23.5 → minimatch@10.2.6` (range `^10.2.4`), `@typescript-eslint/typescript-estree@8.67.0 → minimatch@10.2.6` (range `^10.2.2`), `eslint@10.8.1 → minimatch@10.2.6` (range `^10.2.5`), `nodemon@3.1.14 → minimatch@10.2.6` (range `^10.2.1`), `nx@22.7.12 → minimatch@10.2.5` (exact `10.2.5`).
**Registry candidate patch:** `glob@14.0.6` is published; Node engine `18 || 20 || >=22`, depends on `minimatch@^11.0.5`. `minimatch@11.0.9` is published; Node engine `20 || >=22`. Gitea runner is Node 22. Both exports include CommonJS/ESM support. **Semver-major compatibility is a risk**, not guaranteed; only new frozen install/build/unit/security CI validates it. No blind global `glob@<14>glob` or global `minimatch@<11>` override.
## Narrow proposed patch and plan (must be completed only after this note)
1. Insert exactly **7 direct parent-scoped PNPM workspace overrides**: `rimraf@5.0.10>glob`, `archiver-utils@5.0.2>glob` pinned `14.0.6`; `@eslint/config-array@0.23.5>minimatch`, `@typescript-eslint/typescript-estree@8.67.0>minimatch`, `eslint@10.8.1>minimatch`, `nodemon@3.1.14>minimatch`, `nx@22.7.12>minimatch` pinned `11.0.9`. Preserve all existing workspace members/overrides and Login/application manifests.
2. Run only `pnpm@10.30.3 install --lockfile-only --ignore-scripts` with frozen lock disabled to regenerate reproducible PNPM v9 metadata. No project node_modules. Confirm **no old vulnerable versions/edges remain**, unchanged importers and exactly seven scoped overrides.
3. Use existing dedicated manual Gitea security acceptance workflow's pinned PNPM frozen install, Login Nx production build, upstream Vitest and HIGH/CRITICAL plus strict **zero Moderate/High/Critical** live audit. If needed, narrowly scope this single run to Login jobs without changing production/app logic; do not claim full acceptance on source appearance alone.
4. Exact source/security diff audit; update docs, notes, project manifests; commit, push Gitea main; dispatch **one** focused CI run. Document tested source SHA, all job results and any remaining failing advisories/blockers honestly; final docs-only commit/push and remote verification.
## Acceptance contract
PASS only when exact vulnerable `glob/minimatch` resolved versions are absent from lock, pinned PNPM **frozen install PASS**, official Login V2 Nx production build and targeted upstream unit regressions PASS, and live Login **pnpm audit --prod** reports **zero Moderate/High/Critical**. A blocking failure is documented, never bypassed. Account security previously zero in Run #87; authenticated OIDC/MFA/production are separate phases.
**Execution evidence:** PENDING source patch and one Gitea CI run.