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 -1
View File
@@ -18,7 +18,7 @@ Snapshot: 2026-11-22, **Gitea P05-CI-03 Run #86 backend-only SUCCESS** on `03fb5
| Global ZITADEL SSO logout | No | N/A | No |
| Subscriptions, payments and SaaS billing | Outside ZitPlane scope | N/A | No |
| Gitea Actions CI verification workflow | Yes, P05 manual dispatch | Run #83 baseline, Run #86 backend SUCCESS, Run #87 3 PASS/1 FAIL (2 Moderate Login advisories) | Not deployed |
| Dependency Moderate security patch/acceptance | Account/Login Next.js and OTel patched manifests/locks, strict CI acceptance | Run #87: Account 0, Login 2 Moderate (`glob`, `minimatch`), High/Critical 0; **security acceptance BLOCKED** | Not deployed |
| Dependency Moderate security patch/acceptance | Account/Login Next.js/OTel patched in P05-SEC-01; P05-SEC-02 exact seven scoped glob/minimatch override candidates | Run #87: Account 0, Login 2 Moderate; **P05-SEC-02 frozen/build/audit CI pending**, so full clearance NOT YET VERIFIED | Not deployed |
| Gitea Actions CI and isolated integration tests | Backend-only workflow; interactive identity E2E remains absent | **Run #86 PASS:** disposable backend OIDC ready/discovery/JWKS, Postgres persistence, cleanup; authenticated user E2E pending | No |
| Coolify production stack, TLS, routing and backups | No | No | No |
| Public `auth.vib.tools/login` URL | Proposed only | No | No |
+1
View File
@@ -11,6 +11,7 @@ Every file listed below is a direct child of `docs/`. Add/remove rows whenever t
| [P05-CI-02.md](P05-CI-02.md) | TypeScript remediation, Gitea CI verification, dependency risk and isolation evidence | P05-CI-02 / run #83 done; Docker acceptance blocked |
| [P05-CI-03.md](P05-CI-03.md) | Isolated backend-only Gitea CI procedure, checks and exact run outcomes | P05-CI-03 / Run #86 SUCCESS |
| [P05-SEC-01.md](P05-SEC-01.md) | Source-grounded dependency security patches, advisory blockers and CI verification | P05-SEC-01 / Run #87 3 PASS/1 FAIL, 2 Moderate open |
| [P05-SEC-02.md](P05-SEC-02.md) | Seven scoped PNPM parent overrides, patched lock and manual Login-only security CI evidence | P05-SEC-02 / run pending |
| [SETUP-GUIDE.md](SETUP-GUIDE.md) | Operator/developer prerequisites, configs, activation and safety | DOCS-01 / active; runtime pending |
| [FEATURES-STATUS.md](FEATURES-STATUS.md) | Exact implemented/unavailable/unverified feature matrix | DOCS-01 / active |
| [TROUBLESHOOTING.md](TROUBLESHOOTING.md) | Known blockers and safe diagnosis based on source status | DOCS-01 / active |
+43
View File
@@ -0,0 +1,43 @@
# P05-SEC-02 — Login Transitive Security Remediation
**Date:** 2026-11-22
**Approved baseline:** `43eee54e7ad6b647e38491ac4dc28703547cf410`
**Status:** Targeted source patch prepared; **one Gitea security acceptance run pending**.
## 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
**PENDING:** one focused run, tested source SHA, actual Login build/unit/security jobs, distinct skipped Account jobs, audit counts and cleanup/evidence. **Do not claim zero advisories before terminal CI evidence.** Detailed pre-edit root-cause proof and implementation log: `notes/P05-SEC-02.md`. Dependency source map: `project/DEPENDENCY-SECURITY.md`.
+6
View File
@@ -59,6 +59,12 @@ Implement one explicitly approved phase at a time. Keep out-of-scope files, exis
- Direct Next.js pinned 16.4.6; Login coordinated OTel auto-instrumentation 0.80.0 / SDK 0.222.0 family, PNPM/npm metadata-only lockfile reconciliation. Root overrides are read-only, so glob14/minimatch11 major transitive remediation remains an explicit blocker if registry audit reproduces it.
- **Gitea Run #87**, tested SHA `752d243ae8fb24ce3cfa990343082e2d0431306b`: 3 job PASS (Account npm frozen typecheck/build/anonymous regressions, Login pnpm frozen Nx build + 1219/1219 unit tests, Account security 0), Login security FAIL on 2 Moderate transitive advisories (`glob` and `minimatch`), High/Critical 0. Prior 19 reported records reduced to 2; **full security acceptance BLOCKED**. Only one CI run, no local app build/test/dev server, no backend/production change. Exact result: `notes/P05-SEC-01.md`, `docs/P05-SEC-01.md`.
## P05-SEC-02 - Final Transitive Dependency Remediation (APPROVED 2026-11-22)
- Baseline `43eee54e7ad6b647e38491ac4dc28703547cf410`; prior Gitea Run #87: 3 PASS/1 FAIL, only 2 Login Moderate GHSA (`glob`/`minimatch`) remaining, Account audit 0.
- Exact Scope Lock: `auth/ui/v2/pnpm-workspace.yaml`, `pnpm-lock.yaml`, justified root or Login dependency manifests only, `.gitea/workflows/p05-security-acceptance.yml`, focused `tests/ci/**`, notes/project/docs and associated README/MINIFEST. **Login/auth/UI source, users/ui/**, Go backend, developer Compose, other packages and production READ-ONLY.** Preserve untracked AI_INSTRUCTIONS.md.
- Seven **exact parent-scoped** overrides: two glob10 parents → glob14.0.6, five minimatch10 parents → minimatch11.0.9. No broad global major override; pinned PNPM 10.30.3 metadata-only lockfile regeneration; compatibility subject to CI proof.
- Existing Gitea security workflow `workflow_dispatch.inputs.login_only=true`: skip previously accepted Account jobs; focused Login pinned frozen install, exact resolution contract, Nx production build + upstream Vitest, live fail-closed High/Critical and zero Moderate+ audit. **Exactly one CI cycle**, no local app builds/tests, no production deployment. Final evidence: `notes/P05-SEC-02.md` and `docs/P05-SEC-02.md`.
## P05 - Full Integration (proposed, NOT approved)
Shared design system, production-safe Compose topology and verified Login/Account OIDC wiring. No live deployment; separate approval.
+1 -1
View File
@@ -26,4 +26,4 @@
Full update policy is in root [AGENTS.md](../AGENTS.md). A list of available docs is in [MINIFEST.md](MINIFEST.md).
For Gitea Run #87 security patch evidence and its two remaining Moderate advisory blockers see [P05-SEC-01.md](P05-SEC-01.md). For backend-only isolated runtime verification see [P05-CI-03.md](P05-CI-03.md); for initial full workflow and its limitations see [P05-CI-01.md](P05-CI-01.md). A green backend discovery smoke is not an authenticated user-login result.
For the seven targeted `glob`/`minimatch` remediation candidates and manual focused Login-only CI instructions see [P05-SEC-02.md](P05-SEC-02.md). For Gitea Run #87 findings see [P05-SEC-01.md](P05-SEC-01.md). For backend-only isolated runtime verification see [P05-CI-03.md](P05-CI-03.md); for initial full workflow and its limitations see [P05-CI-01.md](P05-CI-01.md). A green backend discovery smoke is not an authenticated user-login result.
+5
View File
@@ -84,3 +84,8 @@ On Gitea `vibtools/ZitPlane` open Actions → `ZitPlane P05-SEC-01 Dependency Se
**P05-SEC-01 actual evidence:** [Run #87](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/87) verified Account/Login frozen dependency installs, production builds and **1219/1219** Login unit tests; the Account security audit is clean. However Login `glob` and `minimatch` each still have one Moderate advisory, and the strict security job correctly **failed**. Production usage and package-security acceptance remain blocked until separate transitive-remediation approval and CI. No local application tests or deployment.
## P05-SEC-02 — focused Login-only dependency security acceptance
Gitea `vibtools/ZitPlane` → Actions → **ZitPlane P05 Dependency Security Acceptance (SEC-01/02)** → manual Run workflow on `main`, set **`login_only=true`**. This option deliberately skips Account build/security jobs already accepted in Run #87. Only the frozen official Login workspace install, source-level seven-override contract, proto/client/Next standalone build + upstream unit suite and live production pnpm vulnerability gate execute. The expected security threshold is **0 Moderate, 0 High, 0 Critical**. The authenticated OIDC end-to-end flow and production deployment are **not** part of the dependency gate. See `docs/P05-SEC-02.md`.
+5
View File
@@ -35,3 +35,8 @@ Account Portal and Login V2 build CI passed in Run #83, disposable backend accep
## P05-SEC-01 exact security-blocker troubleshooting
Gitea Run #87 produced 3 PASS and 1 FAIL. The FAILED `security_login` job is a **deliberate fail-closed Moderate threshold**: `GHSA-3g3m-2fjr-6pw4` in `glob` (fix >=14.0.2) and `GHSA-g3hv-75wg-m249` in `minimatch` (fix >=11.0.1). Account npm audit returned 0. Login's earlier Next.js/OTel advisories no longer reproduce, its frozen build and 1219 tests PASS, and High/Critical remain 0. Do not turn off auditing, ignore Moderate reports, modify protected auth code or force incompatible package majors. A separate P05-SEC-02 exact Scope Lock must allow controlled PNPM workspace overrides or verified compatible parent upgrades; only a new focused CI run can close security acceptance.
## P05-SEC-02 — scoped major transitive override troubleshooting
If a frozen Login install, Nx build or unit suite fails after this patch, verify the seven exact `parent@version>dependency` selectors in `auth/ui/v2/pnpm-workspace.yaml` and the matching `pnpm-lock.yaml` snapshots; compare with `notes/P05-SEC-02.md`. `glob@14` and `minimatch@11` are semver-major transitive substitutions, so historical parents expecting v10 APIs may need a separately approved compatible parent upgrade. **Do not** apply global overrides, blanket `pnpm audit --fix`, disable the strict zero-Moderate gate, or edit protected Login authentication code. Full security acceptance requires current CI frozen install/build/Vitest and registry audit, not just a clean lockfile.