What is the primary vulnerability exploited by Cross-Site Scripting (XSS) attacks on web applications?

Answer and explanation

Correct answer: A. Inadequate validation and sanitization of user-supplied input before reflecting it into web pages

  1. Step 1: Cross-Site Scripting (XSS) occurs when an application includes untrusted user input in a web page without proper validation or output encoding.
  2. Step 2: This allows attackers to execute malicious JavaScript in the victim's browser to hijack sessions or steal cookies.
Answer
Inadequate validation and sanitization of user-supplied input before reflecting it into web pages.
Why not the others: 'Lack of backend encryption' relates to data at rest security; 'Firewall packet inspection' addresses network layer attacks; 'CPU exhaustion' relates to denial-of-service.

Practise more Python Programming, Data Structures, Algorithms, Networks and Cybersecurity.

Free questions with an explanation for every one, and full timed Saudi Secondary School Certificate mock tests.

What is the primary… | Saudi Secondary School Certificate