Lecture 09 – Cross-Site Request Forgery (CSIT-460 Computer Security)

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

1/28

flashcard set

Earn XP

Description and Tags

29 question-and-answer flashcards summarizing Lecture 09 on Cross-Site Request Forgery, covering definitions, attack mechanics, HTTP basics, browser behaviors, and major countermeasures such as SameSite cookies and CSRF tokens.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

29 Terms

1
New cards

What does Cross-Origin Resource Sharing (CORS) allow a server to do?

Whitelist specific origins so that browsers can make permitted cross-site requests, relaxing the same-origin policy.

2
New cards

In HTTP, which method is normally used to request data without changing server state?

The GET method.

3
New cards

Which HTTP method is typically used to send form data that the server will process or store?

The POST method.

4
New cards

What is Cross-Site Request Forgery (CSRF)?

A web vulnerability where an attacker causes an authenticated user’s browser to send unwanted requests that carry the user’s session credentials, performing actions without the user’s consent.

5
New cards

Whose trust is exploited during a CSRF attack?

The trust the target web application places in the user’s browser session.

6
New cards

In a normal, safe request flow, who originates the request received by the trusted website?

The user, interacting directly with pages from the trusted website.

7
New cards

During a CSRF attack, where is the malicious request generated?

From a different origin controlled by the attacker—such as a malicious link, image, or website.

8
New cards

Why can a CSRF attack succeed against a banking site that uses GET requests for transfers?

Because the victim’s browser automatically attaches the valid session cookie to the attacker-supplied GET URL, making the request look legitimate to the server.

9
New cards

What are the two kinds of requests a server must distinguish to prevent CSRF?

Same-site requests (originating from its own pages) and cross-site requests (originating from other sites).

10
New cards

Why can’t servers rely on the Referrer header alone to stop CSRF?

Referrer headers may be missing, blocked, or modified for privacy, so they are not dependable.

11
New cards

What browser feature lets servers declare that cookies should not be sent with cross-site requests?

The SameSite cookie attribute.

12
New cards

Name the two primary SameSite modes and describe their behavior.

Strict: cookies are never sent on cross-site requests. Lax: cookies are sent on top-level navigation but withheld from most other cross-site requests.

13
New cards

What is a CSRF (secret) token?

A unique, unpredictable value generated by the server and embedded in each form or action URL; it must accompany every sensitive request and be validated by the server.

14
New cards

How does the secret token approach block CSRF?

Attackers cannot guess or obtain the valid token, so any forged request lacks a correct token and is rejected by the server.

15
New cards

List three key security properties of a good CSRF token.

Unique per user session, randomly generated, and inaccessible across origins (protected by the same-origin policy).

16
New cards

What two hidden fields does Elgg embed for CSRF protection?

_elggtoken and _elggts (timestamp).

17
New cards

In the SEED lab GET-based attack, what HTML element is abused to send the forged request?

An tag whose src attribute points to the vulnerable action URL.

18
New cards

In the SEED lab POST-based attack, how is the malicious form submitted automatically?

JavaScript executes document.getElementById('attack').submit() when the page loads.

19
New cards

After enabling Elgg’s gatekeeper() check, what happens to the previous CSRF attack pages?

Their requests are rejected because they lack valid _elggtoken and _elggts values.

20
New cards

What single sentence summarizes modern CSRF defense best practices?

Use properly configured SameSite cookies together with per-request CSRF tokens to ensure only intentional, site-originated actions are processed.

21
New cards

Which HTTP header can reveal the page that initiated a request and sometimes helps detect CSRF?

The Referer (or Referrer) header.

22
New cards

What role does the browser’s same-origin policy play in CSRF token security?

It prevents malicious sites from reading the token embedded in pages from the legitimate origin.

23
New cards

In the banking example, which URL parameter values convey the attacker's intent?

to=3220 (attacker’s account) and amount=500 (amount to transfer).

24
New cards

Why is CSRF particularly dangerous for users already authenticated on high-value sites?

Their active session cookies automatically accompany forged requests, granting the attacker the same privileges as the victim.

25
New cards

Name three ways a user might be lured into triggering a CSRF attack.

Clicking a deceptive link in an email, loading an attacker’s site that auto-submits a form, or viewing an embedded image or script on a compromised page.

26
New cards

How does the browser determine whether to send a SameSite=Strict cookie?

It checks if the request’s top-level site matches the cookie’s origin; if not, the cookie is withheld.

27
New cards

What simple code change re-enabled CSRF protection in the SEED lab’s Elgg instance?

Removing or commenting out the line ‘return true;’ at the top of the gatekeeper() function in ActionsService.php.

28
New cards

Which HTTP request type (GET or POST) is safer for performing state-changing operations, and why?

POST is safer because it is less likely to be triggered unintentionally (e.g., by images or links) and can include a CSRF token in its body.

29
New cards

When observing HTTP traffic in the SEED lab, which browser tool tab helps you see individual requests and parameters?

The Network tab of the browser’s Web/Developer Console.