Skip to content

fix: bound export-user-data request bodies - #543

Draft
9thLevelSoftware wants to merge 1 commit into
mainfrom
cursor/export-user-data-bounded-body-6024
Draft

9thLevelSoftware wants to merge 1 commit into
mainfrom
cursor/export-user-data-bounded-body-6024

Conversation

@9thLevelSoftware

Copy link
Copy Markdown
Owner

Verified on current main (177e96a): export-user-data still parsed the body with req.json(), which has no size cap. The shared helper is readBoundedRequestBody. There is no single 64 KiB limit; small JSON command bodies use 4 KiB (deleteAccount) and 16 KiB (generateInsights).

export-user-data now reads through that helper at 16 KiB (REQUEST_BODY_LIMITS.exportUserData), the same ceiling as generate-insights. An over-limit body returns 413 { "error": "Request body too large" }, matching the other handlers. Auth, the invalid-JSON 400, and the export page logic are unchanged. A real page request is { table, cursor? } with cursor values capped at 512 characters, so 16 KiB does not cut off a legitimate export (FP-6).

Tests: deno test on export-user-data/index.test.ts and _shared/requestBody.test.ts — 26 passed, 0 failed, 4 ignored (local-stack integration tests). deno check and deno lint on the touched files were clean, with no warnings. Biome does not include supabase/functions/**.

Open in Web Open in Cursor 

Read the GDPR export body through readBoundedRequestBody at the
16 KiB small-JSON limit and return 413 when it is exceeded.

Co-authored-by: Devil <9thLevelSoftware@users.noreply.github.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
phoenix-portal 53490b2 Commit Preview URL

Branch Preview URL
Oct 26 2026, 08:25 AM

This branch has not been deployed

No deployments
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