sql injection Flashcards

(15 cards)

1
Q

What is SQL injection (SQLi)?

A

SQLi is a vulnerability where untrusted data is sent to an interpreter as part of a query. Malicious input can trick the system into executing unintended commands or accessing unauthorized data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is database structure vulnerable during ransomware attacks?

A

Databases have complex internal structures. Even if encrypted data is returned after ransom payment, any error can destroy the database’s structure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does basic SQL injection work?

A

Unvalidated input like ‘ OR ‘1’=’1 added to queries can alter logic, allowing unauthorized data access or manipulation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the ‘Bobby Tables’ example?

A

An input like ‘Robert’); DROP TABLE Students;– exploits SQLi to delete entire tables. It’s a classic case demonstrating the dangers of unsanitized input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is input sanitization alone not enough?

A

Client-side validation can be bypassed. Server-side validation close to data entry is required, along with principle of least privilege for apps.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are second-order SQL injection attacks?

A

Malicious input is stored and later executed during a different query, making it harder to detect. Attackers may inject code during registration, triggering it on later login.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are examples of SQLi in practice?

A

WordPress, security tools (e.g., Fortinet), and even government software have had exploitable SQLi bugs, showing widespread vulnerability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can firewalls be bypassed in SQLi attacks?

A

Obfuscation techniques like using floating-point notation (e.g., 1.e(1)) can evade pattern-matching firewalls designed to block classic injection strings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What was the MOVEit SQLi breach?

A

MOVEit, used by payroll services, was exploited using SQLi by the Cl0p ransomware group, affecting thousands of companies and millions of users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are parameterized queries and why are they effective?

A

They separate user input from SQL logic, preventing SQL injection. Input is bound to placeholders, and parsed before execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What’s a bad usage of PreparedStatement?

A

If the query string is built with user input before preparing the statement, it negates protection and is no better than raw queries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What role does education play in SQLi prevention?

A

Many devs are unaware or undertrained in SQLi. Even textbooks can present insecure patterns as safe. Teaching secure practices is critical.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are mitigation strategies for SQLi?

A

Use parameterized queries, apply least privilege, audit code, educate developers, and use security tools to scan for SQLi vulnerabilities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Can AI tools create or prevent SQLi?

A

Text-to-SQL tools may generate vulnerable code, but tools like GitHub Copilot can also produce secure code using prepared statements when prompted properly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Where might you unexpectedly find SQL and SQLi?

A

Even IoT devices like smart torque wrenches have been found to run SQL backends and be vulnerable to SQLi, leading to industrial sabotage risk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly