nerdexam
GIAC

GPEN · Question #316

John visits an online shop that stores the IDs and prices of the items to buy in a cookie. After selecting the items that he wants to buy, the attacker changes the price of the item to 1. Original coo

The correct answer is D. Cookie poisoning. Cookie poisoning is the attack of modifying client-side cookie values to manipulate server-side processing, exploiting applications that trust cookie data without server-side validation.

Web Application Penetration Testing

Question

John visits an online shop that stores the IDs and prices of the items to buy in a cookie. After selecting the items that he wants to buy, the attacker changes the price of the item to 1. Original cookie values:

ItemID1=2 ItemPrice1=900 ItemID2=1 ItemPrice2=200 Modified cookie values:

ItemID1=2 ItemPrice1=1 ItemID2=1 ItemPrice2=1 Now, he clicks the Buy button, and the prices are sent to the server that calculates the total price. Which of the following hacking techniques is John performing?

Options

  • ACross site scripting
  • BComputer-based social engineering
  • CMan-in-the-middle attack
  • DCookie poisoning

How the community answered

(22 responses)
  • A
    14% (3)
  • B
    5% (1)
  • C
    5% (1)
  • D
    77% (17)

Why each option

Cookie poisoning is the attack of modifying client-side cookie values to manipulate server-side processing, exploiting applications that trust cookie data without server-side validation.

ACross site scripting

Cross-site scripting (XSS) involves injecting malicious client-side scripts into web pages that execute in other users' browsers; it does not involve modifying cookie price fields to alter transaction totals.

BComputer-based social engineering

Computer-based social engineering manipulates people into revealing information or taking actions through deception via technology; John is directly manipulating HTTP data, not deceiving a person.

CMan-in-the-middle attack

A man-in-the-middle attack requires the attacker to intercept and alter communications between two other parties in transit; here John is modifying his own browser's cookies, not intercepting another party's traffic.

DCookie poisoningCorrect

Cookie poisoning occurs when an attacker tampers with the values stored in an HTTP cookie before the browser sends them back to the server. In this scenario, John directly edited the ItemPrice fields in the cookie from their legitimate values (900 and 200) to 1, and the server accepted these attacker-controlled values when computing the purchase total. The vulnerability exists because the application stores mutable, trust-sensitive data like prices in a client-controlled location instead of referencing them server-side from a trusted database.

Concept tested: Cookie poisoning for client-side data manipulation

Source: https://owasp.org/www-community/attacks/Cookie_Poisoning

Topics

#cookie poisoning#session manipulation#web application attacks#price tampering

Community Discussion

No community discussion yet for this question.

Full GPEN Practice