312-50V9 · Question #149
While testing the company's web applications, a tester attempts to insert the following test script into the search area on the company's web site: <script>alert(" Testing Testing Testing…
The correct answer is D. Cross-site scripting. Injecting a script tag into a search field that executes in the browser confirms a Cross-site Scripting (XSS) vulnerability, where unsanitized user input is rendered as live HTML and JavaScript.
Question
While testing the company's web applications, a tester attempts to insert the following test script into the search area on the company's web site:
<script>alert(" Testing Testing Testing ")</script> Afterwards, when the tester presses the search button, a pop-up box appears on the screen with the text:"Testing Testing Testing". Which vulnerability has been detected in the web application?
Options
- ABuffer overflow
- BCross-site request forgery
- CDistributed denial of service
- DCross-site scripting
How the community answered
(58 responses)- A3% (2)
- B7% (4)
- C2% (1)
- D88% (51)
Why each option
Injecting a script tag into a search field that executes in the browser confirms a Cross-site Scripting (XSS) vulnerability, where unsanitized user input is rendered as live HTML and JavaScript.
Buffer overflow involves writing data past the boundaries of an allocated memory buffer in an application, which is unrelated to client-side script injection in a browser.
Cross-site request forgery tricks an authenticated user's browser into sending unintended state-changing requests to a trusted site, and does not involve injecting scripts through input fields.
Distributed denial of service overwhelms a target with traffic from many sources to cause unavailability, which is entirely unrelated to script injection in a web form.
Cross-site scripting occurs when a web application echoes user-supplied input back to the browser without proper encoding or sanitization, allowing embedded scripts to execute. The alert popup appearing after the script tag was submitted proves the application rendered the input as executable JavaScript rather than as plain text. This is a reflected XSS variant triggered by the search function.
Concept tested: Cross-site scripting (XSS) reflected vulnerability detection
Source: https://owasp.org/www-community/attacks/xss/
Topics
Community Discussion
No community discussion yet for this question.