← Back to sandbox
Backend & API Intermediate 4 possible tests

Improper Error Handling

Four error-triggering endpoints — two expose internal server details in the response body, two handle errors cleanly. Find what each leaks and compare it to what it should return.

What is this?

Improper error handling means the API exposes stack traces, file paths, database connection strings, framework versions, or debug settings in error responses. This is a security and reliability issue — it aids attackers and breaks client contracts.

What is hidden here

BugTrigger raw 500 → exposes traceback, file paths, DB config, debug flag, and secret key prefix
BugTrigger DB error → exposes raw SQL error string with constraint and row data
CorrectTrigger clean 500 → returns only {"error": "...", "code": "..."}
CorrectTrigger 400 → clean validation error with field name

Error Triggers


HTTP Status
Response Body
Suggested Test Inputs
  • Trigger each error type and inspect the full response body
  • Look for file paths, server versions, stack traces, or config values in error responses
  • Compare what each endpoint leaks vs what it should return