Question 91 of 318
Single answerYou are on your company's development team. You noticed that your web application hosted in staging on GKE dynamically includes user data in web pages without first properly validating the inputted data. This could allow an attacker to execute gibberish commands and display arbitrary content in a victim user's browser in a production environment.
How should you prevent and fix this vulnerability?
How should you prevent and fix this vulnerability?
AUse Cloud IAP based on IP address or end-user device attributes to prevent and fix the vulnerability.
BSet up an HTTPS load balancer, and then use Cloud Armor for the production environment to prevent the potential XSS attack.
CUse Web Security Scanner to validate the usage of an outdated library in the code, and then use a secured version of the included library.
✓DUse Web Security Scanner in staging to simulate an XSS injection attack, and then use a templating system that supports contextual auto-escaping.
✓
Correct Answer: D
Use Web Security Scanner in staging to simulate an XSS injection attack, and then use a templating system that supports contextual auto-escaping.
▥
Explanation
The correct answer is highlighted above. Review the wording carefully, then use the next question to continue building your understanding of Google certification topics.