CompTIA

PT0-003 practice question 17

CompTIA PenTest+ · free question 17 of 20

Question

During a web application assessment, a penetration tester identifies an input field that allows JavaScript injection. The tester inserts a line of JavaScript that results in a prompt, presenting a text box when browsing to the page going forward. Which of the following types of attacks is this an example of?
  • A. SQL injection
  • B. SSRF
  • C. XSS Correct
  • D. Server-side template injection

Explanation

Injecting JavaScript that the page stores and runs for every later visitor is cross-site scripting (XSS), here a stored XSS because the prompt appears whenever the page is browsed. SQL injection targets database queries, SSRF makes the server send requests to other systems, and server-side template injection runs code inside the server's template engine rather than in the victim's browser.

Practice the whole free set

Answer all 20 free PT0-003 questions with instant feedback, or unlock all 342 questions with Learn and Exam modes.