Files
ZitPlane/docs/P05-SEC-02.md
T

43 lines
5.0 KiB
Markdown
Raw Normal View History

# P05-SEC-02 — Login Transitive Security Remediation
**Date:** 2026-11-22
**Approved baseline:** `43eee54e7ad6b647e38491ac4dc28703547cf410`
**Status:** **Run #88 overall FAILURE**: Login live security audit PASS (0 Moderate/High/Critical); frozen install/build/units blocked by CI helper false-positive. Post-run source-only regex correction not CI-verified.
## Purpose
Resolve the two previously reproduced Login workspace Moderate dependency advisories while preserving the **original ZITADEL Login V2** UI, authentication logic, backend and Account Portal unchanged. This is dependency hygiene, not a feature/UI redesign or production deployment.
## Exact source-level resolution
Prior [Gitea Run #87](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/87) passed Account security 0 advisories, Login pinned frozen install/build and **1,219/1,219 unit tests**, but failed Login security gate on:
| Advisory | Affected parent-to-child path | Fixed resolution | What it addresses |
| --- | --- | --- | --- |
| `GHSA-3g3m-2fjr-6pw4` | `rimraf@5.0.10 → glob@10.5.0` | `glob@14.0.6` | Unbounded work after cancelled glob traversal |
| Same | `archiver-utils@5.0.2 → glob@10.5.0` | `glob@14.0.6` | Same vulnerable package |
| `GHSA-g3hv-75wg-m249` | `@eslint/config-array@0.23.5 → minimatch@10.2.6` | `minimatch@11.0.9` | Path-pattern match amplification |
| Same | `@typescript-eslint/typescript-estree@8.67.0 → minimatch@10.2.6` | `minimatch@11.0.9` | Same vulnerable package |
| Same | `eslint@10.8.1 → minimatch@10.2.6` | `minimatch@11.0.9` | Same vulnerable package |
| Same | `nodemon@3.1.14 → minimatch@10.2.6` | `minimatch@11.0.9` | Same vulnerable package |
| Same | `nx@22.7.12 → minimatch@10.2.5` | `minimatch@11.0.9` | Same vulnerable package |
Both selected fixed versions are published and support Node 22. The exact 7 parent-specific PNPM overrides are in `auth/ui/v2/pnpm-workspace.yaml`; `auth/ui/v2/pnpm-lock.yaml` is generated using **pnpm 10.30.3 lockfile-only**, no local application dependency installation or executable build. The former `glob@10.5.0 → minimatch@9.0.9` edge disappears once the vulnerable glob is replaced. Non-vulnerable `minimatch@3.1.5` and `5.1.9` remain on purpose.
**Compatibility caveat:** These are deliberate semver-major *transitive* replacements scoped narrowly to exact parents. They are **not** declared safe without a real Gitea frozen installation, build, upstream unit suite and registry audit. Source snapshot closure alone is not an acceptance PASS.
## CI verification
In Gitea Actions choose the existing **ZitPlane P05 Dependency Security Acceptance (SEC-01/02)** workflow and manually dispatch `main` with the **`login_only=true`** input for this phase.
The workflow preserves default `login_only=false` (full previous Account + Login jobs) but this selected run must skip the previously accepted Account jobs. It first checks exact seven parent-selector contracts using `tests/ci/transitive_override_contract.py`, then `pnpm@10.30.3 install --frozen-lockfile`, Nx proto/client/Login production standalone build, upstream Vitest regressions, and independent **fail-closed** Login `pnpm audit --prod` High/Critical and zero Moderate+ gates.
**Acceptance requires all of:** Login-only build job PASS, frozen install and correct pinned overrides, all focused upstream unit tests PASS, live Login audit **0 Moderate, 0 High, 0 Critical**, exact evidence and source-only patch audit.
## Explicit exclusions
No `users/ui/**` changes, original Login source/route/callback/UI changes, Go backend or developer Compose, real users/credentials, local application test/build, production deployment, tags or release. Login/Account authenticated OIDC callback and MFA end-to-end acceptance remain future scope. Existing untracked `AI_INSTRUCTIONS.md` is preserved.
## Real Gitea acceptance ledger
**ACTUAL RUN #88:** [Gitea Actions](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/88) tested source commit `66cfed5a8b6bd5845b229c9934695e307f9a0775`, `login_only=true`, overall **FAILURE**. Account build (#189) and Account security (#191) intentionally SKIPPED. Login build (#190) FAILED *before* frozen install: new CI validator treated existing `axios@>=...`, `brace-expansion@>=...`, `esbuild@>=...` version ranges as parent selectors due a broad `>` regex. Thus **frozen PNPM install, Next.js standalone build, and upstream unit tests NOT RUN**. Login production security (#192) **PASS**: `pnpm audit --prod` found **zero Moderate/High/Critical**, `PNPM_ADVISORY_RECORDS=0`, `ZITPLANE_PNPM_ZERO_MODERATE_HIGH_CRITICAL_PASS`. The seven parent-scoped glob/minimatch patches eliminated the two previously reported findings from the current registry audit, but their **build/runtime compatibility remains unverified**. After Run #88, narrowed the validator regex to match only `>glob` or `>minimatch` package selectors; **this correction was not tested by CI**. No second run. Full P05-SEC-02 acceptance remains **BLOCKED**; separately approve focused build/unit acceptance using the post-correction SHA. See `notes/P05-SEC-02.md` and `project/DEPENDENCY-SECURITY.md`.