Question
Which of the following best describes the mechanism of a
Cross-Site Scripting (XSS) attack?Solution
A Cross-Site Scripting (XSS) attack involves injecting malicious scripts, typically JavaScript, into web pages that are later viewed by other users. This attack exploits vulnerabilities in web applications that fail to properly validate or sanitize user inputs. When a victim visits the compromised web page, the malicious script executes in their browser, potentially stealing sensitive data, hijacking sessions, or defacing websites. XSS is categorized into three types: reflected, stored, and DOM-based. Stored XSS is particularly dangerous because the malicious script is permanently stored on the server and served to multiple users. For instance, attackers might inject a script into a comment section of a blog, and every user viewing the comments becomes a victim. Proper input validation, output encoding, and Content Security Policy (CSP) implementation are essential defenses against XSS. Why Other Options Are Incorrect :
- Exploiting vulnerabilities in a database to inject malicious SQL queries : This describes SQL Injection, which targets backend databases rather than injecting scripts into web pages.
- Tricking users into executing unintended actions on a web application they are authenticated with : This is a Cross-Site Request Forgery (CSRF) attack, not XSS.
- Overwhelming a server with excessive traffic to disrupt service availability : This refers to Distributed Denial-of-Service (DDoS) attacks, unrelated to injecting scripts.
- Using trial-and-error methods to guess valid user credentials : This describes a Brute Force attack, which involves guessing passwords and does not involve script injection.
- The earnings of βUβ, βVβ, and βWβ are in the ratio 2:3:5. Their average income is Rs. 18,000. If they spend 45%, 55%, and 65% of their respecti...
In a workshop of 50 participants, the average age is 40 years. One participant aged 38 leaves, and 5 new participants with an average age of 44 join. Wh...
The combined average number of pens with persons βBβ and βCβ is 75% of the combined average number of pens with persons βAβ and βDβ. The...
A set contains ten numbers. The average of the first six numbers is (x - 1), and the average of the last three numbers is (x + 6). The average of the en...
- The average of two consecutive even numbers is 67. If the smaller number is increased by 35% and the larger number is decreased by 35%, then find the diffe...
Quantity I: Β The average weight of 30 people is increased by 1.5 kg when one man weight 48 kg is replaced by another man. Find the weight of new man?<...
The average age of a class of 20 girls is 16 years. If 4 new girls having average age of 10 years join the class, then the average age of the class beco...
The average of 35 numbers is 50. If 5 is added to each number, then the new average will be:
A set contains ten numbers. The average of the first six numbers is (x - 4), and the average of the last three numbers is (x + 2). The average of the en...
The average age of 16 girls is 35 years. If the age of two more girls is added the average decreases by 3.5 years. What is the sum of the age of new girls?