Home / Learn Secure SQL / Common Mistakes, Collected

Common Mistakes, Collected

The recurring mistakes this course has called out, in one list.

The gistThe recurring mistakes this course has called out, in one list.

The idea, explained simply

Mistakes, by categoryQuery construction mistakesAccess control mistakesValidation mistakesError handling mistakes
Mistakes, by category

Definition

This final lesson collects the specific mistakes flagged throughout the course's examples and fixes (an unbound value, a missing allowlist, an overly broad grant, a leaked internal error, a forgotten length check) into one list, as a final, practical review before finishing the course.

Why you need this

Reviewing the concrete mistakes already seen (rather than abstract rules) sharpens pattern recognition for spotting the same mistakes in new, unfamiliar code going forward.

How it works

Read through this list once at the end of the course, and periodically re-read it when reviewing someone else's database code, as a quick mental checklist of what tends to go wrong.

Where you'll see this

  • Web application code review
  • Backend development
  • Database administration
CategoryCommon mistake
Query constructionConcatenating a value into SQL text instead of binding it
Query constructionBinding a dynamic identifier instead of allowlisting it
Access controlUsing one broad, shared database account for everything
Access controlHiding a feature only in the UI without a matching database-level restriction
ValidationTrusting a client-supplied type/size/content-type header without server-side verification
ValidationAccepting and writing every field a client sends (mass assignment) instead of an explicit allowlist
Error handlingReturning raw database error text/stack traces to the end user
Error handlingLogging too little detail internally to actually debug an incident later

Test what you just read

1. This course's recurring mistakes mostly fall into which categories?