Files

9.6 KiB
Raw Permalink Blame History

P05-SEC-01 — Dependency Security Remediation

Date: 2026-11-22 Approved baseline: 1a602551ad9a791efcc594834f2fa6ce748339ae (Gitea main) Final status: PATCH IMPLEMENTED; one focused Gitea Run #87 completed 3 PASS / 1 FAIL. Security acceptance BLOCKED by 2 Moderate Login transitive advisories; documentation-only closure. Prior evidence: Gitea Run #83 security job #173; Run #86 disposable backend ACCEPTED.

Exact Scope Lock

Write only: users/ui/package.json, users/ui/package-lock.json, auth/ui/v2/apps/login/package.json, auth/ui/v2/package.json, auth/ui/v2/pnpm-lock.yaml only as justified; new .gitea/workflows/p05-security-acceptance.yml, tests/ci/**, notes/**, project/**, relevant docs/**, CI README/MINIFEST, root README/MINIFEST only if needed. Read-only: auth/ui/v2/apps/login/** other than approved package.json, auth/ui/v2/pnpm-workspace.yaml, all users/ui/src/**, core/backend/zitadel/**, deployment/docker/**, upstream Login logic/other packages, secrets, production systems and untracked AI_INSTRUCTIONS.md.

No local application builds/tests/dev servers or Docker. Metadata-only package lock regeneration to satisfy explicitly approved lockfile reconciliation is permitted without installing project node_modules, using --package-lock-only --ignore-scripts and pnpm --lockfile-only --ignore-scripts. One Gitea Actions CI acceptance cycle, not a rerun loop.

Exact prior advisory evidence

Account: npm audit reports one next package affected by 7 GHSA advisories: GHSA-mfr8-8qww-v76h, GHSA-vc7v-qv4w-wrv8, GHSA-7qx7-33qx-rqx2, GHSA-f3mh-rxg3-f5g2, GHSA-pc58-hwjq-p385, GHSA-rhh4-g77r-r9qj, GHSA-vvgp-ww4w-46vf. Root source pins next@16.4.3; npm registry advisory shows vulnerable 16.0.0–16.4.4 and patch 16.4.6 (same minor release).

Login workspace: 18 Moderate advisory records (not 18 distinct CVEs or necessarily 18 exposed runtime code paths):

  • 8 vulnerable instrumentations under GHSA-qqmp-wf37-98f9 (DB username recorded in telemetry spans): @opentelemetry/instrumentation-{pg,mysql2,knex,mysql,mongoose,oracledb,tedious,cassandra-driver}. Parent @opentelemetry/auto-instrumentations-node@0.76.0 direct login dependency; root production instrumentation flow must not be modified. Minimum fixes respectively pg 0.73.0; mysql2 0.67.0; knex 0.65.0; mysql 0.67.0; mongoose 0.67.0; oracledb 0.46.0; tedious 0.40.0; cassandra-driver 0.66.0.
  • GHSA-3v2p-hm54-8qcq: @opentelemetry/instrumentation-http, fixed >=0.222.0.
  • GHSA-3g3m-2fjr-6pw4: glob, fixed >=14.0.2; risk of continued filesystem traversal after cancellation.
  • GHSA-g3hv-75wg-m249: minimatch, fixed >=11.0.1; globparts pattern amplification DoS.
  • Same 7 Next.js GHSAs as Account for next@16.4.3; registry suggests patched >=16.4.5, account audit recommends 16.4.6.

Prior High/Critical: 0 in both production audits on Run #83; moderate issues remain OPEN until security CI actually passes.

Pre-change investigation and implementation plan

  1. Inspect current exact importer, pnpm override settings (existing pnpm-workspace.yaml READ ONLY), lockfile package versions and dependency parent paths. Compare npm registry metadata and official advisory fixed ranges. Classify direct vs transitive, production reachability and compatibility.
  2. Apply justified exact next@16.4.6 pins in Account and Login app plus aligned @next/eslint-plugin-next only if necessary within approved login package.json. Reconcile Account npm lock metadata-only, no package installation or scripts.
  3. For 8 OTel packages, OTel HTTP, glob and minimatch, prefer compatible parent release/resolution that satisfies fixed advisory ranges without source change. pnpm override configuration is outside approved pnpm-workspace.yaml; if compatible parent/version/lock changes cannot be proven within current write scope, document precise blockers and defer, rather than edit excluded file, fabricate resolved status or use broad incompatible overrides.
  4. Regenerate narrowly justified pnpm lock metadata using pinned pnpm; verify frozen importer specs, tracked scope, exact patch/security audit, no secrets and original Login V2 auth source unchanged.
  5. Add manual-only isolated Gitea security acceptance workflow with frozen npm/pnpm installs, fail-closed HIGH/CRITICAL and separate Moderate advisory inventory/gate (any Moderate remaining => FAIL/explicit blocker), Account typecheck/production build and Login V2 Nx proto/client/standalone build plus focused relevant unit suite.
  6. Source audit, docs/manifests sync, one scoped commit/push to Gitea main and exact remote SHA verification; one CI cycle. Record real run IDs/results and unresolved vulnerabilities, no false PASS. End with documentation/result commit/push and next exact phase lock/approval.

Phase evidence ledger

PENDING. Update with actual modifications and one focused CI run SHA/job conclusions. If Moderate remain, security closure must stay BLOCKED, not silently accepted.

Actual implementation, CI evidence and acceptance — 2026-11-22

Source commit: 752d243ae8fb24ce3cfa990343082e2d0431306b pushed to Gitea main before dispatch. ONE focused run: #87, workflow_dispatch, main, tested exact SHA above. Started 2026-11-22 14:08:50 UTC, completed 14:12:42 UTC. OVERALL FAILURE by design due remaining Moderate Login advisories; 3 PASS / 1 FAIL, no second run.

Job Gitea job ID Final Real log markers/evidence
Account frozen build 185 PASS ZITPLANE_SECURITY_SOURCE_LOCK_CONTRACT_PASS, npm ci, tsc --noEmit, Next 16.4.6 production build, ZITPLANE_SECURITY_ACCOUNT_BUILD_PASS; anonymous API HTTP 401/no-store and protected redirect ZITPLANE_SECURITY_ACCOUNT_NEGATIVE_REGRESSIONS_PASS
Official Login V2 frozen build/unit 186 PASS pnpm@10.30.3 install --frozen-lockfile resolved 1131 packages, ZITPLANE_SECURITY_LOGIN_FROZEN_INSTALL_PASS; Nx proto/client/Next 16.4.6 standalone build ZITPLANE_SECURITY_LOGIN_BUILD_PASS; 84/84 files, 1219/1219 tests PASS, ZITPLANE_SECURITY_LOGIN_UNIT_PASS
Account production security 187 PASS npm --omit=dev, 0 vulnerabilities; ZITPLANE_NPM_ZERO_MODERATE_HIGH_CRITICAL_PASS; Moderate=0, High=0, Critical=0
Login production security 188 FAIL (strict gate) pnpm audit --prod --audit-level high PASS High/Critical threshold; registry reports 2 Moderate, 0 High/Critical. ZITPLANE_PNPM_SECURITY_ACCEPTANCE_BLOCKED=2 correctly terminates the job

Exact remaining findings — verified on Run #87

  1. GHSA-3g3m-2fjr-6pw4 — glob, Moderate. Current lock includes glob@10.5.0; advisory range >=9.0.0 <=14.0.1; patched >=14.0.2. Prior lock immediate parents: @npmcli/map-workspaces@3.0.6, @npmcli/package-json@5.2.1, rimraf@5.0.10, archiver-utils@5.0.2, unified-engine@11.2.2. Transitive major-version compatibility not proved.
  2. GHSA-g3hv-75wg-m249 — minimatch, Moderate. Current lock includes minimatch@10.2.5/10.2.6; advisory range >=7.0.0 <11.0.1; patched >=11.0.1. Immediate parents include eslint@10.8.1, @eslint/config-array@0.23.5, @typescript-eslint/typescript-estree@8.67.0, nx@22.7.12. Forcing major 11 needs scoped parent/PNPM override compatibility verification.

The original 18 Moderate Login advisory records are now 2 (16 disappeared from registry audit: Next.js seven + OpenTelemetry 9); original Account one affected next package is now zero. 17 of the 19 previously reported records no longer reproduce; do not imply these 17 correspond to 17 distinct CVEs. No High/Critical reported on either audit. Security FULL ACCEPTANCE BLOCKED until remaining two are remediated and CI-reverified.

Scope/patch provenance and safety

  • Only approved users/ui/{package.json,package-lock.json}, auth/ui/v2/apps/login/package.json and auth/ui/v2/pnpm-lock.yaml changed among application/workspace files.
  • Next exact 16.4.6 (both apps) and Login @next/eslint-plugin-next 16.4.6; Login @opentelemetry/auto-instrumentations-node@^0.80.0, @opentelemetry/sdk-node@^0.222.0, @opentelemetry/api-logs@^0.222.0. Original Login V2 auth/UI source, Account src/**, developer Compose, Go backend, pnpm-workspace.yaml and production unchanged.
  • npm/pnpm lock files were regenerated metadata-only, without project node_modules or local build/test. Full imported upstream lock pruning removed 912 unused prior package key entries and introduced 88 new resolution entries; CI --frozen-lockfile PASS and all 1,219 unit regressions PASS.
  • Source-level audit: 29 approved staged files, 0 unauthorized, 0 secrets; 729 Git-tracked paths inventoried; all five relevant MINIFEST direct-child inventories exact. AI_INSTRUCTIONS.md untracked and untouched.
  • No second Gitea run, no local application builds/tests/dev server, no real users, no production deployment, no dependency versions beyond documented scope.
  • auth/ui/v2/pnpm-workspace.yaml is read-only in this phase and already owns PNPM root overrides. Do not place ineffective overrides in root package.json or force semver majors as an undocumented workaround. Future P05-SEC-02 must explicitly approve narrow PNPM workspace override/parent changes and CI proofs, with a new baseline.

Final verdict: Minimal security remediation source patch and regression verification DONE, full Moderate+ security acceptance BLOCKED by exactly two named packages. The final documentation-only SHA is not the tested source SHA 752d243.