nerdexam
CompTIA

PT0-002 · Question #1

Given the following code: ie;</SCRIPT> Which of the following are the BEST methods to prevent against this type of attack? (Choose two.)

The correct answer is C. Output encoding E. Input validation. Encoding (commonly called “Output Encoding”) involves translating special characters into some different but equivalent form that is no longer dangerous in the target interpreter, for example translating the < character into the &lt; string when writing to an HTML page. Output…

Attacks and Exploits

Question

Given the following code:

ie;</SCRIPT> Which of the following are the BEST methods to prevent against this type of attack? (Choose two.)

Options

  • AWeb-application firewall
  • BParameterized queries
  • COutput encoding
  • DSession tokens
  • EInput validation
  • FBase64 encoding

How the community answered

(22 responses)
  • A
    5% (1)
  • B
    5% (1)
  • C
    91% (20)

Explanation

Encoding (commonly called “Output Encoding”) involves translating special characters into some different but equivalent form that is no longer dangerous in the target interpreter, for example translating the < character into the < string when writing to an HTML page. Output encoding and input sanitization are the best defenses against XSS.

Topics

#Cross-Site Scripting (XSS)#Input Validation#Output Encoding#Web Application Security

Community Discussion

No community discussion yet for this question.

Full PT0-002 Practice