Question

    Which type of attack allows an attacker to inject malicious

    scripts into a trusted website to execute in a victim's browser?
    A Cross-Site Request Forgery (CSRF) Correct Answer Incorrect Answer
    B Cross-Site Scripting (XSS) Correct Answer Incorrect Answer
    C SQL Injection Correct Answer Incorrect Answer
    D Brute Force Attack Correct Answer Incorrect Answer
    E Distributed Denial-of-Service (DDoS) Correct Answer Incorrect Answer

    Solution

    Cross-Site Scripting (XSS) is a type of attack where an attacker injects malicious scripts into a trusted website. These scripts execute in the victim’s browser, often stealing sensitive information like session cookies, credentials, or personal data. XSS exploits vulnerabilities in web applications that do not properly validate or escape user inputs. For example, in a forum application, if the input field for comments does not sanitize input, an attacker could inject