Repository navigation
Conversation
Both routes are live on openmessage.ai and anyone can POST to them. The waitlist stored a new object at a fresh UUID path for every submission, with no length cap on the email; the heartbeat stored one per caller-chosen install id. Repeated requests grew storage and Blob operations without limit (security review 2026-10-22, finding 3). lib/public-writes.mjs now bounds both: - bodies over 2 KiB get 413; emails over 254 characters and install ids that aren't the app's 32-hex format get 400; - a per-instance rate limit by client address (5 sign-ups per 10 minutes, 30 heartbeats per hour); - a daily object budget per route (1,000), read from Blob with list(), so storage stops growing across all instances; at the cap the waitlist says sign-ups are paused and the heartbeat answers OK without persisting; - a waitlist path that is an HMAC of the address under the encryption key, so a repeat sign-up replaces that day's object and the path doesn't reveal the address; heartbeats overwrite the install's object for the day, where a second one used to fail with 502. Tests run with node:test (no new dependencies; the site's lockfile is npm's and this machine's tooling requires bun), including a randomized check that a day's folder never holds more than the cap or more objects than distinct accepted addresses. CI's Site Build job runs them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
added a commit
that referenced
this pull request
Nov 18, 2026
Both routes are live on openmessage.ai and anyone can POST to them. The waitlist stored a new object at a fresh UUID path for every submission, with no length cap on the email; the heartbeat stored one per caller-chosen install id. Repeated requests grew storage and Blob operations without limit (security review 2026-10-22, finding 3). lib/public-writes.mjs now bounds both: - bodies over 2 KiB get 413; emails over 254 characters and install ids that aren't the app's 32-hex format get 400; - a per-instance rate limit by client address (5 sign-ups per 10 minutes, 30 heartbeats per hour); - a daily object budget per route (1,000), read from Blob with list(), so storage stops growing across all instances; at the cap the waitlist says sign-ups are paused and the heartbeat answers OK without persisting; - a waitlist path that is an HMAC of the address under the encryption key, so a repeat sign-up replaces that day's object and the path doesn't reveal the address; heartbeats overwrite the install's object for the day, where a second one used to fail with 502. Tests run with node:test (no new dependencies; the site's lockfile is npm's and this machine's tooling requires bun), including a randomized check that a day's folder never holds more than the cap or more objects than distinct accepted addresses. CI's Site Build job runs them. Cherry-picked from #262 onto the site rebuild. Conflict resolution: the heartbeat route takes this version, and package.json keeps the rebuild's Vitest test script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
This branch has not been deployed
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.
Bounds what anyone can store through the public
/api/waitlistand/api/heartbeatroutes on openmessage.ai. This is finding 3 (medium) of the 2026-10-22 security review. The routes are live:GET /api/heartbeatanswers{"ok":true,"schema_version":1}.Before: the waitlist wrote a new Blob object at a fresh UUID path for every valid submission, with no cap on email length. The heartbeat wrote one object per caller-chosen install id (any 16-64 characters). Neither route had a server-side rate limit or storage budget, so a script could grow storage and billable Blob operations without limit.
Changes (
site/lib/public-writes.mjs; the routes are now thin wrappers)install_idmust be the app's format, 32 lowercase hex characters (internal/telemetryinstallID).list({prefix: <route>/<UTC day>/, limit: cap})that the day's folder holds fewer than 1,000 objects. At the cap the waitlist answers 503 ("sign-ups are paused for today"), and the heartbeat answers{ok: true, persisted: false}so the app doesn't retry. Concurrent requests can overshoot the cap by at most their number.WAITLIST_ENCRYPTION_KEY, so a repeat sign-up the same day replaces its object, and the path doesn't reveal the address (an unkeyed hash would). Heartbeats overwrite the install's object for the day (allowOverwrite); a second heartbeat used to fail with 502 because Blob refuses to overwrite by default.The stored record format is unchanged (same encrypted waitlist envelope and heartbeat JSON, same
waitlist/<day>/andheartbeats/<day>/folders), so anything that reads them keeps working.Invariants (tested)
Tests
site/lib/public-writes.test.mjsusesnode:testagainst an in-memory Blob that keeps Vercel's overwrite and list semantics: 11 tests, all passing locally. The Site Build CI job now runs them. I usednode:testrather than Vitest because the site's lockfile is npm's while this machine's tooling enforces bun, and adding a dev dependency would have put the lockfile out of sync with what CI installs.Not covered here
The per-address limit is per instance. A global per-address limit needs shared state, either a Vercel Firewall rate-limit rule or a KV store. That is a dashboard change on the Vercel project, so it is not in this PR.
🤖 Generated with Claude Code