nerdexam
CompTIA

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.

Attacks and exploits

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)
  • A
    2% (1)
  • B
    88% (43)
  • C
    4% (2)
  • D
    6% (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.

ADDoS attacks

DDoS attacks flood a target with traffic to exhaust resources and are not affected by how user input is encoded in web applications.

BXSS attacksCorrect

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.

CCSRF attacks

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.

DBrute-force attacks

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

#XSS prevention#HTML entity encoding#input sanitization#secure coding

Community Discussion

No community discussion yet for this question.

Full PT0-001 Practice