backendgym backendgym · reps Sign in with GitHubSign in

04Judge a ride search

sql-scaling-and-security / reps/04/README.md

reps/04/app.py is another short psycopg script. It searches rides by a fragment of the origin. Read it first, then run it as you ran rep 03, DATABASE_URL=<connection> python reps/04/app.py, and compare with the expected result below. Fix it so the hostile fragment matches nothing.

Expected once fixed: 0 rows for %' OR 1=1 --. The shipped file returns all 3 rides.

After the rep
  1. 1 In your fixed call, where do the % wildcards live: in the SQL text or in the bound value?