ある会社の公開 Web サイトの 1 つで XSS 脆弱性が報告されました。セキュリティ部門は発見を確認し、アプリケーションの所有者に推奨事項を提供する必要があります。次の推奨事項のうち、この脆弱性が悪用されるのを最も効果的に防ぐものはどれですか (2 つ選択してください)。
正解:D,F
Comprehensive Detailed Explanation:To effectively prevent Cross-Site Scripting (XSS) attacks, implementing appropriate security controls within the application code and at the network layer is critical.
Here's a breakdown of each option:
* A. Implement an IPS in front of the web server
* Explanation: Intrusion Prevention Systems (IPS) are primarily designed to detect and prevent network-based attacks, not application-layer vulnerabilities such as XSS. They do not specifically mitigate XSS threats effectively.
* B. Enable MFA on the website
* Explanation: Multi-factor authentication (MFA) strengthens user authentication but does not address XSS, which typically involves injecting malicious scripts rather than compromising user credentials.
* C. Take the website offline until it is patched
* While this might temporarily mitigate the risk, it is not a practical solution for ongoing operations, especially when effective preventative controls (e.g., WAF rules or code updates) can be implemented without disabling the service.
* D. Implement a compensating control in the source code
* Explanation: Implementing security controls at the code level is an effective way to mitigate XSS risks. This can involve proper input validation, output encoding, and utilizing libraries that sanitize user inputs. By addressing the root cause in the source code, developers prevent scripts from being injected or executed in the browser.
* E. Configure TLS v1.3 on the website
* Explanation: While TLS v1.3 secures the communication channel, it does not address XSS directly. XSS attacks manipulate client-side scripts, which TLS cannot prevent, as TLS only encrypts data in transit.
* F. Fix the vulnerability using a virtual patch at the WAF
* Explanation: Web Application Firewalls (WAFs) can mitigate XSS vulnerabilities by identifying and blocking malicious payloads. Virtual patching at the WAF level provides a temporary fix by preventing exploit attempts from reaching the application, giving developers time to implement a permanent fix in the source code.
References:
OWASP XSS Prevention Cheat Sheet: Detailed guidance on encoding, sanitizing, and safe coding practices to prevent XSS.
NIST SP 800-44: Guidelines on Web Security, discussing WAFs and application-layer protections.
CWE-79: Common Weakness Enumeration on Cross-Site Scripting, which outlines ways to address and prevent XSS attacks.