Hono / Bun (TypeScript / Bun) · CWE-362
Hono / Bun: TOCTOU & Concurrency Races (DAST & CI Regression Guard)
Automate ZAP staging probes and Semgrep PR gates. Prevent parallel requests from overdrawing balances, reusing promo codes, or exceeding quotas. Tailored for Hono / Bun: Bind Zod validator middleware and timing-safe token comparisons per route.
Coverage ledger tracking key
surface:hono-bun::boundary:race-condition-toctou::angle:dast-ci
Single-packet parallel request invariant verification
Risk boundary
// Unverified Hono / Bun path (CWE-362 · DAST & CI Regression Guard)
// Handler accepts input without validating c.get('jwtPayload').Hardened guard
// Hardened Hono / Bun (CWE-362 · DAST & CI Regression Guard)
// 1. Bind Zod validator middleware and timing-safe token comparisons per route
// 2. Enforce state and balance checks inside atomic database conditional UPDATE predicates.Verification steps
- 01Seed coverage-ledger.json for every Hono / Bun handler touching TOCTOU & Concurrency Races.
- 02Trace request parameters through c.get('jwtPayload') validation down to the sink.
- 03Verify with paired positive/negative evidence via owasp-api-graphql-audit.