- Home
- The 30 checks
- Your API saves request data without checking it
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
Let your AI tool fix it
Paste this into Lovable, Bolt, Cursor, Replit or Claude Code:
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.