nerdexam
EC-Council

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.

Hacking Web Applications

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)
  • A
    3% (2)
  • B
    7% (4)
  • C
    2% (1)
  • D
    88% (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.

ABuffer overflow

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.

BCross-site request forgery

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.

CDistributed denial of service

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.

DCross-site scriptingCorrect

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

#cross-site scripting#XSS#JavaScript injection#web vulnerability

Community Discussion

No community discussion yet for this question.

Full 312-50V9 Practice