This tutorial could not be loaded.
Loading tutorial...
Interactive tutorial
Learn how SQL injection changes the meaning of a query and how to prevent it with parameter binding and controlled dynamic SQL. Using a small local Python and SQLite example, you will repair vulnerable code, test the fix, recognize risks hidden behind database abstractions, and identify additional production safeguards.
Step 1 of 9
3 min
Find the Boundary Between SQL and Data
Trace untrusted input to database execution and identify where ordinary data can become SQL instructions.
Step 2 of 9
4 min
Create a Reproducible Local Test Fixture
Create a disposable SQLite fixture and establish a predictable baseline query.
Step 3 of 9
4 min
See How Input Changes Query Meaning
Explain, through static review, how unsafe SQL construction can cause a syntax error or change a filter’s meaning.
Step 4 of 9
4 min
Repair the Query with Parameter Binding
Repair a category lookup with parameter binding and explain its exact-match results.
Step 5 of 9
5 min
Control Dynamic SQL Structure
Use an allowlist to control sorting while keeping the category value bound separately.
Step 6 of 9
3 min
Recognize Unsafe SQL Behind Abstractions
Trace values through abstractions and storage to identify unsafe query construction and bind reused data.
Step 7 of 9
4 min
Add Safeguards Without Confusing Their Roles
Distinguish safe query construction from validation, access controls, monitoring, and error handling.
Step 8 of 9
7 min
Build Regression Checks for the Fix
Build and run local regression checks for the repaired lookup, and interpret what the results do and do not establish.
Step 9 of 9
5 min
Review, Repair, and Verify a Complete Lookup
Analyze a vulnerable lookup, then repair and verify locally that its values and ordering choices remain separate from untrusted SQL.
Video Courses
recommended
recommended
recommended
Thousands of online courses in video, ebooks and audiobooks.
To test your knowledge during online courses
Generated directly from your cell phone's photo gallery and sent to your email
Download our app via QR Code or the links below:.
+ 10 million
students
Free and Valid
Certificate
60 thousand free
exercises
4.8/5 rating in
app stores
Free courses in
video and ebooks