Skip to content

BL5: the cirrus standard — no kiox, generated component docs, the context pack, SVG uploads closed - #6

Merged
ruehowl merged 3 commits into
mainfrom
claude/brave-mccarthy-4l2qxb
Oct 21, 2026
Merged

ruehowl merged 3 commits into
mainfrom
claude/brave-mccarthy-4l2qxb

Conversation

@ruehowl

@ruehowl ruehowl commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Brings blob-starter to cirrus-baseline's standard (the change sourceplane/hono-api#5 made), plus one security fix to the app. Task BL-6, milestone BL5.

What changes

Security fix — SVG uploads were a stored XSS (risk BL-L, RESOLVED)

  • Uploads accepted the template's image/*, which admits image/svg+xml. GET /api/blob served it from the app's own origin with that content type and no policy, so anyone who opened the "View file" link ran the uploader's script as the app. Uploads are anonymous (BL-C), so anyone could plant one.
  • Uploads are now raster images only: image/png, image/jpeg, image/gif, image/webp, image/avif. The check compares the media type without parameters and ignores case. The list is in apps/web/lib/blob/content-types.ts, and isAllowedContentType keeps its shape: lib/blob/server.ts and lib/blob/client.ts both re-export it. Anything else is refused with 400 "We only accept PNG, JPEG, GIF, WebP and AVIF images".
  • app/api/blob/route.ts now sends Content-Security-Policy: default-src 'none'; sandbox alongside nosniff, so nothing already stored in a bucket can run script either. Its comment no longer claims the route authenticates requests (it never did). The comment now says so, as the upload route's comment does.
  • The uploader is consistent with the route: its file input's accept and its own check before upload both read the same list (it advertised image/* before).
  • Tests: tests/web/src/blob.test.ts covers an SVG refused (400, nothing stored), each raster type accepted, the CSP header on a served object, an SVG stored before the fix served sandboxed, and client and server sharing one list. A mutation run against the old image/* check without the header fails 4 of them. testing/e2e.test.sh checks the same things against the built Worker under wrangler dev: the page's accept, an SVG refused, and the CSP on served uploads.
  • A product built from baseline-v1 still has the old check until it takes this change.

The cirrus standard

  • No kiox. Removed kiox.yaml/kiox.lock (pinned v2.15.0, which nothing ran), their root-kiox and root-kiox-lock modules, their entries in the testing/phases.test.sh partition and the ^kiox\.lock$ rebrand skip. orun stays pinned where it runs (the orun-action version: in each workflow, untouched).
  • Generated component docs. tooling/catalog/gen-component-docs.py (byte-identical to the pilot's) writes docs/{overview,architecture,runbook}.md for apps/web, tests/web and infra/terraform/cloudflare-r2: 9 pages, each read and checked against the manifests. The Baseline CI baseline-contract job runs it with --check.
  • Context pack. Added ai/context/current.md, decisions.md (12 rows) and open-risks.md (BL-G open). These are this repository's own pages; no module places them.

Status that agrees with the tags and the code

  • BL4 "this PR (BL-5), to be tagged" is now ✅ Shipped | #5 (BL-5), tagged baseline-v1. The epic README's Status, Shipped as and Cluster rows and the specs/epics/README.md index row are updated to match.
  • The status file's "Page copy and links" section now notes that the footer's Vercel logo still links vercel.com, as upstream's does. BL-D gets a dated note saying the same, and that the title has been SITE_NAME since BL4. The page itself is not redesigned.
  • The upload, delivery and uploader departures note BL5. design.md §2/§5, both READMEs, apps/web/README.md and ai/context/operations.md now say raster-only and sandboxed.
  • BL5 is recorded: epic.yaml milestone (5 exit criteria; state: unchanged), tasks/BL-6.TaskContract.yaml, an implementation-plan section, a status table plus a Verified (BL5) section, and the new risk BL-L.

Verified locally (on the head commit, pinned binaries)

  • testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer,wire}.test.sh: all green. gen-component-docs.py --check is green (3 components, 9 pages).
  • orun new --status (v2.58.11): 01-product 81 files (was 73: −2 kiox, +9 docs pages, +content-types.ts), 02-docs hook-only.
  • testing/leak.test.sh (v2.58.11): 81 files derived. ai/context is still exactly the 2 declared pages, and 74 shipped sources name no factory path.
  • testing/placement.test.sh (v2.78.4, as baseline.yml runs it): 81 files placed in both landings, branded and re-tenanted. The product's plan applies cloudflare-r2 at level 0 with CLOUDFLARE_R2_TOKEN and deploys web at level 1. A PR waits on nothing, and 02-docs plans 0 jobs.
  • Checks sequence: pnpm install --frozen-lockfile, wire:fixture + git diff --exit-code, typecheck, lint (the 1 pre-existing upstream unused-var warning), test (16 tests, was 11) and build are all green.
  • testing/e2e.test.sh (v2.78.4): green. The 01-product landing passes Checks, and the stage lane's four steps pass in the staged tree. Under wrangler dev the smoke passes, and one PNG uploaded twice comes back byte for byte with the CSP and nosniff. A PDF, an SVG, a missing name and an unknown object are all refused.
  • orun task check BL-6 reports complete yes.
  • git grep -i kiox finds nothing outside the records of its removal (specs, tasks, ai/context).

Generated by Claude Code

…text pack, SVG uploads closed

- Close a stored XSS: uploads accepted any image/*, SVG included, and
  /api/blob served it from the app's own origin. Uploads are now raster
  images only (PNG, JPEG, GIF, WebP, AVIF; media type without parameters,
  case-insensitive), one list in lib/blob/content-types.ts shared by the
  route and the uploader's accept/check. /api/blob answers every object
  with `Content-Security-Policy: default-src 'none'; sandbox` beside
  nosniff, and its comment no longer claims to authenticate. tests/web
  (16 tests, was 11) and testing/e2e.test.sh assert both (risk BL-L).
- Remove kiox.yaml/kiox.lock and their two blueprint modules: nothing ran
  the kiox pin (v2.15.0); every workflow pins orun through orun-action.
- Generate docs/{overview,architecture,runbook}.md for every component
  from what it declares (tooling/catalog/gen-component-docs.py), and fail
  Baseline CI when they drift (--check).
- Add ai/context/{current,decisions,open-risks}.md (this repository's own;
  nothing places them).
- Close out BL4 (shipped, tagged baseline-v1), note the footer's Vercel
  logo the page-copy section left out, and record BL5 (BL-6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
The generator now lays tables out the way prettier does (an app whose lint
is `prettier --check` accepts the pages as written), lists the WIRING_*
failure only for Workers that take wiring, and no longer claims a package
holds no credentials.
- Word the kiox exit criterion as it can be true: nothing outside this
  milestone's own record names kiox.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
The generator now reads `optionalSecretEnv` (listed as "(optional)") and
secrets declared per environment under `subscribe.environments[]`, so a
page no longer leaves out a secret its component declares. Its tables are
laid out as prettier lays them out, the WIRING_* failure is listed only
for Workers that take wiring, and a package is no longer said to hold no
credentials. Every starter now carries the identical generator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
@ruehowl
ruehowl marked this pull request as ready for review October 18, 2026 14:39
@ruehowl
ruehowl merged commit 48044ed into main Oct 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants