GPEN · Question #133
John works as a Penetration Tester in a security service providing firm named you-are-secure Inc. Recently, John's company has got a project to test the security of a promotional Website penetration t
The correct answer is A. XSS attack. John's test demonstrates a reflected Cross-Site Scripting (XSS) vulnerability by injecting a script tag into a search field that executes in the browser. This confirms the site fails to sanitize or encode user-supplied input before rendering it.
Question
John works as a Penetration Tester in a security service providing firm named you-are-secure Inc. Recently, John's company has got a project to test the security of a promotional Website penetration testing, he inserts the following script in the search box at the company home page:
<script>alert('Hi, John')</script> After pressing the search button, a pop-up box appears on his screen with the text - "Hi, John." Which of the following attacks can be performed on the Web site tested by john while considering the above scenario?Options
- AXSS attack
- BReplay attack
- CBuffer overflow attack
- DCSRF attack
How the community answered
(23 responses)- A78% (18)
- B4% (1)
- C13% (3)
- D4% (1)
Why each option
John's test demonstrates a reflected Cross-Site Scripting (XSS) vulnerability by injecting a script tag into a search field that executes in the browser. This confirms the site fails to sanitize or encode user-supplied input before rendering it.
XSS occurs when an attacker injects malicious client-side scripts into a web page that are then executed by a victim's browser. The script tag inserted into the search box was reflected back and executed immediately, producing the alert pop-up, which is the hallmark of a reflected XSS attack. This demonstrates the site does not sanitize or encode user input before including it in the HTTP response.
A replay attack involves capturing and retransmitting valid authentication or session data to impersonate a user, not injecting executable scripts into a web page.
A buffer overflow attack exploits memory allocation boundaries in applications, typically in compiled code, and is not triggered by inserting script tags into a search form.
A CSRF attack tricks an authenticated user's browser into sending unauthorized requests to a site, which is unrelated to script injection in a search field producing an alert.
Concept tested: Reflected Cross-Site Scripting (XSS) identification
Source: https://owasp.org/www-community/attacks/xss/
Topics
Community Discussion
No community discussion yet for this question.