Docs·f32086f3·Updated Dec 4, 2026·105 ADRs
Back
ADR-059implemented

ADR-059: Dependency Vulnerability Remediation + Blocking CI Security Gate

ADR-059: Dependency Vulnerability Remediation + Blocking CI Security Gate

Status: Implemented Date: 2026-05-30 Sprint: 75


Context

A routine audit surfaced 31 npm audit vulnerabilities (6 high, 25 moderate) across the single root package-lock.json (npm workspaces; no separate mobile lockfile), corresponding to ~13–25 open Dependabot alerts depending on how they dedupe. The vulnerable packages fell into three groups:

  1. Root-tree transitive deps reachable from direct root dependencies — qs (express), ip-address (express-rate-limit), uuid (bull, node-cron), fast-uri.
  2. One direct dependency — axios@1.15.2 (high).
  3. Workspace-nested transitive deps buried in the apps/* trees — tar, @xmldom/xmldom, node-forge, picomatch (all via expo in apps/mobile); postcss/next (build-time CSS in apps/frontend + apps/landing); ws/engine.io (via jsdom, test-only in apps/frontend).

The CI security: job had been capped at --audit-level=critical with an explicit comment that "high vulns in expo@54 are unfixable until SDK upgrade." That cap let dependency debt silently reaccumulate. This sprint's mandate: drive the count to zero and convert the cap into a blocking --audit-level=high gate with an SLA, so debt can never silently return.

Options Considered

  1. Expo SDK upgrade to clear the expo-chain highs at the source — large, risky, out of scope; deferred.
  2. npm audit fix --force — rejected: it installs next@9.3.3 (a catastrophic framework downgrade) and other breaking majors.
  3. Patch-at-the-leaf via root overrides + direct bump for axios — chosen. Force-resolve patched leaf versions so the expo-* depends on a vulnerable … parent alerts auto-clear without touching the expo SDK major.

Decision

1. Remediation: overrides-at-the-leaf + one direct bump

  • axios (direct) bumped 1.15.2 → ^1.16.0.
  • Root overrides extended (keeping the pre-existing tar/minimatch/react/react-dom entries) with patched leaf versions: @xmldom/xmldom ^0.8.13, node-forge >=1.4.0, fast-uri >=3.1.2, qs >=6.15.2, ip-address >=10.1.1, postcss ^8.5.10, plus surgical version-range overrides for packages where the patched version is a major bump beyond the narrow vulnerable range (avoids dragging unrelated lower-major copies up): picomatch@3.0.0 - 3.0.1, ws@8.0.0 - 8.20.0, brace-expansion@5.0.2 - 5.0.5, and a parent-scoped jsdom → ws override.

2. The blocking gate

The CI security: job now runs:

- name: Run npm audit (blocking — no high/critical vulns; see ADR-059)
  run: npm audit --package-lock-only --audit-level=high

No build passes with an unaddressed high or critical dependency vulnerability. --package-lock-only keeps it fast and deterministic.

3. The SLA (standing policy)

  • No high or critical vulnerability (dependency or code-scanning) open longer than 1 week.
  • No vulnerability of any severity open longer than 2 weeks.
  • The gate blocks at high; moderates/lows are tracked to zero under the 2-week clause but do not block a hotfix.

Version

10.3.0 → 10.4.0 (minor — ships a behavioral CI gate).


Implementation Notes (hard-won)

These are recorded because they cost real debugging time and will recur:

  1. npm overrides do not reach apps/* workspace subtrees on an incremental install. npm install against the existing lockfile applies overrides to the root workspace tree (uuid/qs/ip-address/fast-uri cleared) but leaves the expo/next/jsdom subtree leaves untouched (14 residual vulns). Only a from-scratch lockfile regen (rm package-lock.json && rm -rf **/node_modules && npm install) applies every override and reaches zero. The trade-off: a from-scratch regen re-floats every ^/~ dependency to its newest satisfying version (~302 packages changed). This was a deliberate, owner-approved decision for this sprint, not an accident.
  2. uuid must be capped at ^11.1.1, not >=11.1.1. The vulnerability is fixed at exactly 11.1.1, but >= resolves to uuid@14, which is ESM-only for Node (no require export condition) and breaks bull's require('uuid') under Jest (SyntaxError: Unexpected token 'export'). uuid@11.1.1 ships a proper CJS build. Verified: node-cron schedules fire and the full suite passes under 11.1.1.
  3. tar needs an exact-version override ("tar": "7.5.15"), not a range. A range override left apps/mobile's @expo/cli copy at the vulnerable 7.5.7; a parent-scoped nested override caused npm to drop tar entirely. Exact-version forces the hoisted, patched copy everywhere.
  4. @swc/helpers must be pinned. A from-scratch regen under Node 24 silently drops it, breaking next build with Cannot find module '@swc/helpers/_/_interop_require_default'. The pin forces npm to materialize the node. Its value follows next's exact @swc/helpers dependency: it was 0.5.15 under next 15 and is 0.5.23 since Sprint 131 D7. Re-read it from node_modules/next/package.json on every next bump.
  5. ts-jest is pinned to 29.4.6. The re-float bumped it to 29.4.11, which changed how its inline-tsconfig object merges with the project tsconfig — dropping moduleResolution: node16 and breaking @karmyq/shared/schemas/ui subpath resolution in request-service tests (TS2307).
  6. apps/mobile type-check was already red on master (pre-existing FlatList/refreshControl overload errors) and is not in the CI gate. The expo-internal version churn from the re-float lands in that already-broken, non-web-deployed workspace and does not regress any gated check.

2026-07-21 advisory refresh (v11.30.1)

New registry disclosures blocked the standing gate with seven high and one critical finding. The follow-up hotfix retained the leaf-override strategy and again rejected npm audit fix --force:

  • direct Axios consumers now require ^1.18.1;
  • exact/surgical overrides move tar to 7.5.21, brace-expansion to 5.0.7, body-parser to 1.20.6, shell-quote to 1.10.0, js-yaml to 4.3.0, and fast-uri to 4.1.1;
  • Next.js remains on 15.5, while its optional image-processing leaf is overridden to sharp@0.35.3; because that release requires Node 20.9+, only the frontend build/runtime images move from Node 18 Alpine to Node 20 Alpine and declare the matching engine floor.

npm audit --audit-level=high returns zero vulnerabilities after the lockfile refresh. The Sharp override is intentionally compatibility-tested through the frontend production build and Docker build gate rather than accepting npm's suggested breaking Next.js downgrade.


Consequences

Positive

  • Zero high/critical/moderate/low npm audit vulnerabilities at v10.4.0.
  • Dependency debt can no longer silently reaccumulate — the gate fails the build.
  • No expo SDK upgrade required; the web demo's shipped backend + frontend + landing runtimes are unaffected by the leaf overrides.

Negative / costs

  • Override maintenance burden. Each override is a manual pin that must be revisited as the ecosystem moves; a too-low cap (e.g. uuid ^11) blocks legitimate future majors until reviewed.
  • Large lockfile churn. Reaching zero required a from-scratch regen that re-floated ~302 transitive packages. Future remediations should prefer the smallest diff that clears the gate (high) and only re-float when zeroing moderates is explicitly in scope.
  • Emergency escape. If the gate blocks a genuine hotfix, git push --no-verify (local) bypasses it; CI remains the backstop. Use only to unblock, then remediate within the SLA.

Relationship to other gates

This is the dependency half of the standing security posture. Code scanning (CodeQL) is a distinct alert class with its own gate under ADR-060 (Sprint 76). /security-review remains the human-level complement to both automated gates, not a replacement.


Alternatives Rejected

  • Expo SDK 54 → 55/56 upgrade — clears the expo-chain highs at the source but is a large, breaking change; deferred to a dedicated sprint.
  • npm audit fix --force — installs next@9.3.3 and other breaking downgrades.
  • Leaving the gate at critical — the status quo that allowed the debt; rejected.

Amendment (Sprint 128, 2026-09-08): unavailable evidence is a failure

BUG-038 exposed that a parsed npm error response could be treated as an empty vulnerability map. The audit boundary now rejects missing/malformed maps, npm error objects and inconsistent severity graphs before registry matching. Subprocess spawn errors, signals, timeouts and unsupported exit statuses also fail; stderr is captured and upstream error bodies are not printed. The process has a 120-second timeout. Valid success and finding responses preserve exemption policy, with critical findings always blocking. Unmatched-entry removal advice requires valid evidence.

tests/regression/sprint-128-audit-response-contract.test.ts proves the empty/populated registry cases, CLI behavior and real child-stderr containment. Sprint 75 raw-count reporting uses the same validated acquisition boundary. This changes evidence handling, not the 30-day renewal authority or severity policy.

The SDK-aligned update also removes the need for the two image-size exemptions. Expo 57.0.20 uses @expo/metro 56.0.2, which pins Metro 0.84.5. Its installed src/Assets.js imports the internal ./lib/imageSize parser; its manifest no longer declares image-size. After confirming no remaining dependency edges, PR B removes the orphaned image-size/queue lock entries and their two unmatched GHSA exemptions. Live lockfile audit on September 8 reports zero high/critical findings with an empty registry. The approved conditional renewal was therefore not applied; the existing remediation alternative resolves the deadline without extending an exception.

Release-time advisory refresh

Later on September 8, fresh audit evidence blocked release preparation even though the previous CI head was green. Auditing the unchanged ec4e4af1 lockfile in a temporary manifest snapshot reproduced one critical and three high vulnerable packages. The maintainer authorized remediation in PR B. A green historical run is evidence for its measurement time, not a permanent security verdict.

  • Both web apps raise their Next.js minimum from 15.5.21 to 15.5.24, including matching @next/env and SWC packages. This addresses the Windows-hosted RCE and AVIF image optimization RCE advisories.
  • The existing Sharp override becomes sharp@<0.35.4: 0.35.4; its native packages move to 0.35.4 and libvips packages to 1.3.3, following the published manifests. The Sharp advisory requires this update independently of the Next.js patch.
  • Existing XML/YAML overrides move to @xmldom/xmldom ^0.8.15 and js-yaml 4.3.2, addressing the audit's XML parser/serializer findings and the YAML merge CPU exhaustion advisory.

The lockfile is spliced using published package metadata, preserving unrelated resolutions and all platform variants. These are dependency updates under the existing policy; no exemptions, new production dependencies, image-optimization bypass or severity-policy changes are introduced. The live SDK compatibility check subsequently advanced Expo/Router to 57.0.21/57.0.20; PR B follows those releases' required dependency closure while retaining SDK 57 and React Native 0.86.3. Strict install, live audit, native image processing, both web builds and the required tests must pass on the final tree before publication. Deployment remains pending PR review and authorization.

Amendment (Sprint 123, 2026-08-10): time-boxed exemptions

Why

The gate as written is binary, and that is a real failure mode: an advisory with no published fix blocks every PR indefinitely. Sprint 123 hit it with image-size (GHSA-w3rx-r6r6-pgpr, GHSA-5p2g-fcmc-qvqq). Verified against the registry, not a changelog:

Escape routeWhy it does not exist
Newer image-sizelatest is 2.0.2; the advisory range is <=2.0.2
Upgrade metrometro@0.87.0 (newest) still declares image-size: ^1.0.2
Override to image-size@2.xmetro/src/Assets.js needs the default export 2.x removed — and 2.0.2 is still affected

Reach is apps/mobile → expo → @expo/metro → metro: a dev-time bundler that ships in no deployed image. The available responses were all bad — leave every PR blocked, drop the gate to critical, or normalise --no-verify. The first two surrender the gate; the third surrenders the habit.

Decision

A finding may be exempted only through security/audit-exemptions.json, evaluated by scripts/audit-exemptions.js. CI and the regression tier call the same evaluator against the same registry, so the two can never drift apart. Sprint 124 moved the registry's common shape, required-field, duplicate, and UTC-date validation into the spec-driven scripts/lib/exemption-registry.js; the audit script still owns every audit-specific rule.

RuleRationale
Exact package + GHSA idNo package-wide wildcard. A second advisory on an exempted package must still block
high onlycritical is never exemptible, whatever the registry says
rationale, decision, owner, created, expires all requiredAn exemption is a decision with a name on it, not a config tweak
expires ≤ 7 days after created, and created not in the future⚠️ This was 7 through Sprint 124; Sprint 125 raised it to 30 behind a weekly monitor (Amendment (Sprint 125): renewal cadence); Sprint 133 restored 7 and retired the monitor (Amendment (Sprint 133): cap restored to 7 days). An exemption buys review time, never permanence. This cap is audit-specific and unchanged by the shared core. The created clause is load-bearing, not paperwork: capping only the span let a forward-dated entry stay inside the cap while suppressing the finding far longer. Sprint 124's /security-review demonstrated a registry that spanned exactly 7 days, validated clean, and suppressed a high for 149. With created ≤ today and span ≤ 7, expires cannot exceed today + 7 — which is the invariant this row always claimed. expires is the first INVALID day, not the last valid one: cross-agent review of Sprint 124 found that treating it as inclusive made a 7-day span live on 8 calendar days, so a "7-day" exemption quietly bought 8. An entry created 08-11 expiring 08-18 is live on the 11th through the 17th
Fails closed on malformed, expired, duplicate, or unmatched entriesAn exemption matching nothing means upstream shipped a fix; it must be deleted, not left to rot
Parent findings clear only when every advisory reachable through npm's via graph is exemptedmetro is high solely because of image-size; the day it gains its own finding it blocks again

Consequences

  • The gate is now stricter in one respect: an expired or stale exemption fails the build, where previously a permanently-unfixable advisory could only be handled by weakening the gate.
  • It is weaker in one respect: a named human can knowingly ship for up to seven days (thirty during Sprints 125–132) with a documented high. That is the trade, and it is recorded in the diff rather than in someone's head.
  • Proof obligation. tests/regression/sprint-123-audit-exemption-gate.test.ts asserts the refusals, not the passes — expired, over-long, malformed, wrong-severity, wrong-id, stale, partially-exempted parents, and the CLI's non-zero exit. A gate demonstrated only by a green run cannot be distinguished from an inert one; this repo has shipped that mistake twice (ADR-060's PR path, and the FROM parser in Sprint 122).
  • The shared validator is deliberately independent of npm audit and now lives in scripts/lib/exemption-registry.js (Sprint 124 / ADR-094). Audit and Expo reuse its mechanics, not its policy: the audit spec alone retains the span maximum (seven days again since Sprint 133), exact GHSA matching, and high-only rule. Critical remains never exemptible.

Amendment (Sprint 125, 2026-08-17): renewal cadence

Status: Accepted · Decision: maintainer, 2026-08-17

MAX_EXEMPTION_DAYS moves from 7 to 30.

What the seven-day cap was actually buying

It was never the number that had value. The value was that a renewal forced someone to re-measure upstream — to go and check whether a fix had shipped. Sprints 123, 124 and 125 each paid that cost by hand: npm view, the two GHSA pages, npm ls, every time, and every time the answer was identical. Three cycles of a manual check that has never once changed its answer is not diligence; it is a ritual, and rituals get performed carelessly or skipped.

What replaces it

.github/workflows/image-size-advisory-watch.yml runs scripts/check-image-size-upstream.js weekly against the live arbiters — the npm registry, GitHub's advisory API, and this repo's own resolved tree. It files an issue the moment a patched release appears, an advisory is withdrawn, a third advisory lands, the resolved tree changes, or the horizon comes within a week. Its evaluate() is pure and every signal has a test that drives it to fire, so it is not a monitor that has only ever been observed passing.

The obligation did not weaken; it moved from a human's memory to a scheduled job. The cap is now the backstop, not the trigger.

What did NOT change

  • critical is still never exemptible.
  • Exact package + GHSA id; no wildcards. A second advisory still blocks.
  • Fail-closed on malformed, expired, duplicate, or unmatched entries.
  • created may not be in the future, and expires is still the first invalid day.
  • The high-severity remediation SLA is unchanged. The cap and the SLA were numerically equal until now and that equality is what made them easy to conflate — they are separate rules, and this amendment decouples them deliberately.

The risk being accepted

A high-severity finding can now sit suppressed for a month rather than a week. That is a real widening, and it is only defensible while the weekly monitor is alive and its issues are read. If that workflow is ever removed or left failing, this cap must go back to 7 in the same change — otherwise the registry becomes what ADR-059 was written to prevent: a place where findings are parked and forgotten.


Amendment (Sprint 132, 2026-10-01): node-forge exemption

Status: Accepted · Decision: maintainer, 2026-10-01

GHSA-86w9-cpqp-85rv (high: RSA PKCS#1 v1.5 signature verification in node-forge <=1.4.0) has no patched release. npm's only proposed fix is a backwards semver-major move to expo@44.0.6. The package reaches the tree only through apps/mobile → expo → @expo/cli / @expo/code-signing-certificates, which is developer tooling. Unexempted, it blocked every PR and every master deploy, including a caller-scope security fix (Sprint 132 PR A). It is exempted in security/audit-exemptions.json under the Sprint 123 rules. One entry clears all four findings, because the three Expo parents are high only through it. A second node-forge advisory still blocks.

Seven days, not thirty. The Sprint 125 amendment ties the 30-day cap to a live weekly monitor, and says the cap returns to 7 if that monitor is "removed or left failing". The only monitor, image-size-advisory-watch.yml, watches image-size alone. It has been red since 2026-09-14, because image-size left the tree in Sprint 128 (issue #236). So this exemption expires 2026-10-08. Renewing it means re-checking by hand: npm view node-forge version, the GHSA page and npm ls node-forge --all. Dependabot security updates (node-forge is not ignored) open a PR when a patched release appears.

The gate now encodes this rule. tests/regression/sprint-125-image-size-monitor.test.ts previously required every exempted package to be in the monitor's WATCHED_PACKAGES. It now requires a package to be watched or exempted for at most 7 days. Fixtures prove that an unwatched 8-day, 30-day or malformed entry is refused, and that an unwatched 7-day entry is admitted. The live entry stretched to 30 days turns the test red. BUG-058 covers retiring or generalizing the monitor, and what happens to the 30-day cap meanwhile.

Amendment (Sprint 132, 2026-10-02): braces exemption

Status: Accepted · Decision: maintainer, 2026-10-02

GHSA-vfj7-8cjw-p6xm (high: stack exhaustion on deeply nested patterns in braces) was GitHub-reviewed at 2026-10-02 22:36Z and covers every version. braces@3.0.3 is the latest release, so there is no patched release; npm's only proposed fix is a backwards semver-major move to nodemon@1.14.10. It surfaced between two attempts of the master run for Sprint 132 PR A (#290, run 37077914525) and blocked that deploy, along with every other PR and master push.

Reach. A lockfile walk of production dependencies (2026-10-02) finds braces only under apps/mobile → expo → @expo/cli → @expo/metro-file-map → micromatch → braces, the Expo developer CLI. No service and no packages/shared production tree reaches braces or micromatch; every other path (next's eslint plugin, chokidar, nodemon, fast-glob) is a devDependency; and no repo source imports either package, so no request input reaches a brace pattern. One entry in security/audit-exemptions.json clears all 18 findings, because every parent is high only through braces. A second braces advisory still blocks.

Seven days, not thirty, for the same reason as node-forge: no live monitor watches braces (BUG-058). The exemption expires 2026-10-09. Renewing it means re-checking by hand: npm view braces version, the GHSA page and npm ls braces --all. Tracked as BUG-059.

Amendment (Sprint 132 closeout, 2026-10-08): renewals and the 2026-10-08 advisory batch

Status: Accepted · Decision: maintainer, 2026-10-08

Renewals. Both exemptions were re-checked by hand on 2026-10-08, and neither has an upstream fix:

PackageAdvisoryLatest releasePatched versionNew window
node-forgeGHSA-86w9-cpqp-85rv1.4.0 (range <= 1.4.0)none2026-10-08 → 2026-10-15
bracesGHSA-vfj7-8cjw-p6xm3.0.3 (range <= 3.0.3)none2026-10-08 → 2026-10-15

Expo has not moved either: the latest @expo/cli (57.0.28) still depends on node-forge ^1.3.3, and @expo/code-signing-certificates 0.0.7 needs ^1.4.0. The reach of both packages is unchanged (the Expo developer CLI under apps/mobile only). The maintainer's rule was to remove each exemption if upstream shipped a fix, and otherwise renew it for seven days. node-forge had already lapsed: expires is the first invalid day, so the 2026-10-08 entry stopped every push that morning. The renewal ships in the same PR as the advisory fixes below, because nothing can merge without it. Seven days is still the cap for an unwatched package (BUG-058).

The batch fixed in the same PR, using in-place lock splices with no exemption:

  • shell-quote GHSA-pqg4-j6r4-53mv (critical, >=1.8.4 <1.11.0): 1.10.0 → 1.12.0 through react-devtools-core. The override shell-quote@<=1.8.4 → 1.10.0 pinned a now-vulnerable target, so it becomes shell-quote@<1.11.0 → 1.12.0.
  • handlebars three advisories (critical, 4.0.0–4.7.9): 4.7.9 → 4.7.10 (dev only, through ts-jest).
  • next six advisories (high, 16.0.0–16.3.7): 16.3.6 → 16.3.8, together with @next/env and the eight @next/swc-* binaries. The apps/frontend and apps/landing ranges become ^16.3.8.
  • sharp GHSA-wq5f-xc86-pv6w (high, <0.35.5): 0.35.4 → 0.35.5, together with its @img/* platform packages (libvips 1.3.3 → 1.3.4). The override becomes sharp@<0.35.5 → 0.35.5.

Amendment (Sprint 133, 2026-10-10): cap restored to 7 days

Status: Accepted · Decision: maintainer, 2026-10-08 (BUG-058 option (b))

MAX_EXEMPTION_DAYS returns from 30 to 7 (scripts/audit-exemptions.js), and the image-size monitor is retired: .github/workflows/image-size-advisory-watch.yml, scripts/check-image-size-upstream.js and tests/regression/sprint-125-image-size-monitor.test.ts are deleted. The Sprint 125 amendment made the 30-day cap conditional on a live weekly monitor and said the cap returns to 7 if that monitor is removed or left failing. The monitor watched image-size alone, image-size left the tree in Sprint 128, and the watch has been red since 2026-09-14 (issue #236). Generalizing it (option (a)) was declined: two short-lived exemptions do not justify a second live arbiter, and a renewal every seven days is the re-measurement.

The general cap now enforces what the monitor test special-cased. The Sprint 132 rule "an unwatched package may be exempted for at most 7 days" lived in the deleted monitor test. With no watched packages left, every package is unwatched, so the rule is simply the cap. tests/regression/sprint-123-audit-exemption-gate.test.ts derives its boundary pair from MAX_EXEMPTION_DAYS and pins 7, with an explicit 7-day-accepted / 8-day-rejected case. A live entry stretched to eight days turns the regression tier red.

What did not change: the high-severity SLA (≤ 1 week), the exact package + GHSA matching, fail-closed on unavailable evidence (Sprint 128), and the hand re-check on every renewal (npm view, the GHSA page, npm ls --all). The two live exemptions (node-forge, braces, 2026-10-08 → 2026-10-15) already span exactly seven days.

Local configuration is refused before the audit runs (Sprint 133 PR S, found on push). main() used to run the networked npm audit before reading the registry, so while the audit endpoint was degraded (2026-10-10, each call hit the 120 s timeout) a bad KARMYQ_AUDIT_REGISTRY was reported as "evidence unavailable" instead of being refused, and the pre-push hook went red on an unrelated diff. The registry is now read first. Both orders fail closed; only the reason was wrong. The refusal cases run with PATH emptied so they never touch the network, which reproduced the push failure in six seconds before the fix.

Amendment (Sprint 133, 2026-10-14): renewals

Status: Accepted · Decision: maintainer, 2026-10-14

Both exemptions were due to lapse on 2026-10-15 (expires is the first invalid day). A hand re-check on 2026-10-14 found no upstream fix for either:

PackageAdvisoryLatest releasePatched versionNew window
node-forgeGHSA-86w9-cpqp-85rv1.4.0 (range <= 1.4.0)none, not withdrawn2026-10-14 → 2026-10-21
bracesGHSA-vfj7-8cjw-p6xm3.0.3 (range <= 3.0.3)none, not withdrawn2026-10-14 → 2026-10-21

Expo has not moved: the latest @expo/cli (57.0.30) still depends on node-forge ^1.3.3. Reach is unchanged. npm ls --all --omit=dev reaches both packages only through apps/mobile → expo → @expo/cli (the Expo developer CLI), with one lock node each. Under the maintainer's 2026-10-08 rule (remove an exemption once upstream ships a fix, otherwise renew it for seven days), both are renewed for seven days, the cap.

Amendment (Sprint 133, 2026-10-17): renewals

Status: Accepted · Decision: maintainer, 2026-10-17

Both exemptions were due to lapse on 2026-10-21 (expires is the first invalid day, read as a UTC date, so the gate would have failed from 2026-10-20 17:00 PDT). A hand re-check on 2026-10-17 found no upstream fix for either:

PackageAdvisoryLatest releasePatched versionNew window
node-forgeGHSA-86w9-cpqp-85rv1.4.0 (range <= 1.4.0)none, not withdrawn2026-10-17 → 2026-10-24
bracesGHSA-vfj7-8cjw-p6xm3.0.3 (range <= 3.0.3)none, not withdrawn2026-10-17 → 2026-10-24

Expo has not moved off either package. The latest @expo/cli (58.1.11) and @expo/code-signing-certificates (0.0.7) depend on node-forge ^1.4.0, and the latest micromatch (4.0.8) depends on braces ^3.0.3. Reach is unchanged: npm ls --all --omit=dev reaches both packages only through apps/mobile → expo → @expo/cli. Under the maintainer's 2026-10-08 rule, both are renewed for seven days, the cap.

Amendment (Sprint 133, 2026-10-19): renewals

Status: Accepted · Decision: maintainer, 2026-10-19

Same re-check and rule as the 2026-10-17 amendment above; only the observed versions and the window change (previous expiry 2026-10-24). Reach was re-measured, not inherited: npm ls --all --omit=dev node-forge braces on 2026-10-19 still reaches both only through apps/mobile → expo 57.0.25 → @expo/cli 57.0.27 (the lockfile's resolution; the newer upstream releases below are not installed).

PackageLatest releasePatched versionUpstream dependent (latest)New window
node-forge1.4.0none, not withdrawn@expo/cli 58.1.13, @expo/code-signing-certificates 0.0.7 → ^1.4.02026-10-19 → 2026-10-26
braces3.0.3none, not withdrawnmicromatch 4.0.8 → ^3.0.32026-10-19 → 2026-10-26

Amendment (Sprint 134, 2026-10-22): next critical advisory

Status: Accepted · Decision: fix in place, no exemption (critical is never exemptible)

Two next advisories were published at 15:50–15:53 UTC on 2026-10-22, after that day's deploy of v11.96.0: GHSA-2464-fhr4-w9xw (critical, remote code execution in the Image Optimization API through the sharp/libvips memory bug on glibc Linux; the advisory's workaround is sharp >= 0.35.5) and GHSA-p3m5-59mp-jv5r (high, App Router denial of service through Server Actions). Both cover >=16.0.0 <=16.4.0, and both are first patched in 16.4.1. No 16.3.x backport exists. Neither advisory is reachable on the demo: sharp has been 0.35.5 since the 2026-10-08 override, the frontend image is node:24-alpine (musl, not glibc), and neither app has a Server Action (the frontend uses the Pages Router; the landing site uses the App Router as a static export, with no server runtime). The gate audits the declared tree, not reachability, and critical is never exemptible, so next moves anyway.

Fix: an in-place lock splice, next 16.3.8 → 16.4.2, together with @next/env and the eight @next/swc-* binaries. The apps/frontend and apps/landing ranges become ^16.4.2. next's new sharp ^0.35.5 range is already satisfied by the existing sharp@<0.35.5 override, so nothing else moves.

Amendment (Sprint 134, 2026-10-26): Security PR X

Status: Accepted · Decision: maintainer, 2026-10-20 (node-forge renewal, reconfirmed 2026-10-26) and 2026-10-26 (every zod copy to 4.6.6)

Both exemptions lapsed on 2026-10-26 before a renewal merged, so every push and CI run failed the gate. Three high advisories published since the 2026-10-19 renewal failed it as well. A re-check on 2026-10-26 found:

PackageAdvisoryState on 2026-10-26Action
bracesGHSA-vfj7-8cjw-p6xmwithdrawn 2026-10-23 12:53Zexemption deleted (BUG-059 closed)
node-forgeGHSA-86w9-cpqp-85rv<= 1.4.0, no patched version, not withdrawn; 1.4.0 latest; @expo/cli 58.1.15 and @expo/code-signing-certificates 0.0.7 still need ^1.4.0renewed 2026-10-26 → 2026-11-02
body-parserGHSA-27r3-jxmh-p828 (high, published 2026-10-23)>= 2.0.0 < 2.4.0 and < 1.20.92.3.0 → 2.4.0; the 1.x selector retargeted to 1.20.9
undiciGHSA-xjj6-f33q-929c (high) and two moderates (published 2026-10-23)>= 7.18.0 < 7.30.17.30.0 → 7.30.1
zodGHSA-mrhx-c7xc-m3w5 (high, published 2026-10-01)< 4.6.6root 4.6.5 → 4.6.6; @expo/cli's nested 3.25.76 removed

Fix: an in-place lock splice whose packages match npm 11.19.0's own re-resolve node for node (that reference pinned zod exactly; the shipped ranges are ^4.6.6). body-parser 2.4.0 also requires content-type ^2.1.0, so its nested copy moves 2.0.0 → 2.1.0. Its qs ^6.16.1 edge had been loosened by the bare root qs >=6.16.0 override, so the floor becomes >=6.16.1 and qs moves 6.16.0 → 6.16.1 (no advisory; the body-parser fix is in its own stream handling). The body-parser@<1.20.9 selector now lifts any 1.x copy to the patched 1.20.9 (it pointed at 1.20.6, which this advisory covers; no 1.x copy exists). The exact undici override moves to 7.30.1, and the range selector it shadowed is deleted. @expo/cli (57.0.32, and the latest 58.1.15) declares zod ^3.25.76, so the scoped override "@expo/cli": { "zod": "4.6.6" } pins it to the root's current version, so it resolves the root copy and the nested node goes. The pin is exact on purpose (a $zod reference would carry @expo/cli across a future major unchecked), so the two must move together. @expo/cli loads zod only in two dev-server schema modules. Its real consumers were run on the same valid and invalid plugin manifests, command outputs and MCP arguments under zod 3.25.76 and 4.6.6, and every outcome matched. Its MCP registerTool path was not run: it needs EXPO_UNSTABLE_MCP_SERVER and the expo-mcp package, and this repo has neither, so adding expo-mcp means re-checking it under zod 4. sprint-131-d9-security-overrides.test.ts fails if the pin and the lock's single zod copy diverge. Sprint 146 (2026-11-25): @expo/cli 57.0.35 no longer lists zod as a runtime dependency. It is only a devDependency (^3.25.76), which consumers never install. The CLI resolves zod from expo-mcp's directory, and only for MCP (build/src/start/server/mcp/MCP.js:60). The runtime zod was dropped in 57.0.33 and 58.1.18; 57.0.32 and 58.1.17 (and 58.1.15, cited above) still declare zod ^3.25.76 (registry, 2026-11-25). The scoped pin therefore applies to nothing in this lock. The maintainer kept it on 2026-11-25 as a guard for any @expo/cli that declares a runtime zod ^3. The pin would force 4.6.6 onto such a version silently, so a bump that brings a runtime zod back must re-run the consumer check above before keeping the pin. The lock's single zod copy stays at 4.6.6, and retiring the pin is an open candidate. Adding expo-mcp now means checking the zod that expo-mcp itself brings.

Validator rule. validAuditReport rejected the report from npm 10.8.2 (the Windows box's PATH npm): expo-server-sdk moderate with via: ["undici"], and undici high. npm ranks a dependent by the meta-advisories that apply to its own version and range, and names the package in via regardless (@npmcli/arborist lib/audit-report.js, lib/vuln.js). CI's npm 11.19.0 omitted expo-server-sdk entirely, so only the local gate and the pre-push hook failed closed on valid evidence. Severity is now ranked only against advisory objects. An advisory ranked above its own package would be skipped, because the evaluator reads only high and critical entries, so that check stays. A string via names another entry, which is evaluated on its own, so a dependent ranked below it hides nothing. tests/regression/sprint-128-audit-response-contract.test.ts holds both sides: npm's shape is accepted and still blocks on undici, and a high advisory under a moderate package is still rejected.

Amendment (Sprint 134, 2026-10-28): node-forge fixed upstream, exemption removed

Status: Accepted · Decision: maintainer, 2026-10-28, under the 2026-10-08 rule (delete an exemption once upstream ships a fix)

node-forge 1.4.1 (2026-10-27) fixes the forgery behind GHSA-86w9-cpqp-85rv, and 1.4.2 (the same day) fixes a pem.decode regression that 1.4.1 introduced for Buffer input. The global advisory still reads <= 1.4.0 with no patched version. The vendor's repository advisory GHSA-2g46-22mc-6gwp (CVE-2026-85393) describes the same defect (extra elements in the nested DigestAlgorithm) and names 1.4.1 as patched. The same change clears two moderates that are due inside their two-week SLA:

PackageAdvisoryRange → fixLockReach
node-forgeGHSA-86w9-cpqp-85rv (high)<= 1.4.0; vendor names 1.4.11.4.0 → 1.4.2apps/mobile → expo → @expo/cli, @expo/code-signing-certificates
ip-addressGHSA-rxp7-6hxx-x8q5 (moderate)<= 10.7.3 → 10.7.410.7.2 → 10.7.4express-rate-limit 8.7.0 in every service image
fast-uriGHSA-w74x-v6f9-j3xg, GHSA-wjr9-j795-jxcr (moderate); GHSA-xhq7-xmqj-769h, GHSA-333x-w4r6-6crp (low)< 4.2.3 → 4.2.34.2.1 → 4.2.3ajv (dev only)

The lock change clears the gate, not the deletion. The node-forge entry is deleted and the registry is empty again; the old lock over the same empty registry still blocks on GHSA-86w9-cpqp-85rv. The extra-DigestAlgorithm forgery is rejected under 1.4.2, and @expo/code-signing-certificates' own paths pass on it.

ip-address reach. Both rate-limit keys (packages/shared/middleware/rateLimit.ts and cleanup-service's default) go through ipKeyGenerator, which builds Address6 only after node:net isIPv6 accepts the input. isIPv6 rejects the advisory's trigger, so it never reached the parser there. 10.7.4 is the first patched version.

Floors. The overrides become node-forge >=1.4.2, ip-address >=10.7.4 and fast-uri >=4.2.3. They stay bare floors; converting them to selectors is the open 2026-10-26 follow-up in docs/IDEAS.md. Raising them loosens no dependent's range further, but one was already loose: since #156 (v11.30.1) the fast-uri floor has handed 4.x to ajv 8.20.0, which declares ^3.0.1 (dev only; 3.1.9 is also patched, see docs/IDEAS.md 2026-10-28). The gate reads only high and critical, so a moderate sliding back would pass it. tests/regression/sprint-131-d9-security-overrides.test.ts therefore holds each floor and every locked copy at or above its patched version.

Dependabot #318 (fast-uri) was not used. Besides the bump, it deletes 26 libc fields from the sharp and @img platform binaries, which select the musl builds the Alpine images need.

Not changed: deepmerge GHSA-gcqx-w48m-w2h4 is low with no fix (4.3.1 is the latest), so it is below this gate and gets no registry entry. Re-check closed (Sprint 146, 2026-11-24): GitHub withdrew the advisory at 2026-11-16T18:55:38Z (gh api advisories/GHSA-gcqx-w48m-w2h4 → withdrawn_at; summary now "Withdrawn Advisory: deepmerge mergeObject() allows prototype poisoning of returned objects", CVE-2026-93753). The "low with no fix, below the gate floor" reasoning above is therefore moot: there is no advisory left to gate. The re-check was owed for Dependabot alert #178, dismissed tolerable_risk on 2026-10-28 (Sprint 134), at the next Expo SDK move or by 2026-12-01. On 2026-11-25 gh api repos/ravichavali/karmyq/dependabot/alerts/178 returned HTTP 410, "Alert number 178 has been withdrawn", and there were 0 open Dependabot alerts. (Sprint 146 first cited PR #178 here, an unrelated 2026-07-30 dev-deps bump; that citation was wrong.) The lock still holds deepmerge 4.3.1, the latest release. There was no upgrade, no registry entry and no exemption change, and the obligation is closed. decode-uri-component GHSA-vcc3-ghjq-m6fr (moderate) stays BUG-041: alert #150 was dismissed as tolerable risk on 2026-09-14, and 0.5.1 (2026-10-23) is still ESM-only.

Amendment (Sprint 147, 2026-12-01): cross-spawn critical; engine.io, ws, minimatch highs

Status: Accepted · Decision: maintainer, 2026-12-01: bundle the fix as Sprint 147 Task 0, the first implementation commit, if the PR merges by 2026-12-07 18:56:43 PT (2026-12-08T02:56:43Z); "dependency-lane yes for Task 0". That deadline is seven days after the earliest advisory below (engine.io, 02:56:43Z).

Four advisories in the global database, all published on 2026-12-01, failed the gate on every branch. npm audit reported 1 critical and 7 high. The other four highs (engine.io-client, socket.io, socket.io-adapter and socket.io-client) were parents flagged through engine.io or ws, and none of them had to move. Each upstream repository's published advisories were also read. Three of them had not reached the global database by the 2026-12-01 check (gh api /advisories/<id> returned 404, and ?affects= found nothing for the versions below):

PackageAdvisoriesRange → first patchedLockReach
cross-spawnGHSA-ghv9-86vm-4v8m (critical); repository GHSA-w3gc-668g-rf8f (high, CVE-2026-137197) and GHSA-m6qr-m48x-3xhh (moderate)7.x < 7.1.0 → 7.1.0; 7.x < 7.1.1 → 7.1.17.0.6 → 7.1.2eslint (root and cleanup-service), execa, @expo/spawn-async, @react-native/debugger-shell. Every advisory is Windows cmd.exe only, and every image is node:24-alpine
engine.ioGHSA-v775-f652-7rv6 (high); repository GHSA-c8pq-854x-25q2 (high, published 13:02:48Z)< 6.6.12 → 6.6.12; < 6.6.13 → 6.6.136.6.11 → 6.6.13messaging-service's Socket.IO server (socket.io 4.8.3, ~6.6.0)
wsGHSA-37g9-w4hg-h9qr (high)8.x < 8.23.0, 7.x < 7.5.14 (also 5.x and 6.x lines)hoisted 8.21.0 → 8.23.0; the four 7.x copies under react-native, metro, @react-native/dev-middleware (7.5.13) and react-devtools-core (7.5.11) → 7.5.14; one extraneous copy removedengine.io and socket.io-adapter in messaging-service; engine.io-client under both apps' socket.io-client; jsdom; the React Native dev servers (7.x)
minimatchGHSA-cf2h-pxjq-68xw (high); GHSA-c859-jr93-m5j4, GHSA-hqmv-qgp3-jx75 (moderate); repository GHSA-3924-r96c-gp9w (low)11.0.0–11.0.6 → 11.0.7; <= 11.0.7 → 11.0.8; 11.0.6–11.0.9 → 11.0.1011.0.3 → 11.0.10, with @isaacs/nonrecursive-glob-match 1.0.3 → 1.1.0 (11.0.10 requires ^1.1.0)eslint and its plugins, glob, nodemon, test-exclude, typescript-estree, @expo/fingerprint

Targets go past what today's audit asks for. The first versions that clear the 2026-12-01 audit (cross-spawn 7.1.0, engine.io 6.6.12, minimatch 11.0.8) are still affected by the three repository advisories, so the gate would fail again once those reach the global database. Sprint 134 saw the same pattern with node-forge (GHSA-2g46-22mc-6gwp named the fix before the global record did). cross-spawn goes to 7.1.2, not 7.1.1: 7.1.2 fixes a 7.1.0 Windows regression where a batch file found in PATH lost its own directory in %~dp0, and its dependencies are unchanged. ws stays on the first patched releases: 8.23.1 carries no advisory.

Fix. Four override values change, and nothing is added:

  • engine.io . 6.6.11 → 6.6.13.
  • The scoped ws pins under engine.io, engine.io-client and socket.io-adapter: 8.21.0 → 8.23.0.
  • The minimatch floor: >=11.0.1 → >=11.0.10.

engine.io 6.6.13 now declares ws ^8.23.0 (6.6.12 still declared ~8.21.0), so its own pin sits inside its range. engine.io-client 6.6.5 and socket.io-adapter 2.5.7 still declare ~8.20.1, so their pins force 8.23.0, as they forced 8.21.0 before. Several things are unchanged: no new override, root dependency or registry entry; the @expo/cli zod guard; and all 26 libc fields and 129 os/cpu entries. The jsdom ws >=8.20.1 floor and the ws@8.0.0 - 8.20.0 selector stay too, because neither decides a locked node.

The lock splices nine nodes in place and removes one. Each spliced node equals npm 11.19.1's own npm update cross-spawn engine.io ws minimatch @isaacs/nonrecursive-glob-match --package-lock-only result field for field, and equals npm view <name>@<version> --json (map fields key-sorted). That reference also rewrote one node outside this change, deepmerge's dev flag, which was not taken.

The removed node is apps/mobile/node_modules/@expo/cli/node_modules/ws 8.21.1. Sprint 121 (#165) added it under a nested @expo/cli, and Sprint 122 PR 3 (#186) removed that parent and left it flagged extraneous. No lock node is its parent, and npm ci never installs it, but npm audit still reads it. npm 11.19.1 keeps extraneous entries in --package-lock-only mode (neither update nor prune removed it), so deleting it is a deliberate edit. The other two extraneous entries, the nested globals 16.4.0 under each app's eslint-config-next, carry no advisory and stay.

Windows behaviour change. cross-spawn 7.1.x changes how cmd.exe runs batch files. A line break in an argument throws a TypeError. Inner quotes are escaped as "", cmd.exe runs with /e:on /v:off, and the command is always quoted, so a command string with its arguments inside it now fails with ENOENT. The images are Linux, so this reaches only local Windows development.

Proof (2026-12-01, Windows box, CI's npm 11.19.1 and Node 24 major):

  • Strict npx -y npm@11.19.1 ci exits 0 from a C:\ cwd, and the lock and manifest are byte-identical afterwards.

  • Lock-only npm ls --all problem lists match before and after (64 lines each). The targeted npm ls tree has the same shape, and only the target versions move. On the installed tree, npm ls --all reports only the known color-string, ms and picomatch entries plus the existing @react-native/metro-config gap.

  • npm audit drops from 1 critical, 7 high, 10 moderate and 1 low to 0, 0, 10 and 1, and node scripts/audit-exemptions.js exits 0.

  • tests/regression/sprint-131-d9-security-overrides.test.ts goes red on the old lock (seven cases) and green on the new one. It now holds four things:

    • engine.io at 6.6.13 or later;
    • the minimatch floor and every copy at 11.0.10 or later;
    • each scoped ws pin equal to the patched hoisted copy;
    • every cross-spawn and ws copy on a patched release of its own line.

    A copy on a line the advisories do not cover fails until someone checks it.

Below the gate, fixed in a second commit. Three more advisories published on 2026-12-01 sit below the gate, inside their two-week SLA (due 2026-12-15). The maintainer bundled them the same day ("Bundle the residuals as a second commit"):

PackageAdvisoriesRange → first patchedLockReach
globGHSA-qxr8-q827-836c (moderate); repository GHSA-c6wh-w8c3-cv3g (low, <= 14.0.5, not yet in the global database)13.0.5–14.0.5 → 14.0.614.0.3 → 14.0.7jest (@jest/reporters, jest-config, jest-runtime), test-exclude, @expo/cli, @expo/config, @expo/config-plugins, @expo/metro-config
terserGHSA-6jpm-p5cq-9q44 (moderate)5.x < 5.51.3 → 5.51.3; < 4.8.2 → 4.8.25.48.0 → 5.51.4metro-minify-terser (mobile bundles)
node-forgeGHSA-w73w-hhm4-q25p (low)<= 1.4.3 → 1.4.41.4.3 → 1.4.4@expo/cli, @expo/code-signing-certificates

Overrides: glob >=14.0.2 → ^14.0.6 and node-forge >=1.4.3 → >=1.4.4. The glob floor is now bounded to its major. glob 15.0.0 shipped on 2026-11-30, so an unbounded floor would carry jest and Expo across a major on the next re-resolve (the uuid ^11.1.1 lesson in Implementation Notes). terser needs no override: its one dependent declares ^5.15.0.

Each target is npm 11.19.1's own npm update glob terser node-forge --package-lock-only choice, and each node equals the registry (the same deepmerge dev flag was again left out). glob 14.0.7 adds only a memory-retention fix over 14.0.6. terser 5.51.4 removes source maps that 5.51.3 shipped by accident. terser 5.51.3 also changes source-map output: with an input source map, includeSources must now be set explicitly to embed the original source. That reaches only Metro's minified mobile bundles. Nothing is added or removed, and the libc and os/cpu counts are unchanged.

Proof: strict npx -y npm@11.19.1 ci exits 0, with the lock and manifest unchanged. Lock-only npm ls --all problem lists are identical, and npm audit is clean, 0 findings at every severity. The d9 test fails on three cases first: the glob and node-forge floors, and a new terser per-line check.