severity: errorpack: webhooksv1.0 core
uploadthing/missing-size-or-mime-limit
File route declares no size limit
npx @pitcheye/check . --pack webhookswhyItBreaks
Without `maxFileSize` UploadThing applies its own ceiling (orders of magnitude above anything you intend), and `blob: {}` accepts ANY file type. One authenticated caller can fill the storage quota with a single request — the bill arrives before the alert does.
✖ Bad — triggers errorfixtures/uploadthing-missing-size-or-mime-limit/bad
f({ blob: {} })✓ Good — passes checkfixtures/uploadthing-missing-size-or-mime-limit/good
f({ pdf: { maxFileSize: "8MB", maxFileCount: 1 } })suggestedFix
Declare the policy: `f({ pdf: { maxFileSize: "8MB", maxFileCount: 1 } })`, and never use the `blob` mime — it accepts any content type.
explain_rule({"uploadthing/missing-size-or-mime-limit"})Agent & MCP JSON output contract
{
"ruleId": "uploadthing/missing-size-or-mime-limit",
"pack": "webhooks",
"severity": "error",
"file": "apps/web/src/app/api/uploadthing/core.ts",
"line": 6,
"message": "an UploadThing `f({ … })` whose mime entry object has no `maxFileSize`",
"whyItBreaks": "Without `maxFileSize` UploadThing applies its own ceiling (orders of magnitude above anything you intend), and `blob: {}` accepts ANY file type. One authenticated caller can fill the storage quota with a single request — the bill arrives before the alert does.",
"suggestedFix": "Declare the policy: `f({ pdf: { maxFileSize: \"8MB\", maxFileCount: 1 } })`, and never use the `blob` mime — it accepts any content type.",
"docsUrl": "https://pitcheye.dev/rules/uploadthing-missing-size-or-mime-limit"
}Markdown: curl -H "Accept: text/markdown" https://pitcheye.dev/rules/uploadthing-missing-size-or-mime-limit
raw markdown
# uploadthing/missing-size-or-mime-limit
- **severity:** error
- **pack:** webhooks
- **docs:** https://pitcheye.dev/rules/uploadthing-missing-size-or-mime-limit
## whyItBreaks
Without `maxFileSize` UploadThing applies its own ceiling (orders of magnitude above anything you intend), and `blob: {}` accepts ANY file type. One authenticated caller can fill the storage quota with a single request — the bill arrives before the alert does.
## bad
```ts
f({ blob: {} })
```
## good
```ts
f({ pdf: { maxFileSize: "8MB", maxFileCount: 1 } })
```
## suggestedFix
Declare the policy: `f({ pdf: { maxFileSize: "8MB", maxFileCount: 1 } })`, and never use the `blob` mime — it accepts any content type.
## commands
```bash
npx @pitcheye/check . --pack webhooks
```
```json
{"tool":"explain_rule","arguments":{"ruleId":"uploadthing/missing-size-or-mime-limit"}}
```