Lecture 10 – SQL Injection Attack & Related Concepts

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/37

flashcard set

Earn XP

Description and Tags

A comprehensive set of flashcards covering Lecture 10 topics: HTTP basics, database structure, SQL commands, SQL Injection mechanics, real-world breaches, impacts, and defenses.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

38 Terms

1
New cards

What web security feature does CORS relax?

The same-origin policy, by allowing cross-origin resource sharing for whitelisted domains.

2
New cards

Which protocol enables browsers and servers to exchange data in a request-response model?

HTTP (Hypertext Transfer Protocol).

3
New cards

Which HTTP method is typically used to request data without changing server state?

GET.

4
New cards

Which HTTP method is used to submit data, such as form information, to a server?

POST.

5
New cards

In an HTTP request, which header specifies the target domain?

Host.

6
New cards

During a web request that needs database data, what is constructed after the web server parses the request?

An SQL query.

7
New cards

Define an SQL Injection (SQLi) attack.

Insertion of malicious SQL code into application queries due to improper input validation, letting attackers manipulate the database.

8
New cards

Why can SQL Injection occur with both GET and POST requests?

Because user input from either method can be concatenated into SQL statements by the application.

9
New cards

List the three main components of a database system.

Data, Database Management System (DBMS), and Database Applications.

10
New cards

What kind of database organizes data into tables with rows and columns?

A relational (SQL) database.

11
New cards

Approximately what percentage of Fortune 500 companies use SQL databases?

About 90 %.

12
New cards

What market share does SQL hold in the $63 B DBMS market (Gartner 2023)?

Roughly 80 %.

13
New cards

In a relational table, what are rows (records)?

Individual entries containing all information about a specific item.

14
New cards

What is a primary key?

A column (or set of columns) that uniquely identifies each row and cannot be NULL.

15
New cards

What is a foreign key?

A column that references a primary key in another table to enforce referential integrity.

16
New cards

What does SQL stand for?

Structured Query Language.

17
New cards

Which SQL command creates a new table?

CREATE TABLE.

18
New cards

Which SQL command inserts a new row?

INSERT INTO.

19
New cards

Which SQL command retrieves data from one or more tables?

SELECT.

20
New cards

Which SQL command modifies existing data?

UPDATE.

21
New cards

Which SQL command removes rows from a table?

DELETE.

22
New cards

In a typical web stack, which layer usually holds prepared statements or ORM queries?

The Data Access Layer.

23
New cards

What does the malicious input "admin' --" do in the example login query?

Closes the string and comments out the rest, bypassing the password check.

24
New cards

Name the three main types of SQL Injection attacks.

Classic (in-band), Error-based, and Blind SQL Injection.

25
New cards

According to OWASP 2023, what percentage of web-app vulnerabilities involve SQLi?

42 %.

26
New cards

Give one potential impact of SQL Injection.

Data breach, data loss/corruption, denial of service, system compromise, or reputational damage.

27
New cards

What is the principle of least privilege in database security?

Grant each database account only the permissions absolutely necessary for its tasks.

28
New cards

Why are prepared statements effective against SQLi?

They keep user input separate from SQL code, preventing injection.

29
New cards

In MySQL, what does the symbol # do inside a query?

Starts a comment; everything after it on the line is ignored.

30
New cards

What happens when "admin'; DELETE FROM credential WHERE name='Alice'; #" is submitted as the username?

The injected DELETE statement runs and removes Alice’s record from the credential table.

31
New cards

Which real-world 2009 incident involved a massive payment-data breach?

The Heartland Payment Systems data breach.

32
New cards

Which 2011 incident compromised the Sony PlayStation Network?

The Sony PlayStation Network data breach.

33
New cards

Why is a SHA1 hash used in the password-change injection example?

To set Boby’s password to a hashed value, enabling login with the new plaintext password.

34
New cards

In MySQL, which command lists all databases?

SHOW DATABASES;.

35
New cards

Which command selects a specific database for use?

USE database_name;.

36
New cards

Which command lists all tables within the current database?

SHOW TABLES;.

37
New cards

What does the query "SELECT * FROM credential WHERE name='Alice';" do?

Retrieves all columns for the row where the name is Alice.

38
New cards

What are two key defenses against SQL Injection besides prepared statements?

Input validation/sanitization and regular security testing (code review, vulnerability scanning, penetration testing).