CAS-003 · Question #746
A developer has executed code for a website that allows users to search for employees' phone numbers by last name. The query string sent by the browser is as follows: The developer has implemented a…
The correct answer is A. Sanitization library E. Output encoding. The website is already using a sanitization library and stored procedures, but still vulnerable to XSS. XSS (Cross-Site Scripting) requires a two-pronged defense: sanitizing input AND encoding output. Output encoding (E) is the critical missing control - it converts special…
Question
A developer has executed code for a website that allows users to search for employees' phone numbers by last name. The query string sent by the browser is as follows:
The developer has implemented a well-known JavaScript sanitization library and stored procedures, but a penetration test shows the website is vulnerable to XSS. Which of the following should the developer implement NEXT to prevent XSS? (Choose two.)
Options
- ASanitization library
- BSecure cookies
- CTLS encryption
- DInput serialization
- EOutput encoding
- FPUT form submission
How the community answered
(35 responses)- A60% (21)
- B3% (1)
- C9% (3)
- D23% (8)
- F6% (2)
Explanation
The website is already using a sanitization library and stored procedures, but still vulnerable to XSS. XSS (Cross-Site Scripting) requires a two-pronged defense: sanitizing input AND encoding output. Output encoding (E) is the critical missing control - it converts special characters (like <, >, &) into their HTML entity equivalents before rendering them in the browser, preventing injected scripts from executing. Even with input sanitization, encoding output is essential because data may arrive from sources that bypassed input filtering. Re-evaluating or upgrading the sanitization library (A) is also appropriate since the current one is clearly insufficient. Secure cookies (B) and TLS (C) protect data in transit but do not prevent XSS. Input serialization (D) is not a standard XSS mitigation. PUT form submission (F) is not a security control.
Topics
Community Discussion
No community discussion yet for this question.