CybersecurityLesson 5 of 5 in the course Malware and attacks

SQL Injection: Attack Patterns, Consequences, and Defenses

5 flashcards · 5 quiz questions · 5 match pairs · 3 fill-in sentences · English

Lesson progress
0 / 5

Your progress is kept in this browser only.Sign up to save it

Summary

SQL injection is a vulnerability that occurs when an application treats untrusted input as part of a database command. This lesson introduces SQL injection and explains how unsafe query construction can let data alter a query's meaning.

SQL injection is a code-injection technique that targets applications using SQL databases. An application may accept information through a form, URL, or other interface and use it to build a database query. If that input is not handled safely, an attacker may cause the database to interpret part of the input as SQL instructions.

All flashcards

Blind SQL injection
An attack that infers information from observable behavior when query results are not shown directly.
Second-order SQL injection
Injection that occurs when stored input is later used unsafely in another query.
Out-of-band SQL injection
An attack that obtains results through a separate communication channel.
Parameterized statement
A query that keeps SQL instructions separate from supplied values.
Principle of least privilege
Giving a database account only the permissions needed for its tasks.

Quiz questions

  1. When an application hides query results, how can blind SQL injection reveal information?Answer: The attacker infers query outcomes from observable response differences.
  2. What makes an SQL injection attack second-order?Answer: Input is stored safely at first but later used unsafely in a query.
  3. What is characteristic of out-of-band SQL injection?Answer: Results are obtained through a separate channel, if the target can communicate through it.
  4. How does the principle of least privilege reduce the impact of a compromised database account?Answer: It limits the account to permissions required for its specific tasks.
  5. Why does using an ORM not automatically guarantee protection from SQL injection?Answer: Raw SQL or unsafe query-building paths can still incorporate untrusted input.

Based on the Wikipedia article SQL injection, licensed CC BY-SA 4.0. Adapted into a summary, flashcards and quizzes.

All Cybersecurity lessons