Launch weekSIGSHIP is on Product Hunt and LiftOff. 50% off every plan with code LAUNCH50 until Sunday 6 December (Solo monthly has its own founder offer): Pro is $74.50 and Business $249.50, paid once.Launch week: 50% off · LAUNCH50See plans →Plans →
  1. Home
  2. The 30 checks
  3. Your API saves request data without checking it
🗂️ Your users' data · Nice to fix (SEV-3)

Your API saves request data without checking it 

In plain English: One of your API routes takes what the browser sends and saves it in the database without checking it first. A request with a missing field, a huge text or the wrong type of value goes straight in and can break pages for other users.

What happens if you ship it

A request with a missing, huge or wrongly typed field goes straight into your database, breaks pages for other users and fills your storage.

How to fix it technical

Check the body with a schema (zod or valibot, for example) before you use it: required fields, types and maximum lengths. Reject anything else with a 400.

Let your AI tool fix it

Paste this into Lovable, Bolt, Cursor, Replit or Claude Code:

Prompt for your AI tool
Fix this problem in my project: Your API saves request data without checking it. Check the body with a schema (zod or valibot, for example) before you use it: required fields, types and maximum lengths. Reject anything else with a 400. Change only what this fix needs, then tell me what you changed and anything I have to do myself.

Check your app

Run npx sigship in your project folder. It reports this problem as api-input-unchecked, along with 29 other checks. Nothing leaves your computer. New to the terminal?

Questions

What is input validation?

Checking that each field a request sends is there, has the right type and is not too long, before you use it. Anything else gets a 400 error.

What is the easiest way to add it?

Describe the request body with a schema library such as zod or valibot and parse the request with it. Your AI tool can write the schema from your table.

Does this block launch?

No, it is SEV-3. On its own it is not a hole, but it is a common cause of broken data in new apps, and it makes other mistakes easier to abuse.

See every check · Jargon, explained