PT0-001 · Question #194
Software developers should escape all characters (including spaces but excluding alphanumeric characters) with the HTML entity &#xHH; format to prevent what type of attack?
The correct answer is B. XSS attacks. HTML entity encoding in the &#xHH; format neutralizes injected script payloads by rendering characters as display text rather than executable markup, preventing XSS attacks.
Question
Software developers should escape all characters (including spaces but excluding alphanumeric characters) with the HTML entity &#xHH; format to prevent what type of attack?
Options
- ADDoS attacks
- BXSS attacks
- CCSRF attacks
- DBrute-force attacks
How the community answered
(49 responses)- A2% (1)
- B88% (43)
- C4% (2)
- D6% (3)
Why each option
HTML entity encoding in the &#xHH; format neutralizes injected script payloads by rendering characters as display text rather than executable markup, preventing XSS attacks.
DDoS attacks flood a target with traffic to exhaust resources and are not affected by how user input is encoded in web applications.
XSS attacks inject malicious scripts into web content viewed by other users by exploiting unescaped user input. Encoding all non-alphanumeric characters as HTML entities (&#xHH;) ensures browsers treat the input as literal text rather than HTML or JavaScript, directly blocking the injection vector XSS relies on.
CSRF attacks trick authenticated users into submitting forged requests and are mitigated by anti-CSRF tokens or SameSite cookie attributes, not by HTML entity encoding.
Brute-force attacks repeatedly guess credentials and are countered by rate limiting or account lockout policies, not by input encoding.
Concept tested: HTML entity encoding preventing XSS injection
Source: https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html
Topics
Community Discussion
No community discussion yet for this question.