Repository navigation
Description
New bounded unit per maintainer direction at W3-03 hold. 421-A/B/C remain closed; this is not part of #421. Architectural premise recorded up front: the required analyze context proves CodeQL RAN — it is an analysis-execution gate, not a security-debt gate; 25 open alerts accumulated under green checks.
Triage (completed for the Critical/High lead set + composable pair)
#12 CRITICAL — js/code-injection, packages/rules/src/plugins/loader.js:55 — REAL
new Function(...keys, fnBody) executes plugin source verbatim. Two reachable sinks:
- Repo-controlled:
customRulesService.js:370→getPluginsForRepofetches.gitwire/plugins/*.jsfrom the managed repository; the filters run during custom-rule evaluation on webhook events. Anyone who can merge a file into a fleet repo's plugin directory executes arbitrary JavaScript inside the app process, which holds the GitHub App credentials for all installations and the superuser DB connection. - API-controlled:
POST /api/config/playground(routes/config.js:293) acceptsplugins[].sourcein the request body (API-key gated).
The sandbox is unsound by JavaScript semantics: new Function bodies scope-chain to the true global object; shadowing safe names as parameters hides nothing — process, globalThis, Function.constructor are all reachable from plugin code. The sandbox.js comments ("no require, no fs, no process") do not hold. loader.js:100 itself admits the debt ("In production, we'd use worker_threads").
Severity honestly scoped: critical in the product's multi-tenant threat model (repo write → app RCE → all-installations credential theft). In the CURRENT single-operator deployment both sinks sit inside the operator trust domain (all fleet repos are the operator's; playground is key-gated) — a live but contained exposure, not an active breach vector today.
Planned fix (bounded): worker_threads isolation with message-passing (no ambient authority), an operator-side per-repo plugin authorization gate (repo-controlled files never load by default), and default-off posture. Details frozen in the unit plan before code.
#28 HIGH — js/unvalidated-dynamic-method-call, webhookHandlers/index.js:83 — REAL, low impact, one-line fix
handlers[eventName] dispatches on the webhook event name without an own-property guard: event names like constructor resolve truthy through the prototype chain, dispatch to an unexpected target, and skip the generic-event fallback (silent misrouting). Fix: Object.hasOwn(handlers, eventName) + regression test. Same root family as #36/#37 — unguarded property access on external input — which is why it was triaged alongside them per the composability concern.
#36 / #37 MEDIUM — js/prototype-polluting-function (resolve.js:151, parse.js:79) — FALSE POSITIVES, evidence-backed dismissal
Both flagged merges carry an explicit dangerous-key guard (resolve.js:133 and the mergeDeep loop head: if (isDangerousConfigKey(key)) continue;), a documented rationale, and regression suites proving Object.prototype untouched under direct crafted input (own __proto__ via JSON.parse, 20- and 24-deep nesting, cyclic documents). CodeQL cannot model the custom predicate. Dismissal will cite the guards and tests.
Rate-limiting cluster (#10, #13–#17, #23–#26, #29, #31–#35) — FAMILY FALSE POSITIVE; triage reverses the "no shared policy" premise
A shared policy already exists: app.use(rateLimiter) at app.js:84 runs before every route mount (rollouts mounted at :196; config/maintainer/webhooks/triage/phase4 in the same post-limiter block). Per-route analyzers cannot see the global middleware. The unit will verify each flagged route's mount order post-84 and dismiss per-alert citing the global limiter — no 15 local patches. (If stricter per-route limits are wanted beyond the global policy, that is a separate decision, not this backlog.)
Not yet inspected (queued tranches)
- deps: bump node from 20-alpine to 26-alpine #1/ci: bump github/codeql-action from 3 to 4 #2/ci: bump actions/checkout from 4 to 7 #3 polynomial regex,
reviewSchema.js:273/284/325 - deps: bump pino-pretty from 10.3.1 to 13.1.3 #5 incomplete string escaping,
flakyTestService.js:220 - ci: bump actions/setup-node from 4 to 6 #4 substring self-replacement (dashboard
custom-rules/page.tsx:63, Medium)
Unit plan (maintainer's order, amended by triage findings)
- Fix v0.20.3: Governance hardening — drift re-check, blocked reasons, marker comments #12 (isolation + authorization gate, default-off).
- Fix feat(governance): receipt evidence binding + pass-gate rewiring (v0.23.0 Task 6) #28 (own-property guard).
- Dismiss fix(deploy): propagate commit SHA into production build #36/feat: plan-execution conformance model — receipt-integrity enforcement #37 and the rate-limiting cluster with evidence.
- Triage + clear the regex/escaping/dashboard tranche.
- Durable gate: a check that fails on NEW open Critical/High code-scanning alerts (query the alerts API per PR) so
analyzestays an execution gate while security debt gets its own. - Hold: 421-D and the W3-03 freeze stay stopped until this unit closes.
No code has been changed yet; this issue is the triage record and unit charter. Fixes land as PRs through the 16 required contexts.
Activity
Alajmah commentedon Oct 2, 2026
ARCHITECTURE CORRECTION ADOPTED (maintainer, pre-implementation) — worker_threads rejected as the security boundary
worker_threadswill NOT be the containment mechanism. Node's runtime model defeats it: a worker receives a copy of the parentprocess.env, is not OS-privilege-separated from the process, and the Node Permission Model does not inherit into worker threads. "Worker + message passing = no ambient authority" would recreate the same false-security assumption this unit was opened to remove (#12's cosmetic sandbox).Replacement isolation design (for the later PR): Replacement isolation design (HARDENED 2026-10-02 — bare child process EXCLUDED as the primary boundary; maintainer amendment): the primary security boundary must be a disposable container or equivalent OS sandbox with: no network, empty/minimal environment, no credentials of any kind, read-only root filesystem plus bounded scratch space, non-root UID, dropped capabilities, bounded CPU/memory/PIDs/runtime, a hard kill path, and a narrow serialized request/response interface. A bare child process separates JS heaps only — under the same host/user it still inherits the host network and that OS identity's filesystem permissions — so a child process is acceptable only inside such an OS sandbox, never as the sandbox itself. Node's Permission Model inside that process is optional defense-in-depth, never the primary boundary.
Restructured unit order (supersedes the original plan's sequencing)
/api/config/playgroundrejectsplugins[].sourceunless a separate operator-only flag is present. Small, auditable, closes the execution path before the isolation redesign exists.Object.hasOwn(handlers, eventName)+ regression), kept separate from plugin isolation for bounded review.Object.prototypeuntouched; the rate-limit family is dismissed per-alert only after mechanically verifying each flagged route mounts after the global limiter and has no alternate ungated entry point. No bulk family dismissal.421-D and the W3-03 freeze remain held until this unit closes.
Baseline note (2026-10-02, pre-isolation): triage job 3443 (transient EAI_AGAIN DNS failure, 06:30:23Z, pre-#427-merge) was retried exactly once per maintainer direction and completed at 08:19:32Z; the job left the failed set and
/healthreturned took(470 disposed / 0 actionable). The dependency path to api.github.com is proven healthy; the security-critical runtime change now starts from a clean production baseline.Alajmah commentedon Oct 2, 2026
#12 containment DEPLOYED and VERIFIED in production — contained, not fixed
Deployment chain (PR #427, merged at pinned head
875829eb→ mastere23338b0): genuine push CI #36980556844 success includingpublish-release-images; Deploy to Production #36980974924 success (unchanged trust gate);/health:git_sha=e23338b03023859efacff1344d67cd8a30a67e56, migrations 49/49 current.Production default-off assertions (per the closure requirement)
gitwire-gitwire-app-1): noGITWIRE_ENABLE_*variables set at all. Both gates default-off.{"expression":"true","plugins":[{"source":"module.exports = { benign: () => 2 + 2 }","filename":"benign-probe.js"}]}) against the running app from inside the container returned:This distinguishes "the code defaults off" from "production is actually running off" — production is running off, and the rejection fires before
loadPluginsis ever reached.Honest health note (pre-existing, unrelated)
/healthreportsstatus: degraded—workflows.triagehas exactly 1 actionable failure: job 3443 (triage-issue), failed 2026-10-02T06:30:23.902Z — 74 minutes before this merge — withConfiguration source currently unreadable (Octo-Lex/GitWire@.github/.gitwire.yml): getaddrinfo EAI_AGAIN api.github.com. A transient DNS failure from CT115 to GitHub; the #398 unreadable-source semantics failed honestly instead of degrading silently. No recurrence in the 1.5h since. Retry (operator API) or disposition is a maintainer decision; not touched.Disposition
#12 is CONTAINED, NOT FIXED. The CodeQL alert stays open:
new Functionremains in the codebase, and setting either operator flag restores the unsafe in-process execution path. The next unit is the isolation replacement (child process/disposable container boundary per the amendment above), frozen before implementation per the maintainer's stop; #28 follows after the sink is actually removed. 421-D and W3-03 remain held.feat(425): plugin execution moves behind a disposable OS sandbox (#12 …
Alajmah commentedon Oct 8, 2026
#425 isolation unit DEPLOYED — master
7b07c72e, production verified default-offMerge: PR #445 squash-merged at maintainer-cleared head
21a5e8a7400c7c91bb92872b548f2ec643b73cd9→ master7b07c72e2ad16150ee9c03dd1fe40cc0f532b811(2026-10-08T17:42:50Z).Chain: 18 branches/PRs (#417→#445 supersession chain from the containment onward; this unit's final six: #428–#445), driven by maintainer blocker findings (containment before isolation; worker_threads rejected; bare child process rejected; playground named-expression regression; production wiring absent; strict-parse default-off kill; tag-only presence guarantee; errexit-exempt assertions; tag-inspect vs digest-only install; partial workspace cleanup; P1 result-to-mutation authority) plus CI-iteration fixes and four newly published dependency advisories.
Deployment chain (unchanged trust gate): genuine push CI #37818695332 on
7b07c72esuccess includingpublish-release-images; Plugin Sandbox Proofs green on master push; Deploy to Production #37819373982 success (Security Scan + Deploy Immutable Release both success);/health:git_sha=7b07c72e2ad16150ee9c03dd1fe40cc0f532b811, migrations 49/49current, status ok.Production isolation assertions (verified live on the running deployment):
GITWIRE_ENABLE_REPO_PLUGINSnorGITWIRE_ENABLE_PLAYGROUND_PLUGINSset in the running app container env.@gitwire/rules/pluginsimports in the running app source (the structural test holds in production).GITWIRE_PLUGIN_SANDBOX_IMAGE_REF/_DIGESTpresent but empty (compose passthrough live; plugin evaluation would refuse fail-closed; readiness unaffected).Deployed security properties: untrusted plugin JavaScript never executes inside
gitwire-app(OS sandbox via the executor; hardened flag set; immutableref@digestexecution and inspection; SIGKILL + named-container kill/remove); the sandbox returns matched-rule identifiers only, and the app reconstructs actions exclusively from the trusted resolved config with own-property fail-closed validation (five adversarial regressions prove fabricated output cannot reachpropose). Plugins remain disabled fleet-wide — activation requires explicit operator authorization (the two app flags plus the digest-pinned sandbox identity pair).CodeQL #12 remains OPEN pending disposition review against this deployed OS-boundary evidence. The
new Functioninplugin-sandbox/runner.mjsis inside the disposable container by design; per the unit instruction that does not automatically justify dismissal or closure.Unit sequence state: containment (#427) → isolation (#445) COMPLETE. Next per the agreed order: #28 (own-property dispatch guard), per-alert evidence-backed dismissals (#36/#37 + rate-limit family with mount-order verification), the remaining CodeQL tranche (#1–#3, #5, #4), the differential Critical/High gate. 421-D and the W3-03 freeze remain held.
Alajmah commentedon Oct 8, 2026
#28 remediation DEPLOYED — alert state: FIXED by CodeQL's own analysis
Merge: PR #446 squash-merged at maintainer-cleared head
fa8589cbc287cbb930b675859fb9123dfd118432→ master6216fb8d0c078ab684e6b4f69941bb765dcd61ef(2026-10-08T19:36:57Z).Deployment chain (unchanged trust gate): genuine push CI #37833282478 on
6216fb8dsuccess includingpublish-release-images; Deploy to Production #37833825134 completed success;/health:git_sha=6216fb8d0c078ab684e6b4f69941bb765dcd61ef, migrations 49/49current, status ok. Plugin-execution flags verified absent post-merge (default-off posture unchanged).CodeQL alert #28 — actual state, not regression-inferred
Per instruction, this is the alert's actual post-merge state recorded with supporting evidence — the resolution was established by CodeQL analyzing the own-property dispatch guard, not by the passing regression suite. The stale PR-ref instances are pre-existing analysis artifacts on closed refs and carry no master exposure.
Note on the guard-shape test: maintainer's correction accepted — the synthetic-object test documents own-property semantics but cannot independently verify the registry's contents; the behavioral dispatch tests exercising the real dispatcher are the coverage that matters.
Unit sequence state: #12 containment+isolation DEPLOYED (alert #12 OPEN pending OS-boundary disposition) → #28 remediation DEPLOYED (alert FIXED by analysis). Next in the agreed order: per-alert evidence-backed dismissals (#36/#37 + rate-limit family with per-route mount-order verification), the remaining CodeQL tranche (#1–#3, #5, #4), the differential Critical/High gate. 421-D and W3-03 remain held.
Alajmah commentedon Oct 9, 2026
Per-alert verification tranche — evidence matrix (READ-ONLY; no dismissals or mutations made)
Part A — prototype-pollution alerts
Shared guard fact (verified in source at master
6216fb8d): both flagged loops beginfor (const key of Object.keys(source))and their FIRST statement isif (isDangerousConfigKey(key)) continue;.Object.keysyields only own enumerable keys, and the guard rejects__proto__/constructor/prototypebefore ANY use ofkey(read, recursion, or assignment) in either function. The denylist is private (DANGEROUS_CONFIG_KEYS, not exported; immutable predicate exported only).resolve.js:151—target[key] = value(scalar branch ofmergeSparse)parse.js:79—target[key] = source[key](else branch ofmergeDeep)resolveConfigLayersis exported and accepts unvalidated programmatic inputparseConfig()(runs its own validation first) AND exportedmergeDeep()directly (no validation)resolve.js:133, before all 3 assignment paths (lines 138/147/151)parse.js:72-74, before recursion and assignmentkeyprecedes the guard; nested dangerous keys guarded identically (guard runs at every recursion depth);escapePointerToken(key)only feeds a JSON-pointer stringancestors) orthogonalresolve.test.js:425"own proto keys fed DIRECTLY to the resolver cannot pollute Object.prototype" (crafted input bypassing validation);:357depth-independence testresolve.test.js:370"legacy parseConfig(): a 20+ deep dangerous key is rejected with Object.prototype untouched";:381mergeDeep direct-input testHonest coverage gap (both alerts): the DIRECT-path tests drive only
__proto__.constructorandprototypeare covered at the validation layer (resolve.test.js:348parseConfigLayer test) and the predicate test (:386), but NOT through the directresolveConfigLayers/mergeDeeppaths the maintainers asked about. The guard is key-agnostic (oneisDangerousConfigKeycheck), so the gap is evidentiary, not protective — but per this unit's dismissal standard the tests should exist first. Proposed next step: a test-only PR adding direct-pathconstructor/prototype(nested and top-level) assertions for both functions, THEN dismiss both alerts citing guard + tests.Part B — rate-limit family (15 alerts)
Shared middleware facts (verified in source):
app.use(rateLimiter)atapp.js:84— BEFORE every mount below.req.path === "/health"andreq.path.startsWith("/webhooks")(rateLimiter.js:17).next()(fail-open). Identity = Bearer key, elsereq.ip. Limit 120 req/min./api/*routes below are mounted once each (no duplicate/alternate mounts; no second Express app) and sit behindapiKeyAuth(app.js:96) — so their limiter identity is the API key.Routes that traverse the limiter (12 alerts) — per-alert verdicts:
/api/config/:owner/:repo/api/config; per-key identity; behind apiKeyAuth/api/config/:owner/:repo/api/config/:owner/:repo/api/config/:owner/:repo/restore/:historyId/api/maintainer/collaborators/:owner/:repo/:login/api/maintainer/collaborators/:owner/:repo/:login/api/maintainer/branch-rules/:owner/:repo/:pattern/api/triage/failures/:jobId/disposition/api/rollouts//api/rollouts/:id/evidence/api/rollouts/:id/transition/api/rollouts/:id/approve/api/rollouts/:id/rejectProposed disposition for all 12: dismiss with per-route rationale (the table rows are the rationale; each cites mount line + chain). Two shared caveats recorded with each: (a) operational limitation — Redis outage makes the limiter fail open by design; (b) no regression test pins the limiter itself (skip conditions, identity, fail-open) — recommend a small test-only follow-up before/with dismissal.
Routes deliberately outside the limiter (2 alerts):
routes/webhooks.js:33— POST/webhooks/github(mounted app.js:152)app.js:108— GET/health(inline)startsWith("/webhooks")skip is explicit; integrity control is HMAC signature verification (401 on invalid signature)path === "/health"skip is explicitexpress_raw_body_middleware(webhooks.js:211-220) buffers the ENTIRE request body into memory with no size limit, and signature verification runs only AFTER buffering completes. The 400 missing-headers path also fires after buffering. So: unauthenticated + unlimited rate (skip) + unbounded per-request memory (no cap) = resource-exhaustion surface. The 1MBexpress.jsoncap explicitly does NOT apply (it skips/webhooks)express_raw_body_middleware, e.g. 25MB GitHub ceiling or tighter) and optionally add a webhook-specific high-threshold limiter; do NOT subject it to the 120/min API limiter (GitHub delivery reliability)Summary for review
constructor/prototyperegressions for mergeSparse/mergeDeep; (2) a limiter behavior regression (skip conditions, identity, fail-open).No CodeQL state changes and no source mutations were made in this step, per authorization.
Alajmah commentedon Oct 9, 2026
Matrix corrections (maintainer review of the verification tranche)
Accepted and applied to the record; three corrections to comment 6074964634:
Census corrected: 13 API-route alerts, not 12. Final accounting over the 17 verified alerts: 13 API routes protected by middleware (docs: validator execution model decision (Gap 1 design note) #14–17, docs(v0.23): container-runtime executor service design + CT 115 feasibility #23, feat(executor-service): app-side client + registration (v0.23.0 Task 3) #25, feat(executor-reachability): backend-level reachability + /health integration (v0.23.0 Task 4) #26, feat(deploy): compose + runbook wiring for executor service (v0.23.0 Task 7) #29, fix(release): v0.23.1 — executor-service proof-capture hotfix #31–35) + 2 guarded prototype-pollution findings (fix(deploy): propagate commit SHA into production build #36, feat: plan-execution conformance model — receipt-integrity enforcement #37) + 1 intentional health exemption (v0.21.0: Executor reachability layer — topology detection, selection policy, health exposure #13) + 1 real webhook resource-exhaustion defect (docs(runbook): repository ID reconciliation procedure #10) = 17 total: 15 potential false-positive dismissals, one intentional risk exception, one remediation.
v0.21.0: Executor reachability layer — topology detection, selection policy, health exposure #13 reclassified: intentional exception, not false positive. The health endpoint genuinely has no rate limiting; the finding is accurate about the absence. Its eventual disposition rests on explicit risk acceptance — the operational need for unthrottled health probes (load-balancer and deploy-gate polling) weighed against the residual unauthenticated per-request DB-read surface — not on "CodeQL detected incorrectly."
Identity statement corrected: authenticated Bearer requests are limited per API key; authenticated session-cookie requests fall back to IP-based identity (the limiter reads the Authorization header only). Both classes traverse the limiter.
Implementation sequence per authorization: Unit A (#10 body-size enforcement, HIGH) first; Units B (#36/#37 direct-path regressions) and C (limiter behavior regressions) as separate test-only PRs. Each returns its exact head; no automatic merges; no alert state changes in this phase.
test(36/37): direct-path dangerous-key regressions with explicit nest…
test(limiter): behavior pins + non-Bearer identity-bypass reproducer …
fix(10): streaming 25MiB webhook body cap — explicit disposition, swa…
Alajmah commentedon Nov 22, 2026
Dependency-alert triage — the open critical and high alerts (read-only; nothing changed)
Scope: the 6 open critical/high Dependabot alerts on master
bba0a08, out of 32 open alerts. Each is classified by where it comes from, whether it reaches a production image, whether it is exploitable there, and the available fix.Headline
scope: developmentin Dependabot. That label is accurate for 3 of them and misleading for the rest: the validator image installs the whole development tree.npm audit fix --dry-run).The six alerts
handlebars≤ 4.7.9 — JavaScript injection via AST type confusion incompilets-jest29.4.12 ←web-dashboardcompile().ts-jestcallscompile()in exactly one place, on a template constant of its own (dist/cli/config/init.js).ts-jest's^4.7.9handlebars≤ 4.7.9 — JavaScript injection via own-property check bypassvite≤ 6.4.3 —launch-editorexistence-check bypass (Windows dev server)vitepressnginxplus.vitepress/dist.source-map-js< 1.2.2 — event-loop denial of service through indexed source-map sectionsvitepress→vite/postcss@vue/server-renderer< 3.5.42 — XSS through a CR in an attribute namevitepresspostcss≤ 8.5.17 — path traversal insourceMappingURLauto-loadingvitepress→vite.mapfiles among 416, checked in the production container).How each production image gets its dependencies
Dockerfile)npm ci --omit=dev.next/standalone,.next/static,publicnginxwith.vitepress/distnginxwith the static export inout/npm install --omit=devnpm ci --include=dev, from the rootpackage.jsonandpackage-lock.jsonhandlebars4.7.9,postcss8.4.31,source-map-js1.2.1Evidence for the validator image's contents
The image has no labels, so this is an inference with a short chain, not a direct read.
npm ci --include=dev.npm ciinstalls exactly what the lockfile says.sha256:e2c10a61…, was created 2026-06-25T19:50:27Z.package-lock.jsonfrom 2026-05-31 to 2026-07-19 — 27 commits — the locked versions are identical:handlebars4.7.9 (development, viats-jest),postcss8.4.31,source-map-js1.2.1.Why the validator image does not change the verdict
--network=none,--read-only,--user=1000:1000, a memory limit and a PID limit. The only writable paths are one workspace and a size-limited/tmp.Facts outside the requested scope
scope: runtime, and all 16 are medium. CI's production audit (npm audit --omit=dev, failing on unexcepted high or critical;audit-exceptions.jsonis empty) agrees with that.nextup to 15.5.28. The vulnerable copy isdemo-dashboard's 15.5.28. The production dashboard is on 16.4.6 and is not affected. The demo ships as a static export. These were not triated further here.A gap this exposes
The production dependency audit assumes that production images omit development dependencies. The validator image does not. So a critical finding in the development tree can sit inside a pinned production image while the audit gate stays green — which is the current state. The audit's coverage model misses it, not its thresholds. This relates to #115.
Remediation — proposed, not executed
handlebars4.7.9 → 4.7.10. Docs:vite,source-map-js,@vue/server-renderer,postcss. Together they close all 6 alerts. They change nothing in production: the docs image is a static local build.Alajmah commentedon Nov 22, 2026
Correction to the triage record above — level of certainty
The maintainer's review of 2026-11-22 accepted the classification of the six alerts, with one reservation, which is adopted here. The headline of comment 7079168276 — "None of the 6 is exploitable in production" — was stronger than the evidence supports.
Accepted wording: no practical exploitation path has been demonstrated for the six alerts within the documented production usage. A potential exposure remains inside the validator image and calls for remediation.
What the evidence shows, and what it does not:
Decisions from the same review, as executed:
handlebarsvite(#105) has no lockfile-only fixAlajmah commentedon Nov 22, 2026
Status of the six triaged alerts (2026-11-22, end of day)
handlebarsa1b3665@vue/server-renderer3847171source-map-jspostcssviteFive of the six are fixed. #105 stays open by decision: no
overridesfor Vite 6 under VitePress 1.6.4 and no permanent exception; the path is a study of a VitePress upgrade.Still recorded as accepted risk, unchanged: the pinned validator image carries vulnerable development packages until a change-controlled rebuild (#115).
One finding from today widens the audit-coverage gap on #115: the dashboard and docs images are built without the lockfile, so neither the audit gate nor these alerts describe their contents.