Files
DataStack/notes/001-PRODUCTION-FORENSIC-AUDIT.md
T
victorsteele428 d9d1c2f4b2 P04-S06: isolated call-trace and Windows File Manager 404 blocker disposition (#10)
docs(p04-s06): isolated reachability test and Windows File Manager blocker [skip ci]

Exactly notes/001–006, security remediation blocked, no package/runtime changes. Production NO-GO.
2026-11-23 17:05:59 +00:00

48 KiB
Raw Blame History

DataStack — Production-Readiness Forensic Audit (Documentation Baseline)

Status: BASELINE FORENSIC SNAPSHOT; P01 VERIFIED AND CLOSED (see closure appendix). Date: 2026-11-22 (Asia/Dhaka). Frozen source HEAD: d725841ebc828d58cbe90f517da9e600f23c4630. Local, Gitea vibtools/DataStack, GitLab ivibtools/datastack, and GitHub JILLU-Games/DataStack confirmed at this exact HEAD before writing these notes. Scope of this document: evidence-backed CI and source review, not proof that every production feature works. No Coolify live write, rollback, restart or deployment was conducted. Public GET https://data.ivib.cc/api/health returned status: online; full DB/Redis/MCP/S3 transaction health is not established.

Findings classification

  • 8 finding groups from actual CI: 5 code/test/lockfile groups (CI-01…05) and 3 CI infrastructure/security-review groups (CI-06…08). Not 43 separate bugs: the 43 compiler errors belong to CI-05.
  • 2 failing assertions, 4 timeout suites (24 TypeScript suites in run #45: 18 clean, 6 fail/timeout).
  • 3 extra source-observed reliability risks (R-01…03) have NOT been reproduced as production failures; they require targeted fault injection before any fix or behavior change.
  • Do not equate successful test/source feature with verified production runtime.

Eight confirmed findings / blockers

ID Severity* Evidence (run/job) Exact affected area Verified observation Planned phase
CI-01 High Run #42 job 63; #45 job 71 package-lock.json, package.json; .gitea/workflows/datastack-ci.yml Windows job Original Windows npm ci reports missing platform dependency entries; regenerate lock only in runner -> SDK builds. Lock not fixed in repo. P01
CI-02 Medium Run #45 job 66 bun.lock and tests/phase07-deployment.test.ts:648-649 Tracked bun.lock conflicts with assertion requiring its absence. Validate references before removing. P01
CI-03 Medium Run #45 job 66 tests/r3-phase04-ui-metrics-rbac.test.ts, tests/r4-phase03-sdk-deploy-auth.test.ts, tests/r5-phase01-mcp-foundation-logs.test.ts, tests/r5-phase03-mcp-ui.test.ts Each suite timed out with exit 124 despite reaching passing assertions; investigate open handles/teardown without changing application timers by default. P01
CI-04 Medium Run #45 job 66 tests/v2-phase01-storage-quotas.test.ts:788-804 vs app/vcon/clients/page.tsx:15-20,70-95 and lib/vconUiHelpers.ts:717-780 Old regex expects function isClientExpired( in page; production page uses shared classifyUiClientStatus and summarizeUiClientCounts. Test contract is stale; not proof expiry feature fails. P01
CI-05 Medium Run #45 job 68 Nine tests/*.test.ts files (listed below), tsconfig.json:27 npx tsc --noEmit produced 43 compiler errors, despite Next.js production build PASS. Type errors in test sources require focused correction; do not disable strict TypeScript. P01
CI-06 Low/CI Run #45 job 67, run #48 job 74 .gitea/workflows/datastack-ci.yml Python job Linux Bullseye apt-get returned Debian-security 404; separate Windows Python job passed 14/14. Runner provisioning defect, not SDK regression. P03
CI-07 High/CI Run #50 job 76 .gitea/workflows/datastack-docker-ci.yml, Docker daemon; docker/Dockerfile.web:13 Compose validation and ingestion image PASS, then web image layer copy fails with containerd lstat .../app/node_modules/@uiw: no such file or directory. Root cause unconfirmed (runner snapshot/storage or reproducible build interaction); proxy never built. P03
CI-08 Review Run #50 job 76 package.json / package-lock.json / resolved npm graph npm reports 24 (23 moderate, 1 high) with --omit=dev, 26 (25 moderate, 1 high) with --include=dev. Counts overlap; no CVE list, reachable-exploit assessment or remediation done. P03

*Severity is release-priority triage, NOT a CVSS rating and NOT proof of real-world exploitation.

CI-05 exact file map (43 total, all inside tests)

File Error count Families / main anchors
tests/phase01-auth.test.ts 4 TS2540; 88,560,773,794
tests/phase03-storage-buffer.test.ts 2 TS2349; 1158,1202
tests/r3-phase01-security-vault-webhooks.test.ts 6 TS2353, TS2345; 185,191,202,210,295,430
tests/r3-phase02-storage-scheduler-gzn.test.ts 1 TS2345; 49
tests/r4-phase01-security-boot.test.ts 3 TS2345; 102,537,571
tests/r4-phase02-ingestion-audit-streaming.test.ts 9 TS2345/TS2833; 87,332,335,338,407
tests/r5-phase02-mcp-server.test.ts 12 TS18046; 510,524,538,549,560,570,581,604,613,635,644,657
tests/v2-phase01-storage-quotas.test.ts 2 TS2554; 762,783
tests/v2-phase02-alerts-ip-prometheus.test.ts 4 TS2339; 479,480,490,491

No source fix is authorized here. Use typed narrowing and correct test fixtures, not skipLibCheck, any everywhere, @ts-ignore, or changing real API responses merely to make tests compile.

Three source-observed production reliability risks — CONDITIONAL GATES, not confirmed bugs

Gate Source proof Why verification is required Phase
R-01 Redis outage ACK durability server/index.js:165-193, server/socket/handlers.js:583-602 redis.rpush failure falls back to RAM, and onBufferPush() can resolve, then Socket.IO ACK success; process crash before flush may lose acknowledged events. Fail-injection test and explicit durability contract required. P02
R-02 Batch replay duplication server/index.js:943-994, server/workers/csvWriter.js:265-323 CSV write precedes Redis list trim. Crash/partial write between these operations can replay already written rows. Validate at-least-once vs exactly-once guarantee before mitigation. P02
R-03 Liveness ≠ readiness server/index.js:1939-1956; app/api/health/route.ts:95-111 Health returns online without full PostgreSQL + Redis + disk transaction proof. Preserve existing /health API semantics; consider separate, internal readiness rather than breaking public health. P02

Optional configuration review (not counted among eight): server/index.js:1086-1089 Socket.IO uses CORS delegate; verify WebSocket origin/access and JWT guard in target deployments before recommending policy changes. sdk/python/datastack/pyproject.toml:47-51 still references legacy anik-d-art/datastack URLs; metadata only, not current release blocker. Do not silently modify either under approved scope.

CI evidence / original logs

  • https://dev.ivib.cc/vibtools/DataStack/actions/runs/42 — initial Windows lockfile failure (job 63), cancelled after partial node evidence.
  • https://dev.ivib.cc/vibtools/DataStack/actions/runs/45 — 24 suites = 18 clean / 6 fail-or-timeout, 43 TS diagnostics, Next.js production build PASS, Windows diagnostic SDK build PASS; Linux Python apt and Docker-CLI job blocked.
  • https://dev.ivib.cc/vibtools/DataStack/actions/runs/48 — Python SDK 14/14 PASS.
  • https://dev.ivib.cc/vibtools/DataStack/actions/runs/49 — full ESLint PASS.
  • https://dev.ivib.cc/vibtools/DataStack/actions/runs/50 — Compose PASS, Docker ingestion image PASS, web image containerd failure.
  • See notes/006-BASELINE-AND-PATCH-EVIDENCE.md for precise code/log excerpts and proposed patch anchors.

Release acceptance rule

NOT production-update-ready until P01, conditional P02 gates, and P03 finish, 24/24 TypeScript suites exit 0, 14/14 Python tests pass, full strict tsc --noEmit and ESLint pass, Linux/Windows clean install is reproducible, standalone Next build passes, all 3 Docker images build, security advisories are triaged, and approved non-mutating live readiness checks pass. Production deploy is a separate operator-approved action; never automatic from this documentation phase.

P01 Closure Appendix — 2026-11-22

Implementation outcome: CI-01…CI-05 resolved within P01 source allowlist; no production app/runtime/UI/SDK changes. Evidence: Gitea #59 and focused quality retry #60. Run #59 overall FAILED because a single test-only stopTimers type declaration remained; it was corrected in tests/r5-phase01-mcp-foundation-logs.test.ts and strict tsc --noEmit plus ESLint then PASSED in #60. The two run results are complementary; neither should be misreported as a single all-green run.

Finding Resolution and proof
CI-01 package-lock.json gained 68 registry-integrity-verified optional entries including nested @napi-rs/wasm-runtime/node_modules/@tybys/wasm-util@0.10.5; 1293 original package entries unchanged, no removals or version bumps. Committed-lock npm ci PASS on Linux (job 90) and Windows (job 95).
CI-02 Removed obsolete bun.lock; tests/phase07-deployment.test.ts exit 0.
CI-03 Added suite-specific teardown hooks in four previously hanging suites, without changing core timer/runtime implementation; each exits 0.
CI-04 Replaced stale client-expiry inline-function regex with shared classifier/count behavioral assertions; tests/v2-phase01-storage-quotas.test.ts exit 0.
CI-05 43 historical test-only TypeScript diagnostics corrected; one additional teardown declaration fixed after #59 typecheck failure. Final #60 strict TypeScript PASS (zero errors) and ESLint PASS.

Acceptance evidence: #59 Node SDK build PASS, 24/24 isolated TypeScript suites exit 0 (no timeouts), Windows SDK build PASS, Next.js 15.5.29 standalone production build PASS with 22/22 pages. #60 targeted tsc --noEmit and npm run lint both PASS. Prior canonical Windows Python SDK 14/14 PASS from #48; Python source unchanged and not rerun in P01. Docker images and live production behavior NOT verified in P01; P02 runtime reliability risks and P03 infrastructure/security gates remain open.

P02 Forensic Fault-Injection Update — 2026-11-22

Source freeze for P02: Gitea/GitHub main 667a140c4e9e75382bfdcdbe1d3e9eb96f6e808a, matching GitLab tracked tree d53b9e6dd7ff6d291b8bab7b841d8684ef89c703. R-01/R-02/R-03 originally risks, not established production incidents. The diagnostic-only P02 patch adds disposable fixture tests in tests/phase02-sync.test.ts (R-01/R-03) and tests/phase03-storage-buffer.test.ts (R-02); CI: https://dev.ivib.cc/vibtools/DataStack/actions/runs/63. Do not interpret diagnostic assertion success as a durability fix. No runtime code, API, UI, data store, SDK, security policy, deployment or production host has been modified.

  • R-01 durable ACK: server/index.js:165-193,1895-1923 catches a failed Redis RPUSH and pushes accepted events into volatile RAM. server/socket/handlers.js:583-602 then sends {success:true,eventId} if onBufferPush resolves. In the injected-RPUSH-failure fixture, simulated process-memory reset models loss of the acknowledged event; no actual server is killed. Potential release blocker: acknowledged data is not necessarily durable.
  • R-02 CSV/replay: server/index.js:981-993 and core/data/buffer.ts:795-809 write CSV before Redis LTRIM. The fixture injects an LTRIM failure after successful CSV append and retries the same queue; a duplicate eventId write would demonstrate at-least-once rather than exactly-once delivery. This fixture is an analogous web-buffer implementation, not direct Port-4000 writer fault injection. A release decision and exact remediation require independent targeted evidence; do not extrapolate no-duplicates.
  • R-03 health: server/index.js:1926-1957 returns HTTP 200 status:online when Redis LLEN fails, while surfacing redisConnected:false; the historical route is liveness, not dependency readiness. app/api/health/route.ts:95-111 likewise reports web liveness/buffer and does not prove database/Redis write readiness. A new readiness endpoint or altered public response requires separate approval.

Do not auto-fix source based solely on tests. Runtime code is READ-ONLY under the current approval. Any proven R-01/R-02 risk requiring behavior change needs a new exact method/file approval before application changes. P03 remains independent and unstarted.

P02 Runtime Remediation Candidate — 2026-11-22 (NOT YET VERIFIED)

Authorized follow-up baseline: Gitea/GitHub fd57a3518d14bcb8367ce9ab9c3ec306bcfc9898 (GitLab same tree). Local isolated branch p02-runtime-remediation-20261122, implementation commit 44eee8877e40d1683f44502c2a0ba3d437a03b88. Scope: server/index.js (pushEventsToRedisOrFallback, flushBuffer), server/socket/handlers.js (sync_data/batch_sync ACK and claim rollback), core/data/buffer.ts (flush), tests/phase02-sync.test.ts and tests/phase03-storage-buffer.test.ts only, plus notes/001–006. All other source is unchanged.

Candidate R-01 behavior: when a configured Redis client returns an RPUSH error, pushEventsToRedisOrFallback retains RAM fallback but throws a sanitized BUFFER_PERSIST_FAILED instead of returning a durable-looking buffer count. Socket single/batch ACK returns success:false; best-effort Redis idempotency-key removal and bounded in-process negative-ACK marker handle ordinary retries. This is a candidate pending tests. When Redis is intentionally absent, historical RAM fallback is deliberately unchanged; it is not a universal durable-ACK guarantee. If Redis claim deletion fails and the server restarts, stale Redis idempotency claims could still misclassify a retry; a full crash-atomic claim/queue protocol is not established by this patch.

Candidate R-02 behavior: Port 4000 flushBuffer and Port 3000 DataBufferEngine.flush stream-parse existing CSV/CSV.gz partitions for same-client/date/event IDs before replaying any buffered Redis or RAM batch, dropping already-persisted IDs while retaining Redis queue until the write/check completes. Scan/read/parse exceptions fail closed before LTRIM. In-scope test adds a direct Port 4000 writer + Redis LTRIM-failure/recovery test and updates the existing web-buffer replay fixture. Not proven globally exactly-once: cross-process CSV writers outside the Redis flush lock and unknown archival/partial-corruption cases remain; scanning partitions on each flush also has real disk-I/O cost, requiring throughput evaluation before production promotion.

Candidate acceptance: one disposable Gitea CI with 24/24 suites, strict TS, lint, Linux/Windows clean npm CI and production build; direct Port4000 replay tests; exact allowlist/diff audit and three-remote tree parity. The Gitea MCP/host was unavailable on the implementation attempt, so this is NOT PASSED and the P02 phase remains BLOCKED / NOT CLOSED. No live deployment or runtime production mutation.

P02 Final Acceptance Verification — 2026-11-22 (current superseding evidence)

Baseline published diagnosis: fd57a3518d14bcb8367ce9ab9c3ec306bcfc9898. Runtime candidate 76cd972bdeea9ef07b4b38e9d8b5b5ed3312ca5b passed Gitea CI #66 (24/24 Node regression suites, Node SDK, strict TypeScript, ESLint, Next production build, Windows SDK). New final narrow patch bf525f0d4e5e4781de7fddd2f5e7d3d602a80532: server/socket/handlers.js plus two previously scoped TS tests only; final disposable Gitea CI #69 dispatched, terminal result to be recorded before phase closure.

Confirmed exact root cause in candidate: server/socket/handlers.js stores failed Redis persistence in idempotencyMap at -Date.now() while cleanupMaps deletes entries when now - timestamp > 300000; after the 60000ms cleanup window a failed marker can disappear despite an uncommitted Redis idempotency claim, permitting false-positive DUPLICATE_DROPPED. Arithmetic reproduction before code patch: at +61000ms, cleanup deletes a marker although Redis claim TTL (300000ms) is not over. Final patch uses a separate positive-timestamp failed-persistence marker and preserves negative ACK while the outstanding claim remains. A mixed batch with a failed duplicate must not return overall success while distinct records persist.

R-02: server/index.js:843-897,1043-1058 and core/data/buffer.ts:652-711,855-872 replay-scan existing same-client/day CSV, preserving Redis queue until a successful write/dedupe; fault tests include direct Port 4000 post-CSV LTRIM outage, rotated compressed .csv.gz containing quoted multiline payload and unrelated-date corrupt partition; malformed matching-date CSV must reject and leave Redis queue intact, with recovery after disposable fixture repair. Streaming parsing bounds memory, not total disk I/O; scan latency grows with matching partition size. No universal exactly-once guarantee, no live throughput claim and no claim of finite hard disk-I/O cap.

Public R-03 health remains historical liveness. Intentionally Redis-free RAM fallback and its historical successful ACK stay unchanged. No app/UI/auth/API schema/SDK/Docker/production-data/deployment changes. Work only in a new clean temp worktree; original PC repository's staged 16 P01 files and a separate pre-existing dirty candidate worktree preserved. No production readiness claim until CI #69 and final audit.

P02 Final Focused Correction — CI #69 to #72

Gitea CI #69 was run against bf525f0d4e5e4781de7fddd2f5e7d3d602a80532: the new Redis stale-claim test timed out because it globally replaced Date.now during live Socket.IO ACK scheduling. This is a test-harness failure, not a proven backend regression; other new CSV.gz, partial-corruption, mixed-new/durable and Redis-free regression cases passed. An additional source-grounded edge case was found: batch_sync previously failed to reject a batch containing a non-durable claim PLUS an already accepted duplicate when processed=0, duplicates>0. Under exact approved scope, the server/socket/handlers.js branch changed from if (volatileDuplicate && processed > 0) to if (volatileDuplicate), ensuring false overall ACK is never sent for any such mixture. Test now uses local simulated TTL arithmetic and real-clock Socket.IO retries; no global clock manipulation. Corrected commit acca8be01a31f8d3972564cbaec8fd3117a0b551 sent to focused CI #72; still no P02 closure or production deployment until PASS.

P02 definitive CI acceptance (2026-11-22)

Source-verified P02 final correction is acca8be01a31f8d3972564cbaec8fd3117a0b551. Gitea CI #72 terminal SUCCESS (Linux 24/24 TypeScript suites, explicit R-01/R-02 fault cases, strict tsc, ESLint, Windows Node SDK, Next.js standalone build). Earlier #69 was cancelled after a test-only global Date.now Socket.IO ACK timeout; fixed by removing global clock override and adding direct arithmetic proof without changing timers. #72 proves the corrected test passes. Final source-path audit: exactly 11 approved paths (3 runtime, 2 tests, 6 notes). No keys/secrets, auth/SDK/UI/public health, dependency pins, CI workflows, deployment or database migrations changed. ACK remains best-effort in intentionally Redis-free RAM mode; Redis-configured RPUSH failure must return negative ACK; CSV deduplication guarantees only tested recovery windows, not globally atomic exactly-once. Partition scans are memory-streamed but disk reads scale with matching partition size, and production throughput is NOT certified. Release/installation still requires separate authorization.

P03 production forensic acceptance — 2026-11-22

Baseline Gitea/GitHub 48fb277079b380fdbf1e58cd2da40afeed0b03ee; GitLab baseline same tracked tree 41a169eec0c05ce19bc4acc29d7a8cfe1f8dd90d (317/317 blobs). Final P03 workflow candidate 549d575653b68c29f97e2f78036646f2e2035719. Gitea CI #77: overall FAILURE because the initial Python-only checkout lacked Node (exit 127), not an SDK regression. Its other six jobs terminal SUCCESS: Node CI_SUITE_SUMMARY total=24 failed=0, strict TS+ESLint, Next standalone build, Windows SDK, Compose + isolated BuildKit ingestion/web/proxy image build DATASTACK_THREE_IMAGES_BUILD_PASS, read-only advisory inventory DATASTACK_SECURITY_TRIAGE_INVENTORY_PASS. Narrow Python-only CI #78 terminal SUCCESS: Node-capable Bookworm container, Python 3.11 isolated venv, Ran 14 tests in 3.959s, OK, DATASTACK_PYTHON_14_OF_14_PASS. The other six jobs were deliberately skipped in #78.

CI-08 security disposition: npm audit --json full=26 affected packages (25 moderate, 1 high); runtime=24 (23 moderate, 1 high), not counts of distinct advisories. High-severity advisories GHSA-6g55-p6wh-862q, GHSA-r28c-9q8g-f849 affect Next 15.5.29's nested postcss@8.4.31 despite patched root postcss@8.5.33; npm recommends major next@16.4.6. Direct cloudcmd@19.24.0 carries moderate transitive issues (dompurify, file-type, glob, minimatch, got); npm recommends cloudcmd@17.0.2 downgrade, not a verified safe pin. No speculative package pin, major upgrade or force fix; a separately tested compatible remediation is needed before release.

Scope / release decision: only .gitea/workflows/datastack-ci.yml, .gitea/workflows/datastack-docker-ci.yml, and notes/001–006 changed. No package.json/lock, Dockerfile, application UI/UX, runtime, auth, SDK, database, Compose, production data, secret, shared Docker prune, deployment, migration, tag or release. P03 technical CI and advisory-triage acceptance verified by #77 non-Python jobs plus #78 Python; do not mislabel #77 overall as successful. Final phase publication requires one main commit and Gitea/GitHub/GitLab exact tracked tree parity. Production release NO-GO while runtime high advisory is unresolved; live production health, throughput and deployment remain unverified.

P04-S01 blocked security reconciliation report

P04-S01 SEC-01 BLOCKED — 2026-11-22. Approved scoped overrides.next.postcss=8.5.33 trialed in disposable Windows npm 10.9.8 workspace only. npm install --package-lock-only EXIT 0, but npm ls --package-lock-only postcss --all EXIT 1 (ELSPROBLEMS: Next nested postcss@8.4.31 invalid; expected 8.5.33); npm dedupe also kept invalid dependency. Read-only npm audit --omit=dev --json EXIT 1, runtime high 1/moderate 23/critical 0. Lockfile regeneration caused unrelated churn (91 package entries added, 106 removed, 69 changed, including two lightningcss optional 1.33.0 -> 1.30.1). Fresh minimal Next 15.5.29 fixture with identical override resolves PostCSS 8.5.33, isolating failure to DataStack committed lock graph. npm ci --dry-run exit 0 does not prove real clean install. Exact stop rule applied: no dependency patch, no CI acceptance, no main commit, no GitHub/GitLab sync, no release/deploy; production NO-GO. Need separate explicit narrowly scoped lock reconciliation approval.

Root proof: package-lock.json:10552-10560 Next pins 8.4.31; :10602-10603 nested 8.4.31; :11427-11428 root 8.5.33; advisories GHSA-6g55-p6wh-862q and GHSA-r28c-9q8g-f849.

P04-S01B actual trial / release blocker — 2026-11-22

User explicitly approved P04-S01B stale-copy removal exception. In a clean disposable Windows npm 10.9.8 probe based on Gitea main fac0934a00e6c15902738a3ffafb11b5ec2f0ac3, remove ONLY the stale nested PostCSS 8.4.31 entry from the disposable lock copy and set overrides.next.postcss=8.5.33. npm install --package-lock-only --ignore-scripts --no-audit --no-fund --prefer-offline exited 0; npm ls --package-lock-only postcss --all --depth=4 exited 0 and Next 15.5.29 used deduped 8.5.33. Read-only runtime audit on the unpublished candidate showed high=0, critical=0, moderate=22 (22 affected package entries); SEC-01 candidate mitigation confirmed but NOT accepted. The regenerated lock changed 67 unrelated package metadata entries (36 dev and 29 libc field changes plus dependency order-only differences), despite zero unrelated version changes, and removed only the stale node. This violates explicit metadata preservation. STOP before real npm ci, Gitea CI, security-gate edit or main/mirror publication. No production release or security-clean claim for published baseline.

P04-S01C verified candidate / Windows acceptance outstanding — 2026-11-22

Approved deterministic lockfile reconciliation fixed the SEC-01 Next 15.5.29 nested PostCSS 8.4.31 candidate without touching any unrelated package metadata, versions, hashes, URLs or feature/runtime sources. Scoping: package.json scoped overrides.next.postcss=8.5.33; package-lock.json only 26-line removal of obsolete node_modules/next/node_modules/postcss; existing Gitea security-audit job adds runtime high/critical failure. Generated lockfile with deterministic baseline metadata restoration had SHA-256 e6b5b362877627085dc04c9ded03c019971e07ef9f4af1e78057d58961a1c091 and Gitea branch bytes matched exactly. No unrelated package entry/metadata delta (0 added, 1 removed, 0 changed). Gitea CI #85 candidate c759be990c032c2474d2d0bad519c643dec11a3a: Node 24/24, Python 14/14, strict TypeScript + ESLint, Next standalone, Docker 3/3 and runtime advisory gate all SUCCESS. Runtime audit 22 moderate, 0 high, 0 critical; full audit 24 moderate, 0 high, 0 critical. Windows compatibility job still QUEUED at checkpoint; overall CI not yet terminal accepted, main and mirrors unchanged. Production remains NO-GO pending Windows CI, 3-remote sync, remaining moderate advisories/live health.

P04-S01C FINAL CI acceptance (7/7) — 2026-11-22

Gitea CI #85 https://dev.ivib.cc/vibtools/DataStack/actions/runs/85 COMPLETED/SUCCESS; tested implementation SHA c759be990c032c2474d2d0bad519c643dec11a3a; later changes to candidate are documentation only. All seven jobs terminal SUCCESS: node-regression (Linux committed-lock npm ci and exactly 24/24 TypeScript suites); python-regression (Ran 14 tests, OK); quality (strict tsc and ESLint); production-build (Next 15.5.29 standalone, 22/22 pages); docker-image-build (three isolated BuildKit ingestion/web/proxy images); windows-compatibility (Windows committed-lock npm ci and Node SDK build, job #182, terminal SUCCESS); security-audit (runtime moderate=22 high=0 critical=0; full moderate=24 high=0 critical=0; DATASTACK_RUNTIME_SECURITY_HIGH_CRITICAL_ZERO). Single Gitea acceptance run used, no additional broad reruns.

Scope: exactly nine approved paths: package.json scoped next->postcss 8.5.33 override; package-lock.json removes only old nested postcss@8.4.31 entry; existing .gitea/workflows/datastack-ci.yml security-audit job high/critical rejection; notes/001–006 evidence. Other package metadata, versions, integrity and resolved URLs match baseline. Next.js 15.5.29 and Cloudcmd 19.24.0 preserved. Final candidate package-lock SHA256 e6b5b362877627085dc04c9ded03c019971e07ef9f4af1e78057d58961a1c091 (verified byte-for-byte with Gitea). No API, auth, SDK, UI, application runtime, database, Compose, Dockerfile, tests or production data changes, deployment, migration, prune, tag, release.

CI fully accepted; publication not yet asserted in these pre-merge notes. Final phase CLOSED requires one squash merge of PR #5 into Gitea main and verified identical tracked content across Gitea/GitHub/GitLab; record actual new SHAs in terminal report. Production release remains NO-GO pending P04-S02 moderate vulnerability triage and separately authorized live readiness verification.

P04-S02 scoped candidate — 2026-11-22

Baseline Gitea main 2d467ff1494858164a37814f7dbc2b321f510291, tree 648c76ca496d2c9bf22a16f558c9ba347a45d4f7. Cloudcmd 19.24.0 -> deepword 11.0.1 -> monaco-editor 0.55.1 pins DOMPurify 3.2.7, vulnerable according to npm advisory inventory. Disposable Windows npm 10.9.8 npm view dompurify@3.4.18 verified, scoped npm override overrides.cloudcmd.dompurify=3.4.18 resolves dompurify@3.4.18 via npm ls --package-lock-only dompurify --all --depth=5 (exit 0). npm install --package-lock-only --ignore-scripts --no-audit --no-fund --prefer-offline exit 0. npm graph initially changed 67 unrelated metadata entries; deterministically restored exact baseline values after validating unrelated versions, URLs, integrity and dependencies. Final lock has one changed package entry, DOMPurify; same-major replacement plus verified registry resolved and integrity, no other packages added/deleted/changed. Candidate runtime audit affected-package counts moderate 20/high 0/critical 0 versus baseline 22/0/0; full candidate moderate 22/high 0/critical 0 versus baseline 24/0/0. DOMPurify and Monaco Editor dropped from vulnerable-package inventory. Other moderate packages (got, glob, minimatch, nested file-type, Cloudcmd transitive chain) remain; they require major package changes under current advisory constraints, prohibited by Scope Lock. This is a pre-acceptance candidate: do not claim application compatibility, CI PASS, publication, or phase CLOSED before full focused Gitea CI and exact three-remote tree parity.

Security forensic disposition: only DOMPurify's same-major compatible override supported by the disposable registry/audit proof; other moderate transitive packages not force-fixed.

P04-S02 final CI acceptance — 2026-11-22

Gitea CI #92 (https://dev.ivib.cc/vibtools/DataStack/actions/runs/92) COMPLETED / SUCCESS, all 7/7 jobs terminal success on source commit a88bc5f4498ea1b11acc0acfeb66b5aa9d6531be: node-regression real Linux npm ci + 24/24 tests including tests/files-manager.test.ts exit 0; Python SDK 14/14; quality strict TypeScript/ESLint; Next.js standalone (22/22 static pages); isolated Docker/BuildKit 3-image verification DATASTACK_THREE_IMAGES_BUILD_PASS; Windows committed-lock npm ci + Node SDK compatibility; security-audit DATASTACK_RUNTIME_SECURITY_HIGH_CRITICAL_ZERO and DATASTACK_SECURITY_TRIAGE_INVENTORY_PASS. Audit full=22 moderate/high=0/critical=0 (baseline 24), runtime=20 moderate/high=0/critical=0 (baseline 22). These are affected package entries, not distinct advisories. No new CI workflow or extra broad CI dispatched.

Exact approved patch: package.json scoped overrides.cloudcmd.dompurify=3.4.18, preserving overrides.next.postcss=8.5.33; npm-generated package-lock.json changes solely node_modules/dompurify version 3.2.7 -> 3.4.18 and verified resolved/SHA512 integrity. Baseline Cloudcmd 19.24.0, Monaco Editor 0.55.1, Next.js 15.5.29, all unrelated locked package versions, URL, hash, dependency and metadata preserved. Gitea published candidate lock bytes match disposable SHA-256 57c5ea9df9f28be496f8c3202fbc280b0066bf8c216b8d8a3ca98b6f7b942854. Exact candidate tree diff 420 entries, 8 approved changed files only (package.json, package-lock.json, notes/001–006), 0 unauthorized paths. No runtime/UI/auth/API/SDK/tests/CI/Dockerfiles/Compose/db/schema/data modifications.

Security forensic result. Residual risk: 20 moderate runtime affected package entries remain, including Cloudcmd transitive dependencies got, glob, minimatch, nested file-type and their parent chains. Current npm audit suggests cloudcmd@17.0.2 (a major downgrade), explicitly out-of-scope; other transitive fixes need major-version dependency-contract changes. No force/downgrade/unverified override. Security improvement verified but NOT zero vulnerabilities. Production release stays NO-GO; remaining advisory disposition and live readiness need independent scope approval.

Merge gate: CI #92 7/7 PASS, approved 8-file patch integrity PASS; main squash merge and Gitea/GitHub/GitLab exact Git content-tree verification required before P04-S02 CLOSED. This note is written before that publication, so final remote commit SHAs shall be appended to the PR closure report after verification. No deployment, migrations, prune, tag, release.

P04-S03 — Residual Cloudcmd forensic disposition (2026-11-23)

Gitea main a9ad770063, tree 1a0790d0d5. P04-S02 remains accepted (CI #92 7/7 PASS); all approved Cloudcmd 19.24.0, Next 15.5.29, PostCSS 8.5.33 and DOMPurify 3.4.18 locks preserved. Windows disposable npm 10.9.8/Node 22.23.2 inspection downloaded the exact Gitea package.json/package-lock.json; original lock SHA-256 57c5ea9df9f28be496f8c3202fbc280b0066bf8c216b8d8a3ca98b6f7b942854. npm ls --package-lock-only cloudcmd got glob minimatch file-type dompurify --all --depth=5 exit 0. Fresh npm audit --omit=dev --json reports runtime moderate=20/high=0/critical=0, full npm audit --json moderate=22/high=0/critical=0; npm audit exit 1 because existing moderates, not a tool failure. Counts are affected package nodes, not distinct advisories.

Four direct npm audit advisories explain inherited runtime findings: got GHSA-pfrx-2q88-qq97 (<11.8.5, first patched 11.8.5), glob GHSA-3g3m-2fjr-6pw4 (>=9 <=14.0.1, patched 14.0.2), minimatch GHSA-g3hv-75wg-m249 (>=7 <11.0.1, patched 11.0.1), file-type GHSA-5v7r-6r5c-r473 (>=13 <21.3.1, patched 21.3.1). Registry confirmed availability of got@11.8.5, glob@14.0.2, minimatch@11.0.1; file-type@21.3.4 is already present as a patched root copy, while its two nested vulnerable copies are 16.5.4. Specific constrained parents: @cloudcmd/dropbox@5.0.3 -> dropbox-stream@3.2.0 -> got ^10.6.0 (locked 10.7.0); console-io@15.0.4 -> spawnify@8.0.1 -> glob ^10.3.3 (locked 10.5.0) -> minimatch ^9.0.4 (locked 9.0.9); inly@5.0.1 -> glob ^10.3.10 and onezip@6.1.1 -> glob ^10.3.10; Cloudcmd -> onezip@7.0.3 -> glob ^13.0.6 (locked 13.0.7) -> minimatch ^10.2.2 (locked 10.2.6); dword/edward -> join-io@5.0.0 -> ponse@6.0.0 -> file-type ^16.2.0 (locked 16.5.4); restbox@4.0.1 -> ponse@7.0.0 -> file-type ^16.2.0 (locked 16.5.4). Patch version for each lies outside its parent semver major; no compliant same-major security upgrade exists for these vulnerable leaves. npm suggests Cloudcmd 17.0.2 downgrade, specifically forbidden. No forced override was attempted since each candidate violates approved compatibility boundary.

P04-S03 disposition: FORENSIC REVIEW COMPLETE / TARGETED REMEDIATION BLOCKED BY APPROVED SCOPE. No package.json, package-lock.json, runtime, UI, File Manager, Monaco Editor, tests, SDK, CI, Dockerfile, Compose, database, secrets or production file edits. No npm install or npm ci required for unmodified baseline, no extra Gitea CI dispatched: accepted unchanged baseline retains Gitea CI #92 7/7 including real Linux/Windows npm ci, File Manager regression, SDKs and 3 Docker images. No claim of newly fixed advisories or zero Moderate. Only notes/001–006 publication is permitted; no dependency patch, tag, release, deployment, migration, prune or live change. Production remains NO-GO, pending separately approved parent dependency migration with full compatibility acceptance or a formal risk-disposition decision.

P04-S04 — Forensic audit (2026-11-23)

Approved baseline Gitea main 986ac1fcb2, tracked tree 118fae01fb (420 entries). Disposable Windows Node 22.23.2/npm 10.9.8 copied byte-exact published package.json/package-lock.json; lock SHA-256 57c5ea9df9f28be496f8c3202fbc280b0066bf8c216b8d8a3ca98b6f7b942854. Live registry.npmjs.org upstream metadata inspected 17 parent package names (all fetches passed) and 17 parent/dependency constraint assertions exit 0.

Four direct npm audit GHSA roots remain: got GHSA-pfrx-2q88-qq97 (patched >=11.8.5), glob GHSA-3g3m-2fjr-6pw4 (patched >=14.0.2), minimatch GHSA-g3hv-75wg-m249 (patched >=11.0.1), file-type GHSA-5v7r-6r5c-r473 (patched >=21.3.1). Latest supported upstream parent metadata: @cloudcmd/dropbox 5.0.3 -> dropbox-stream ^3, dropbox-stream 3.2.0 -> got ^10.6.0; console-io 15.0.4 -> spawnify ^8, spawnify 8.0.1 -> glob ^10.3.3; inly 5.0.1 -> glob ^10.3.10/onezip ^6, onezip 6.1.1 -> glob ^10.3.10, onezip 7.0.3 -> glob ^13.0.6; glob 10.5.0 -> minimatch ^9.0.4, glob 13.0.7 -> minimatch ^10.2.2; join-io 5.0.0 -> ponse ^6, restbox 4.0.1 -> ponse ^7, ponse 6.0.0 and 7.0.0 -> file-type ^16.2.0. Root file-type 21.3.4 already patched; nested file-type 16.5.4 remains. Latest @cloudcmd/fileop 9.1.1 still pins inly ^5 and onezip ^7: no advisory improvement. Cloudcmd latest 19.24.0 unchanged. Latest glob 14.0.6 uses minimatch ^11.0.5, incompatible with existing parent ranges. None of these latest parent releases supports a patched leaf major.

Current fresh npm audit --omit=dev --json: runtime affected package entries moderate=20, high=0, critical=0; npm audit --json: full moderate=22, high=0, critical=0. Both audit commands exit 1 due documented moderate advisories, not audit parser errors. Baseline audited lock SHA-256 unchanged; no dependency patch or npm installation. Historical unchanged-code Gitea CI #92 remains 7/7 SUCCESS (not a new P04-S04 CI).

Root cause and forensic scope: four parent-major dependency chains demonstrated with latest upstream supported dependency contracts. Document this as a security blocker, not a successful remediation.

P04-S04: FORENSIC DISPOSITION COMPLETE, COMPATIBLE SECURITY REMEDIATION BLOCKED by approved Scope Lock. Parent-documented support is mandatory before major transitive upgrade; upstream has no supporting releases. No unsupported leaf overrides, forced npm audit fix, Cloudcmd downgrade, UI/feature/API/auth/SDK/test/CI/Docker/Compose/DB/production changes. Exact publication is notes/001-006 ONLY; package manifest, lock and runtime byte-exact baseline. No new broad CI because no candidate. No deployment, migration, shared prune, tag or release. Production NO-GO. Do not mark four advisories resolved or claim zero moderate. Any parent patch/fork, compatibility adapter, or operational risk acceptance requires separate exact user approval.

P04-S05 — Production forensic findings (2026-11-23)

Baseline Gitea main f1e04f0689, tracked tree ceb44222e8, 420 entries. Existing P04-S04 forensic PR #8 records Cloudcmd 19.24.0 and vulnerability constraints. P04-S05 is STATIC SOURCE / UPSTREAM PACKAGE / ADVISORY review only. Runtime affected packages: moderate=20, high=0, critical=0; full audit: moderate=22, high=0, critical=0 (last verified unchanged dependency graph). No live deployment, traffic, runtime exploitation or production session inspection. Source read-only; inherited accepted CI #92 is historical, not new P04-S05 test evidence.

DataStack source-level facts: server/index.js:2530-2538 mounts Cloudcmd File Manager on ingestion port 4000; server/filesManager.js:975-1075 mounts securityGuard first, then Cloudcmd middleware at /vcon/files-engine. server/filesManager.js:664-704 locks root, sets terminal:false, console:false, dropbox:false, packer:zip, zip:true, editor:edward, disabled import/export and config UI. HTTP middleware 711-851 validates admin session, CSRF for unsafe methods, viewer-write denial, path traversal and *.lock; PUT JSON mutation body limit 512KiB at 767-800, NOT a general upload size limit. Socket namespaces 854-973 independently gate session/write/editor events. docker/coolify-nginx.conf:60-73 forwards /vcon/files-engine to ingestion; Docker Compose exposes 4000 internally (source config, NOT verified live firewall). UI components/sections/FilesManagerWorkspace.tsx:24-26,123-133,196-204 show iframe, browsing, editing, upload/download and ZIP/UNZIP. Existing tests/files-manager.test.ts:66-278 exercise auth 401, viewer 403, CSRF, path lockdown, PUT CRUD/rename, ZIP/UNZIP and GET download on an ephemeral localhost server; NOT hostile payload/fuzz or a deployed validation.

Upstream package-source inspection (registry tarball sources, disposable only): cloudcmd@19.24.0 server/cloudcmd.js:211-287 calls config('console') && konsole, config('terminal') && terminal and config('dropbox') && restbox, confirming those integrations are gated under the DataStack configured false values; restafary/HTTP File Manager and editors remain mounted. dropbox-stream@3.2.0 api.js:91 invokes got.stream.post when its Dropbox API function runs; no DataStack-enabled Dropbox call established. spawnify@8.0.1 lib/spawnify.js imports glob, but console disabled; onezip@7.0.3 bin/onezip.js:73 and inly@5.0.1 bin/inly.js:46 use glob in inspected CLI entrypoints, not proof that their library runtime calls have the same glob invocation. Nested ponse@6.0.0/7.0.0 lib/ponse.js:221 calls filetype.fromFile during sendFile(); restbox@4.0.1 uses ponse helpers but Dropbox route conditional; join-io@5.0.0 inspected join.js invokes ponse.getPathName/setHeader/sendError, not sendFile. Cloudcmd main ponse@8.0.2 uses already patched root file-type@21.3.4. No end-to-end DataStack HTTP handler -> vulnerable nested file-type parser demonstrated. Avoid asserting unreachable; dynamic imports, alternate paths, and actual deployed settings remain unverified.

Advisory-specific risk matrix

  • got / GHSA-pfrx-2q88-qq97: malicious response redirect to Unix socket; ancestor @cloudcmd/dropbox -> dropbox-stream@3.2.0 -> got@10.7.0. Dropbox false and route gated; currently no direct invocation proven; risk conditional if integration reenabled, actual run-time policy differs or an alternate path invokes it. No vulnerability fixed.
  • glob / GHSA-3g3m-2fjr-6pw4: aborted async walk may continue filesystem traversal after abort; installed via spawnify/inly/onezip parent chains. Need actual vulnerable glob() with AbortSignal; no such invocation found in inspected DataStack route source and sampled upstream library entrypoints. Conditional/unverified, not classified zero exposure.
  • minimatch / GHSA-g3hv-75wg-m249: attacker-controlled glob pattern together with optimizationLevel >=2 can amplify processing; installed via glob 10/13. No attacker-supplied glob pattern or optimizationLevel=2 reached in inspected DataStack handlers; conditional/unverified without dynamic path tracing.
  • file-type / GHSA-5v7r-6r5c-r473: crafted ASF/WMV/WMA input causes event-loop infinite-loop in affected parser; nested file-type@16.5.4 via ponse@6/7. Upstream ponse.sendFile() calls filetype.fromFile() but its DataStack-mounted invocation not established; Cloudcmd core ponse@8 is patched file-type@21.3.4. Authentication & root restrictions reduce accessible sources but do not guarantee malicious content is impossible. Potential high availability impact if nested vulnerable sendFile invoked on untrusted data. No live exploit test performed.

Risk treatment (PROPOSED, NOT APPLIED): preserve existing disabled Dropbox/terminal/console, mandatory auth and viewer RBAC; inspect effective live config and public exposure only with separately approved READ-ONLY live access. Prefer upstream-compatible backports to got 10, glob 10/13, minimatch 9/10, file-type 16 or maintained vetted forks with identical public API; require independent security review and clean npm lock integrity before approval. For possible file-type parsing DoS, consider a narrowly scoped input/media validation or worker isolation with hard time limit, but any runtime implementation requires separate user permission, tests, and explicit feature-preservation contract. For glob and minimatch investigate exact dynamic patterns/AbortSignal use without feeding hostile payload to production; for got confirm configured Dropbox routes and egress at live edge. Request upstream fixes from maintainers (outside this repo) only when authorized. Existing role/path guards are defense-in-depth, not formal risk acceptance.

Classification: bounded static reachability only. Public proxy path exists at source-level but authentication gate precedes upstream Cloudcmd middleware. Avoid changing or claiming production ACLs; source cannot confirm deployed environment.

P04-S05 STATIC FORENSIC/RISK ASSESSMENT COMPLETE, EXPLOITABILITY NOT PROVEN AND REMEDIATION NOT IMPLEMENTED. No feature, runtime, UI, auth, API, SDK, dependency, lockfile, test, CI, Docker/Compose, secrets, DB or production edit permitted. Only six approved notes may be changed. No fresh broad Gitea CI because source/lock never changes. 20 affected Moderate runtime nodes persist and cannot be declared safe/unreachable based on static evidence; release remains NO-GO. A future narrowly approved risk-treatment patch phase must specify exact file-level exception(s), unchanged feature contracts, isolated adversarial smoke tests and CI acceptance; the alternative is a separately approved monitored risk-acceptance decision. Neither is silently authorized.

P04-S06 — Isolated runtime and advisory forensic findings (2026-11-23)

Approved baseline main 79fae037c5, 420-entry tree 6aad5a6138. Approved dependency versions unchanged: Cloudcmd 19.24.0, Next 15.5.29, PostCSS 8.5.33, DOMPurify 3.4.18. P04-S05 PR #9 static risk findings respected. Four known direct advisories: got GHSA-pfrx-2q88-qq97, glob GHSA-3g3m-2fjr-6pw4, minimatch GHSA-g3hv-75wg-m249, file-type GHSA-5v7r-6r5c-r473.

Isolation: two authorized disposable Windows sessions used after first execution connector became unavailable. The completed controlled run used temp-cloned Gitea baseline with native Windows Node 26.12.0/npm 11.20.0 and a separately installed Node 22.23.5 runtime via npm exec (no source edits). Clean committed-lock npm ci installed 1,278 packages (exit 0), npm ls cloudcmd/got/glob/minimatch/file-type integrity exit 0; git status remained clean. Baseline lock SHA256 AAA2147F736B33F02109E2FECA2209DC17E1016882B2948A0E16AA2344B4D020. Fresh npm audit runtime: 20 affected Moderate package entries/0 High/0 Critical; full: 22 Moderate/0 High/0 Critical, audit exit 1 due existing Moderate findings.

Dynamic test: external disposable CommonJS Module._load instrumentation logged project-root LOAD events for got (via dropbox-stream/api.js), glob (via spawnify/lib/spawnify.js), minimatch (via glob's CommonJS modules), and nested file-type (via restbox/node_modules/ponse and join-io/node_modules/ponse). Feature-disabled Dropbox can still cause its library to LOAD; LOAD is NOT function invocation or reachable exploit. No corresponding monitored vulnerable CALL events recorded before test stopped, and ESM/dynamically imported functions are outside this CommonJS hook's complete coverage. Tracer was NOT committed to the repo, only temporary tooling. Module-load evidence is not end-to-end proof of exploitability or safety.

Focused existing tests/files-manager.test.ts on Windows: native Node 26.12.0 instrumented result 3/4 PASS, 1 FAIL; supported Node 22.23.5 instrumented result 3/4 PASS, 1 FAIL; Node 22.23.5 without instrumentation ALSO 3/4 PASS, 1 FAIL. Identical first failing assertion tests/files-manager.test.ts:154: authenticated PUT /vcon/files-engine/api/v1/fs/client-alpha/note.csv returned HTTP 404, expected 200. GET status/HTML and preliminary checks passed, but full CRUD/ZIP/UNZIP dynamic operations after that point were NOT exercised. Uninstrumented repro rules out tracer as sole cause; Windows-specific reason or environment/proxy path root cause NOT established. Historical Gitea CI #92 Linux File Manager PASS remains prior evidence only, not new P04-S06 acceptance.

Disposition by chain: got (LOAD via Dropbox subtree even with config.dropbox=false; no monitored got request), glob/minimatch (CJS LOAD through spawnify/glob; no monitored aborted traversal or attacker-pattern execution), file-type (nested v16 loads via ponse6/7; no monitored fromFile invocation by the passing portion of tests). Prior static source showed optional Dropbox disabled and ZIP/File Manager enabled; this phase's interrupted E2E is insufficient to prove either reachability or unreachability of any vulnerability.

P04-S06 forensic reachability/disposition COMPLETE but compatible security remediation BLOCKED: P04-S04's latest upstream parent contracts do not accept patched leaf majors, and no publisher-authenticated, vetted, API-compatible older-major backport with exact published integrity and verified regression evidence was established. No unverified override, package or lock patch, npm audit fix --force, app/SDK/test/CI/Docker/Compose/UI/DB/prod change. No new broad Gitea CI because no approved dependency candidate. Only approved notes/001–006 may be committed and mirrored; no deployment, migration, prune, tag, release. Production remains NO-GO; 20 runtime Moderate package entries unresolved. Do not claim full dynamic reachability verification, File Manager compatibility PASS, fixed advisories, or zero exposure.