Cross-Site Scripting & SQL Injection Attacks

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 4:18 PM on 7/14/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

37 Terms

1
New cards

What protocol is the web based on for servers responding to client requests?

HTTP/HTTPS

2
New cards

What is the difference between server-side code and client-side code in a web application?

Server-side code runs on the web server to process the request and build the response; client-side code runs within the web browser on the client machine to modify the web page before display or modify requests made to the server

3
New cards

What is one of the most widespread vulnerabilities in web apps?

Failure to validate user input properly

4
New cards

What indicates an input validation vulnerability in a web app?

A threat actor can send a script via an input field and make the server or client execute that code

5
New cards

What does sanitizing user input help prevent?

XSS attacks

6
New cards

What is output encoding in this section?

Converting special characters into safe format before displaying it

7
New cards

What does CSP stand for in this section?

Content Security Policy

8
New cards

What does a cross-site scripting (XSS) attack exploit?

The fact that the browser is likely to trust scripts that appear to come from a site the user has chosen to visit

9
New cards

What does an XSS attack insert into a trusted site?

A malicious script that appears to be part of the trusted site

10
New cards

What is the first step in a non-persistent XSS attack?

The attacker identifies an input validation vulnerability in the trusted site

11
New cards

What is the second step in a non-persistent XSS attack?

The attacker crafts a URL to perform code injection against the trusted site

12
New cards

What can the crafted XSS URL be delivered through?

A link to the attacker's site from the trusted site or a link in a phishing email message

13
New cards

What happens when the user opens the crafted XSS link?

The trusted site returns a page containing the malicious code injected by the attacker

14
New cards

Why does the malicious code execute in a non-persistent XSS attack?

The browser is likely to be configured to allow the site to run scripts

15
New cards

What can malicious code do in an XSS attack?

Deface the trusted site, steal data from the user's cookies, intercept information entered in a form, or try to install malware

16
New cards

What is the crucial point about how XSS malicious code runs?

It runs in the client's browser with the same permission level as the trusted site

17
New cards

Why is non-persistent XSS called non-persistent?

At no point is data on the web server changed

18
New cards

What is the goal of a stored or persistent XSS attack?

Insert code into a back-end database or content management system used by the trusted site

19
New cards

How can a persistent XSS attack be delivered in this section?

By submitting a post to a bulletin board with a malicious script embedded in the message

20
New cards

What happens when other users view content containing a persistent XSS payload?

The malicious script is executed

21
New cards
What does SQL stand for?
Structured Query Language
22
New cards
What is SQL used for in a web application?
To read and write information from a database
23
New cards
What SQL statement is used for selecting data?
SELECT
24
New cards
What SQL statement is used for inserting data?
INSERT
25
New cards
What SQL statement is used for deleting data?
DELETE
26
New cards
What SQL statement is used for updating data?
UPDATE
27
New cards
What is a SQL injection attack?
The threat actor modifies one or more of the four basic SQL functions by adding code to some input accepted by the app, causing it to execute the attacker's own set of SQL queries or parameters
28
New cards
What could a successful SQL injection attack allow?
Extract or insert information into the database or execute arbitrary code on the remote system using the same privileges as the database application
29
New cards
What is code injection in the reference?
Adding your own information into a data stream
30
New cards
What enables code injection according to the reference?
Bad programming; the application should properly handle input and output
31
New cards
What does the example input "' or 1 equals 1--" do in a SQL injection example?
It makes the logical statement 1 equals 1 always true and turns the rest of the statement into a comment
32
New cards
Why does the string "--" matter in the SQL injection example?
It turns the rest of the statement into a comment
33
New cards
Why can the injected query dump a list of all users?
Because 1 equals 1 is always true, making it more likely the web application will parse the modified version and return all users
34
New cards
How does input sanitization help prevent SQL injection?
By removing special characters that can be used to manipulate SQL queries
35
New cards
How do parameterized queries help prevent SQL injection?
User input is treated as data input and not executable code
36
New cards
How do stored procedures help prevent SQL injection?
They use pre-compiled SQL code that is stored on the server
37
New cards
What is the key risk if you can manipulate the database?
Then you control the application