Files

55 lines
7.8 KiB
Markdown
Raw Permalink Normal View History

# 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:** SOURCE PATCH IMPLEMENTED; Run #88 security audit PASS (0 findings), Login build acceptance BLOCKED by CI helper regex false-positive; post-run narrow parser fix **not CI-verified**. Exactly one run.
## 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:** One Gitea Run #88 completed with 0 Moderate/High/Critical security findings; frozen Login install/build/unit job blocked by helper parsing defect. Detailed terminal evidence appears below.
## Run #88 terminal evidence and targeted follow-up scope — 2026-11-22
**Gitea Run:** https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/88
**Tested Gitea source commit:** `66cfed5a8b6bd5845b229c9934695e307f9a0775`.
**Source tree:** `9a1d2abd803f20cd05e428541483c1fa390e14d9`, identical to local source commit `b418442d3a1bf6b6e7e96d4495ea9dc8625d08d3`.
**Execution:** one `workflow_dispatch` with `login_only=true`, started 2026-11-22 14:34:04 UTC, terminal 14:34:35 UTC. **Overall FAILURE**, not full acceptance.
| Job | ID | Terminal result | Proven facts |
| --- | ---: | --- | --- |
| Account build | 189 | **SKIPPED intentionally** | Account previously passed Run #87; focus limited to Login |
| Login frozen/build/unit | 190 | **FAILED before install** | Checkout PASS. New `transitive_override_contract.py` falsely classified existing version-range keys (`axios@>=...`, `brace-expansion@>=...`, `esbuild@>=...`) as parent overrides because its regex merely matched a `>` character. `ZITPLANE_TRANSITIVE_OVERRIDE_CONTRACT_FAIL`; no PNPM frozen install/build/unit tests executed in this run |
| Account security | 191 | **SKIPPED intentionally** | Run #87 Account production audit zero |
| Login production security | 192 | **PASS** | `pnpm audit --prod` returned **No known vulnerabilities found**; `PNPM_ADVISORY_RECORDS=0`, Moderate=0, High=0, Critical=0, `ZITPLANE_PNPM_ZERO_MODERATE_HIGH_CRITICAL_PASS` |
**True root cause of CI failure:** the new helper's selector regex must match **an exact trailing `>glob` or `>minimatch` package dependency**, not incidental `>`/ `>=` within existing range keys. The PNPM lockfile itself is not the reason this job failed. A **narrow source-only correction** in `tests/ci/transitive_override_contract.py` is justified; current locked seven parent selectors, dependency versions, application manifests, auth code, and Gitea security gate must remain unchanged.
**No second CI run in P05-SEC-02.** The post-run regex correction will be recorded as **NOT CI-VERIFIED**. Security advisory clearance is CI-verified (0/0/0); **frozen install, Login build and 1219 unit-regression compatibility for patched transitive majors remain BLOCKED/UNVERIFIED**. Full phase acceptance must wait for a separately approved narrow CI re-verification phase. Any future test must use the latest post-correction source commit, not claim Run #88 tested it.
**Transport note:** Windows Git HTTPS push returned authentication failure even though prior cached credentials worked. The connected Gitea integration committed all 25 approved source files atomically; **remote/local Git tree IDs were compared and matched exactly**. No credentials printed, replaced or committed. Gitea remote commit SHA differs from local Git commit SHA due the independent authenticated commit transport. Preserve untracked `AI_INSTRUCTIONS.md`.