> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lumenwipe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Security tooling remediation plan

> Results of the dependency audit, static analysis, and secret scan run for the security hardening pass, with a resolution or accepted-risk rationale for every finding.

> This document completes the security work of epic #166, alongside the adversarial
> test suite (running in CI since #191) and the [STRIDE threat model](https://docs.lumenwipe.com/threat-model.md) (#170). It
> records what three security tools found against the codebase on **2026-09-02** and gives
> every critical, high, and medium finding a resolution or an explicit accepted-risk
> rationale, never a silent backlog entry.
>
> **Self-assessed.** Written by the LumenWipe maintainers, not by an outside reviewer. Published security reports
> are listed at [lumenwipe.com/security/reports](https://www.lumenwipe.com/security/reports).

> **Status as of 2026-10-30.** Sections 1 to 6 record the 2026-09-02 pass, Section 7 the 2026-09-29
> refresh, Section 8 the 2026-10-13 pass (commit `d1ab2cb`) and Section 9 the 2026-10-30 dependency refresh; findings, counts and versions are as of
> those dates, not live. **Next refresh:** see Section 10.

## 1. Scope and method

Three tool categories, run against `chore/security-tooling-remediation-171` (branched from
`feature/phase-2` at commit `28287a6`):

1. **Dependency audit** - `bun audit` (Bun 1.3.11's native advisory scanner) across the full
   workspace lockfile.
2. **Static analysis** - `semgrep` 1.175.0, rule packs `p/security-audit`, `p/typescript`,
   `p/javascript`, `p/secrets`, against `apps/` and `packages/` (excluding `node_modules`, `.next`,
   `dist`).
3. **Secret scanning** - `gitleaks` 8.30.1 against the **full git history** (352 commits), not just
   the working tree, since a since-rotated secret in an old commit is still an exposure.

Every finding below was triaged by actual reachability, not by severity label alone: for each
flagged package, its dependency path was traced (`bun pm why`), and where the code could plausibly
ship to a browser, the production bundle was inspected directly for its presence. This mirrors the
method the [threat model](https://docs.lumenwipe.com/threat-model.md) uses for its own residual-risk table (now Section 11) - a
mitigation or an acceptance is only as good as the evidence behind it.

Out of scope: a third-party penetration test or formal audit, which has not been done.

## 2. Dependency audit

`bun audit` started at **78 advisories across 25 packages** (1 critical, 36 high, 34 moderate, 7
low). Three rounds of remediation:

| Stage | Advisories | Packages | Critical | High | Moderate | Low |
| - | - | - | - | - | - | - |
| Initial | 78 | 25 | 1 | 36 | 34 | 7 |
| After `bun update` (every workspace, semver-respecting) | 58 | 23 | 0 | 28 | 23 | 7 |
| After targeted `overrides` (below) | 39 | 17 | 0 | 22 | 11 | 6 |

**Fixed.** `bun update`, run per workspace (the root-level command alone does not descend into
nested workspaces), absorbed already-compatible patched versions with no `package.json` change:
this alone cleared the critical finding (`protobufjs`, see below) and every `next.js` advisory
(`^15.5.19` → resolved `15.5.25`, past the `15.5.21` fix line). A further round added five targeted
entries to the root `overrides` map (the same mechanism already pinning `@stellar/stellar-sdk` and
`postcss`), because these packages are pulled in by dependencies that pin them exactly rather than
by range:

| Package | Was | Now | Why an override was needed |
| - | - | - | - |
| `axios` | 1.16.0/1.16.1 | `^1.20.0` | Pinned exactly by `@stellar/stellar-sdk@17.2.1` (itself deliberately pinned, see CLAUDE.md) |
| `form-data` | 4.0.5 | `^4.0.6` | Transitive via the same `axios` chain |
| `body-parser` | 1.20.4 | `^1.20.6` | Pinned exactly by `@nestjs/platform-express` |
| `lodash` | 4.17.21 | `^4.18.1` | Pinned exactly by `@nestjs/config` and `@nestjs/swagger` |
| `postcss` | `^8.5.15` | `^8.5.26` | The existing override's floor predated the two 2026 CVEs; widened past both fix lines |

Verified safe: `bun run type-check && bun run lint && bun run test` all pass across the full
workspace after every change (1,181 tests, 0 failures, as of 2026-09-02; the count changes with every commit), and `bun run format:check` is clean (the
`prettier` devDependency bump pulled in by the same `bun update` reflowed six files' comments -
purely cosmetic, no logic changed, included in this PR).

**Accepted risk, with evidence.** Every remaining package was traced to its actual reachability,
not assumed safe by severity:

| Package (severity) | Reachability finding |
| - | - |
| `protobufjs` (was critical) and `elliptic` (low) | Trace entirely through `@jsr/creit-tech__stellar-wallets-kit` → `@trezor/connect-plugin-stellar` / `@hot-wallet/sdk` (NEAR wallet selector) - optional wallet-kit modules. `apps/web/lib/wallet-kit/modules.ts` imports only five vetted modules directly (Freighter, xBull, Albedo, Rabet, Hana), never Trezor or the NEAR/HOT chain. Verified empirically: built the production web app (`bun run build:web`) and grepped `apps/web/.next/static/chunks/` for "trezor", "protobuf", "near-api-js", "hot-wallet" - zero matches, while a "freighter" sanity-check grep on the same chunks *does* match, proving the method detects code that's actually bundled. `protobufjs` cleared entirely via `bun update` (a `stellar-wallets-kit` 2.5.0→2.6.0 bump); `elliptic` remains present but unreachable in the shipped bundle. |
| `uuid` (moderate) | The vulnerable `8.3.2` instance comes via `jayson` → `@solana/web3.js` → `@hot-wallet/sdk` - the same unreachable optional wallet-connector chain above. Confirmed absent from the built bundle by the same grep method (the one "solana" match in the bundle is WalletConnect's own chain-namespace metadata strings for its generic multi-chain UI, not `@solana/web3.js` code - inspected directly). The *other* resolved `uuid` instance, `11.1.1`, is our own direct dependency and is already patched. |
| `js-yaml` (high/moderate) | Traces through `@nestjs/swagger` (builds the OpenAPI doc from static decorators at API startup - never parses untrusted YAML) and `gray-matter` (`apps/web/lib/blog.ts` - parses only repo-authored blog frontmatter, never user input). The vulnerable operation (parsing attacker-controlled YAML) is never reachable through either path. Note: per the advisory itself, the high-severity CVE-2026-59870 fix was not backported even to the latest 3.x/4.x releases, so this would remain flagged regardless of version - reachability is the only lever here. |
| `multer` (high/moderate) | Pinned exactly by `@nestjs/platform-express`. Grepped `apps/api/src` - no route uses `multer` or `FileInterceptor`; this API has no multipart-upload endpoint, so the DoS vectors (all upload-triggered) have nothing to reach. |
| `file-type` (moderate) | Pinned exactly by `@nestjs/common` (internal MIME-sniffing utility). Same reasoning as `multer` - no upload endpoint exists to hand it attacker-controlled bytes. |
| `sharp` (high) | Optional peer dependency of `next.js`, used only by the Image Optimization API. Grepped `apps/web` - `next/image` is never imported anywhere in the app; the feature that would invoke `sharp` on external image bytes is unused. |
| `ajv` (moderate) | Four resolved instances; only `8.12.0` falls in the vulnerable range (`>=7.0.0-alpha.0 <8.18.0`), and it traces through `@angular-devkit/core` → Nest's own schematics/CLI codegen tooling - a `nest generate` dev command, never invoked in CI or production. |
| `qs` (moderate) | Both resolved instances trace through `@stryker-mutator/core`, a devDependency for mutation testing, never part of any served runtime. |
| `@nestjs/core` (moderate) | Genuine runtime dependency. The fix is not available within the installed major version (10.x) - `10.4.22` is already the latest 10.x release, and the advisory covers `<=11.1.17`. Upgrading to Nest 11/12 is a deliberate framework migration, out of this PR's scope for the same reason `@stellar/stellar-sdk` major bumps are gated (CLAUDE.md, `renovate.json`) - not something to fold into a dependency-audit pass. **Tracked as a follow-up** (Section 6). |
| `brace-expansion`, `browserslist`, `esbuild`, `glob`, `picomatch`, `postcss-selector-parser`, `tmp`, `webpack` | All trace to build/dev tooling only - `@nestjs/cli`, `@typescript-eslint/*`, `autoprefixer`/`tailwindcss`, `tsup`, Angular schematics (confirmed individually via `bun pm why` for each). None run against any input the tool serves to a user; none ship to a served runtime. |

**Ongoing cadence.** `renovate.json` runs a weekly dependency scan, and a fix for a Dependabot alert
on any datasource skips that schedule: Renovate always opens vulnerability PRs at once, and the
top-level `vulnerabilityAlerts` object gives them their own unlimited concurrency budget
(`prConcurrentLimit: 0`), outside the limit of one regular PR. So this isn't a one-off - future
advisories on these same packages get picked up automatically. This document
records a point-in-time baseline the ongoing cadence builds on, not a substitute for it.

## 3. Static analysis

`semgrep` with `p/security-audit`, `p/typescript`, `p/javascript`, `p/secrets` (127 rules, 311
files) found **one finding**, fixed in this PR:

**`javascript.node-crypto.security.gcm-no-tag-length`** in `apps/playground/lib/crypto.ts:38`
(now line 44) - `createDecipheriv("aes-256-gcm", ...)` was called without an explicit
`authTagLength`, which the rule flags on principle: an implicit tag length can, in some
configurations, allow a truncated-tag forgery. In this specific case Node's implicit default for
GCM is already 16 bytes (the correct, secure value) and `setAuthTag` already rejects any tag that
isn't exactly that length, so this was not an active vulnerability - but making it explicit
removes any ambiguity for a future refactor and closes the finding outright. Fixed by passing
`{ authTagLength: 16 }` to both `createCipheriv` and `createDecipheriv` in
`apps/playground/lib/crypto.ts`; the existing round-trip test suite
(`apps/playground/tests/unit/crypto.test.ts`) still passes unchanged. Re-run after the fix: **0
findings**.

No security-specific ESLint rules exist in this repo today (`.eslintrc.json` files use only
`eslint:recommended` + `@typescript-eslint/recommended`), so this scan is new signal rather than
overlap with CI's existing `lint` job - worth re-running on a similar cadence going forward
(Section 6).

## 4. Secret scanning

`gitleaks` against the full 352-commit history found **32 raw hits, collapsing to a handful of
distinct values** after triage:

**Finding, fixed - traced to its source.** A syntactically valid Stellar secret key
(`SCZANGBA5YHTNYVVV4C3U252E2B6P6F5T3U6MM63WBSBZATAQI3EBTQ4`) was committed as test-fixture
plaintext in `apps/playground/tests/unit/crypto.test.ts` (and an earlier path,
`tests/unit/playground-crypto.test.ts`). It derives to
`GC2BKLYOOYPDEFJKLKY6FNNRQMGFLVHJKQRGNSSRRGSMPGF32LHCQVGF`, which - verified via a read-only
Horizon query, no on-chain action taken - holds real balances on both mainnet (\~16.13 XLM plus a
second asset) and testnet (\~10,088 XLM plus two assets), with a pattern of recurring inbound
payments through mid-2026.

Traced the source before treating this as an incident: this is not a private key of unknown
origin. GitHub code search puts the exact same secret key in **142 files across at least 11 public
repositories**, including `stellar/stellar-docs` itself - it is the "AstroDollar" issuer account
hardcoded into the official ["How to Issue an
Asset"](https://developers.stellar.org/docs/tokens/how-to-issue-an-asset) tutorial's full code
sample (JS, Python, and Java versions alike), copied from there into SDK examples and demo projects
across the ecosystem (Soneso's multi-language SDKs, a Kuknos fork, a Kinesis SDK fork, and several
independent tutorial-following projects). It was never a secret - it is deliberately public,
widely-republished documentation material, which is almost certainly why it accumulated real
balances on both networks over time (people running the tutorial, not a personal wallet being
compromised).

That provenance changes the framing but not the fix: using a real, checksum-valid keypair - even a
publicly-known one - as test fixture data was still the wrong move, for the same reason
CLAUDE.md's new convention (below) states plainly - a secret scanner can't tell "famous public
example key" from "leaked production secret" from the string alone, and neither should a reviewer
have to. The test never needed a valid Stellar key at all - `encryptSecret`/`decryptSecret`
round-trip arbitrary strings - so the fixture is now a plaintext string that is deliberately **not**
a valid strkey (`playground-crypto-test-fixture-not-a-real-secret-000000`), removing any future
ambiguity. This fixes the fixture going forward; the key remains visible in the specific historical
commits that introduced and later moved it in this repository's own history. Given it's a
publicly-known documentation example rather than a private exposure, a git history rewrite to strip
it isn't warranted on security grounds - those historical fingerprints are recorded, not hidden, in
`.gitleaksignore` (with a comment explaining exactly why), so a future scan stays actionable for
genuinely new findings instead of re-surfacing this one every time.

**False positives, reviewed and allowlisted** (`.gitleaks.toml`):

* Six high-entropy `"C..."` strings in `apps/api/tests/unit/fixtures/octopos/empty-portfolio.json`
  (`tokenShareAddress`, `token0`, `token1`, `tokenA`, `tokenB`, `shareToken`) are Soroban
  contract/asset addresses - public identifiers by construction, not secrets - inside an entirely
  synthetic OctoPos DeFi-position fixture. Allowlisted by path.
* `polar=key_xyz` in a doc comment (`apps/api/src/auth/api-key.service.ts`) and its matching test
  is a worked example of the `API_KEYS=label=key` env-var format, not a real credential.
  Allowlisted by pattern.
* Stellar account (`G...`) and contract (`C...`) addresses in tests and fixtures, flagged by
  `generic-api-key` once the exit-adapter work added many of them (45 hits on 2026-09-29, all 56-
  character public identifiers). Allowlisted by an anchored pattern that matches only a whole
  `G`/`C` address, never a secret seed (`S...`).

Final state: `gitleaks detect --config .gitleaks.toml` reports **no leaks found**.

**Separately, and independent of any code fix in this PR**: this public repository had GitHub's
native secret scanning, secret scanning push protection, and Dependabot security updates all
disabled when this run started. All three are now **enabled** (confirmed via
`gh api repos/LumenWipe/lumenwipe` - `security_and_analysis.secret_scanning.status: "enabled"`,
`secret_scanning_push_protection.status: "enabled"`, `dependabot_security_updates.status:
"enabled"`), giving this point-in-time scan a continuous counterpart going forward.

## 5. Cross-reference against the STRIDE threat model

Every accepted risk above was checked against the four surfaces
[the threat model](https://docs.lumenwipe.com/threat-model.md) already identifies as sensitive: client-side key handling, the
client-side session layer, API transaction construction, and the two backend signing keys
(mediator co-sign, fee-bump sponsor). None of this run's findings touch those surfaces:

* The wallet-connector chain (`protobufjs`/`elliptic`/`uuid`) is adjacent to - but outside -
  Surface 1 (key handling): it's optional wallet-kit modules never imported, not the signing path
  itself.
* `js-yaml`, `multer`, `file-type`, `sharp`, `ajv`, `qs`, and the build-tooling group sit entirely
  outside API transaction construction and the session layer.
* The leaked test key belongs to `apps/playground`, a deliberately separate, isolated demo app
  (CLAUDE.md: "never imports \[production's] closing modules") - it is not one of the two
  production backend signing keys the threat model covers.

No update to the threat model's residual-risk table (now Section 11) was needed as a result of this run.

## 6. Follow-up

What this run changed beyond code, and what's still open:

1. **GitHub-native secret scanning, push protection, and Dependabot security updates are now
   enabled** on this repository (Section 4) - confirmed and applied as part of this run, giving this
   point-in-time scan a continuous counterpart going forward.
2. **`@nestjs/core` moderate injection advisory** (Section 2) is resolved: the API now runs Nest
   11 (`@nestjs/core` 11.2.3, past the `<=11.1.17` range). See Section 7.
3. **Static analysis and secret scanning now run in CI** (#315). Every PR and every push to `main`
   runs Semgrep with the same four rule packs as Section 3, gitleaks over the full history as in
   Section 4, and CodeQL (`javascript-typescript` and `actions`, `security-extended` queries), all
   feeding the required `type-check · lint · test` gate. A Semgrep or gitleaks finding fails the
   PR; CodeQL findings land in the repository's Security tab. The dependency audit is a gate too:
   the `audit` job fails on any high or critical advisory not in `scripts/audit-allowlist.json`,
   where each accepted entry carries a reason and an expiry.
4. **Test fixtures never use a real, checksum-valid secret key** - even a publicly-known one, per
   the finding in Section 4 - is now a standing convention in `CLAUDE.md`, so this class of finding
   doesn't recur.

## 7. Refresh (2026-09-29)

Same three tools, re-run on `feature/phase-3` at `980aae4`, which adds the Phoenix and FxDAO exit
adapters and the Nest 11 migration since Section 1.

**Static analysis and secrets.** Semgrep (same four packs): 0 findings. gitleaks over the history
reachable from `HEAD`: no leaks, after allowlisting public Stellar `G`/`C` addresses in tests and
fixtures (Section 4). Both now run in CI on every PR (Section 6, item 3), as does CodeQL: 0 alerts.

**Dependency audit.** `bun audit` went from **39 advisories across 15 packages** (25 high, 10
moderate, 4 low) to **2** (1 moderate, 1 low). Ten packages were fixed with root `overrides`,
because each is pinned exactly or held back by a dependency's range:

| Package | Was | Now | Pulled in by |
| - | - | - | - |
| `qs` | 6.14.2/6.15.1 | `6.16.0` | `express` 5 (API runtime), `typed-rest-client` (dev) |
| `multer` | 2.2.0 | `2.4.0` | `@nestjs/platform-express`, pinned exactly |
| `smol-toml` | 1.6.1 | `1.9.0` | `@stellar/stellar-sdk` (`stellar.toml` parsing) |
| `fast-uri` | 3.1.5 | `3.1.8` | `ajv` 8 (API Extractor, Nest CLI schematics) |
| `uuid` | 8.3.2 | `11.1.1` | `jayson`, in the optional Solana wallet-kit chain |
| `sharp` | 0.34.5 | `0.35.5` | `next` (image optimization) |
| `esbuild` | 0.27.7 | `0.28.2` | `tsup` (SDK build) |
| `browserslist` | 4.28.2 | `4.28.8` | `@babel/core` 8 |
| `baseline-browser-mapping` | 2.10.29 | `2.11.20` | `browserslist` |
| `postcss-selector-parser` | 6.1.2 | `6.1.3` | Tailwind |

Three more were only held back by the lockfile, inside ranges their dependents already accept, and
were moved to the patched release in `bun.lock` directly (a plain `bun update` re-resolves the whole
tree, far beyond this change): `js-yaml` 3.14.2 → 3.15.2 (`gray-matter`) and 4.1.1 → 4.3.2 (ESLint,
`cosmiconfig`), `brace-expansion` 1.1.14 → 1.1.21 and 5.0.6 → 5.0.12 (`minimatch`), and the two
`ajv` 8.12.0 copies under webpack's `schema-utils` → 8.20.0. `bun install --frozen-lockfile`
verifies every edited entry against its published integrity hash.

None of these was reachable before the fix (same method as Section 2: the API registers only
`express.json()`, Express 5 parses query strings without `qs`, no route accepts uploads, no code
resolves a `stellar.toml`, and the rest is build tooling or code absent from the web bundle). They
were fixed because the fix was a compatible bump. Type-check, lint, all 1,917 unit tests, every
workspace build and the SDK's API report pass after the change, and the API image boots and answers
`/health`.

**Accepted risk.** Two advisories remain, neither with a usable fix:

| Advisory | Why it stays |
| - | - |
| `elliptic` GHSA-848j-6mx2-7j84 (low) | No patched release exists (6.6.1 is the latest and is affected). It comes only through the optional NEAR wallet-kit modules, which a production build of `apps/web` does not contain; the one `elliptic` string in the bundle is an error message in `@noble/curves`. |
| `stream-json` GHSA-528h-pc64-c93x (moderate) | Fixed only in 3.x, while its sole consumer, `jayson` (optional Solana wallet-kit chain), requires `^1.9.1`. Neither `jayson` nor `stream-json` is in the web bundle. |

## 8. Tooling pass (2026-10-13)

The first pass run with `bun run security:scan` (Section 10). It ran on commit `d1ab2cb`, which is `main` at
`7f07aeb` plus the script itself, in the pull request that added it; the squash merge gives that change a
different hash on `main`. The counts and every finding below come from that run's report; reports stay local
(Section 10), so re-running the script on that commit reproduces it, apart from rule packs and advisories
published since.

| Tool | Version | Scope | Critical | High | Medium | Low |
| - | - | - | - | - | - | - |
| bun audit | 1.3.14 | the workspace lockfile | 0 | 1 | 4 | 1 |
| semgrep | 1.175.0 | `p/security-audit`, `p/typescript`, `p/javascript`, `p/secrets` over `apps/` and `packages/` | 0 | 0 | 0 | 0 |
| gitleaks | 8.30.1 | the history reachable from `HEAD` (323 commits; merge commits add no diff of their own), with `.gitleaks.toml` and `.gitleaksignore` | 0 | 0 | 0 | 0 |

Semgrep reported one analysis error: a partial parse of `packages/sdk/src/index.ts` at line 12,
`export type * from "@lumenwipe/types"`. The file holds only re-exports, so no rule had logic to miss there. The
`js-yaml` advisories of Section 7 no longer appear: the lockfile moves recorded there cleared them.

**Every high and medium finding.** No override can fix any of them: each one either has no patched release or
needs a major version its only consumer does not accept. So nothing in `package.json` or `bun.lock` changed in
this pass. Each was traced with `bun pm why`, and the web app's production build (`next build` on this commit)
was searched for the package and its identifiers. None of them appears in the client or server output. None reaches the API image either: the only paths into `apps/api` run through
development dependencies (`tsc-alias`), which the production install leaves out.

| Package and advisory | Severity | Path into the repo | Decision |
| - | - | - | - |
| `braces` GHSA-vfj7-8cjw-p6xm | high | `micromatch` and `chokidar`, in build and lint tooling only: `tsc-alias` (API build) and `eslint-config-next` | Accepted. No patched release exists (3.0.3 is the latest and is affected). It expands glob patterns written in this repository, never user input, and is absent from every runtime bundle. Already allowlisted in `scripts/audit-allowlist.json`, with an expiry of 2027-01-08 that forces a re-check, so the CI audit gate stays green on purpose. |
| `sprintf-js` GHSA-hp3w-g68c-fv3c | medium | `argparse` 1.x, from `js-yaml` 3.x (`gray-matter`, used by the web's blog loader) and from `@rushstack/ts-command-line` (API Extractor) | Accepted. No patched release exists (1.1.3 is the latest and is affected). `js-yaml` loads `argparse` only in its command-line entry point (`bin/js-yaml.js`), never from the library that `gray-matter` calls, and the blog loader runs on the server at build time; API Extractor is a development tool. The vulnerable formatter is never reached with outside input. |
| `stream-json` GHSA-hqr4-qq8f-hg3x, GHSA-mjw6-4jj6-33hc, GHSA-528h-pc64-c93x | medium | `jayson`, from `@solana/web3.js`, from `@hot-wallet/sdk`, a dependency of the wallet kit | Accepted. Fixed only in 3.x, which is published as an ES module only, while `jayson` requires `^1.9.1` through CommonJS, so an override would break the require. The web never imports the HOT wallet module, so it is not part of the production build, and the package is absent from its output. |

The low finding, `elliptic` GHSA-848j-6mx2-7j84, is unchanged from Section 7: no patched release, reached only
through the optional NEAR wallet modules, absent from the production build.

**Cross-reference.** None of these findings touches a surface of the [threat model](https://docs.lumenwipe.com/threat-model.md): key
handling, the session layer, transaction construction, the two signing keys, the DeFi exit and conversion
surfaces, or the integrator access layer. Its residual-risk table (Section 11) needs no change.

## 9. Dependency refresh (2026-10-30)

The audit gate reported 13 high or critical advisories published after Section 8. All but one are fixed by upgrading:
`next` 16.4.3 (including two critical remote code execution advisories, GHSA-2464-fhr4-w9xw and GHSA-673q-mjm6-r5xr),
`undici` 8.12.3, `multer` 2.5.0, `body-parser` 2.4.0, `follow-redirects` 1.16.2, `happy-dom` 21.0.4 and the top-level
`zod` 4.6.7.

`zod` GHSA-mrhx-c7xc-m3w5 is accepted for the two 3.x copies the wallet kit pins (3.22.4 under `@reown/appkit-wallet`,
3.25.76 under `@coinbase/cdp-sdk`). No 3.x release is patched, a global override to 4.x would change a library inside the
signing path's dependencies, and neither copy ships: `next build` output has no zod in its client or server chunks, and
the API does not depend on them. It is allowlisted in `scripts/audit-allowlist.json` until 2027-01-28, which forces a
re-check.

`picomatch` GHSA-fc5q-39xc-vjpf, accepted on 2026-11-17, was withdrawn by GitHub on 2026-11-18 and no longer
appears in the audit, so its allowlist entry is gone.

`braces` GHSA-vfj7-8cjw-p6xm from Section 8 no longer appears in the audit, so its allowlist entry is gone.

## 10. How to refresh this plan

1. Install the two pinned tools, at the versions in `scripts/security-tools.json` (the same file CI reads):
   `pipx install semgrep==<version>`, and gitleaks `<version>` from its release page (Homebrew works only while
   its formula is at that version). The script refuses to run on another version and prints the install command.
2. Run `bun run security:scan` on a clean checkout of `main`, or of the pull request that changes the scan. It writes `security-reports/YYYY-MM-DD.md` and
   `.json` with the tool versions, the commit and every finding by severity. A finding never fails it; it
   fails only when a tool cannot run, and the gates are the `audit`, `semgrep` and `gitleaks` CI jobs. Semgrep's
   rule packs and the advisory database are fetched live, so a later run can differ on the same commit.
3. For every critical, high and medium finding, either fix it (a compatible bump or a root `overrides` entry,
   then `bun install --frozen-lockfile` and the full test suite) or record an accepted-risk decision here with
   the evidence: the `bun pm why` path and whether the package reaches a production bundle.
4. Append a dated section like Section 8 and update the status line at the top. The report itself stays local
   (`security-reports/` is ignored by git); this page carries the counts, the findings and the decisions.

Cadence: at least once a month, before an external review, and whenever a new dependency enters a
security-sensitive path (`verify()`, transaction construction, the signing keys).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.