CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/input-sanitization

Sanitize and validate user input at system boundaries — prevent XSS, SQL

94

1.20x
Quality

89%

Does it follow best practices?

Impact

100%

1.20x

Average score across 6 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-2/

Restaurant Order Management API

Problem/Feature Description

A restaurant chain wants a simple backend service for managing dine-in orders. Front-of-house staff use a tablet app to submit new orders, update order status, and look up existing orders. The app talks to a REST API over the local network.

The operations manager is concerned about data quality — in the past, garbage data has slipped through because the frontend sent malformed requests that the backend accepted without checking. They need a properly hardened API that rejects bad input clearly so the tablet app can display useful error messages to staff. The manager has explicitly asked that the backend not rely on the tablet app to enforce any constraints.

The order data model includes: a customer name, an item ordered, a quantity (positive integer, maximum 50), and a status (one of: "received", "preparing", "ready", "delivered"). The status may optionally be included when creating an order and defaults to "received" if omitted.

Output Specification

Build a Node.js or Python REST API with the following endpoints:

  • POST /api/orders — create a new order
  • PUT /api/orders/:id — update an existing order (partial update allowed)
  • GET /api/orders/:id — retrieve a single order by ID

Use SQLite (with any ORM or the built-in sqlite3 module) for persistence. The service should be startable with a single command after npm install or pip install -r requirements.txt.

Produce:

  • All source files needed to run the API
  • A README.md with startup instructions and example curl commands for each endpoint
  • A schema.sql showing the orders table structure

evals

tile.json