Repository navigation
BL5: the cirrus standard — no kiox, generated component docs, the context pack, SVG uploads closed - #6
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
image/*, which admitsimage/svg+xml.GET /api/blobserved 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.image/png,image/jpeg,image/gif,image/webp,image/avif. The check compares the media type without parameters and ignores case. The list is inapps/web/lib/blob/content-types.ts, andisAllowedContentTypekeeps its shape:lib/blob/server.tsandlib/blob/client.tsboth re-export it. Anything else is refused with400 "We only accept PNG, JPEG, GIF, WebP and AVIF images".app/api/blob/route.tsnow sendsContent-Security-Policy: default-src 'none'; sandboxalongsidenosniff, 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.acceptand its own check before upload both read the same list (it advertisedimage/*before).tests/web/src/blob.test.tscovers 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 oldimage/*check without the header fails 4 of them.testing/e2e.test.shchecks the same things against the built Worker underwrangler dev: the page'saccept, an SVG refused, and the CSP on served uploads.baseline-v1still has the old check until it takes this change.The cirrus standard
kiox.yaml/kiox.lock(pinned v2.15.0, which nothing ran), theirroot-kioxandroot-kiox-lockmodules, their entries in thetesting/phases.test.shpartition and the^kiox\.lock$rebrand skip. orun stays pinned where it runs (theorun-actionversion:in each workflow, untouched).tooling/catalog/gen-component-docs.py(byte-identical to the pilot's) writesdocs/{overview,architecture,runbook}.mdforapps/web,tests/webandinfra/terraform/cloudflare-r2: 9 pages, each read and checked against the manifests. The Baseline CIbaseline-contractjob runs it with--check.ai/context/current.md,decisions.md(12 rows) andopen-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
✅ Shipped | #5 (BL-5), tagged baseline-v1. The epic README's Status, Shipped as and Cluster rows and thespecs/epics/README.mdindex row are updated to match.SITE_NAMEsince BL4. The page itself is not redesigned.design.md§2/§5, both READMEs,apps/web/README.mdandai/context/operations.mdnow say raster-only and sandboxed.epic.yamlmilestone (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 --checkis green (3 components, 9 pages).orun new --status(v2.58.11):01-product81 files (was 73: −2 kiox, +9 docs pages, +content-types.ts),02-docshook-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, asbaseline.ymlruns it): 81 files placed in both landings, branded and re-tenanted. The product's plan applies cloudflare-r2 at level 0 withCLOUDFLARE_R2_TOKENand deploys web at level 1. A PR waits on nothing, and 02-docs plans 0 jobs.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. Underwrangler devthe smoke passes, and one PNG uploaded twice comes back byte for byte with the CSP andnosniff. A PDF, an SVG, a missing name and an unknown object are all refused.orun task check BL-6reportscomplete yes.git grep -i kioxfinds nothing outside the records of its removal (specs, tasks, ai/context).Generated by Claude Code