CCSP · Question #260
The Open Web Application Security Project (OWASP) Top Ten is a list of web application security threats that is composed by a member-driven OWASP committee of application development experts and publi
The correct answer is B. XML escape all identity assertions.. The question asks which option is NOT a method for reducing Cross-Site Scripting (XSS) attacks, which involve injecting malicious client-side scripts into web pages.
Question
The Open Web Application Security Project (OWASP) Top Ten is a list of web application security threats that is composed by a member-driven OWASP committee of application development experts and published approximately every 24 months. The 2013 OWASP Top Ten list includes "cross- site scripting (XSS)." Which of the following is not a method for reducing the risk of XSS attacks?
Options
- AUse an auto-escaping template system.
- BXML escape all identity assertions.
- CSanitize HTML markup with a library designed for the purpose.
- DHTML escape JSON values in an HTML context and read the data with JSON.parse.
How the community answered
(52 responses)- A10% (5)
- B83% (43)
- C6% (3)
- D2% (1)
Why each option
The question asks which option is NOT a method for reducing Cross-Site Scripting (XSS) attacks, which involve injecting malicious client-side scripts into web pages.
Auto-escaping template systems automatically encode output, preventing malicious scripts from being rendered as executable code, thus reducing XSS risk.
XML escaping identity assertions is related to securing XML processing or SAML assertions, which is a different security context than preventing the injection of client-side scripts (XSS) into web pages. XSS prevention focuses on proper output encoding and input sanitization for HTML contexts.
Sanitizing HTML markup with a specialized library removes potentially malicious tags and attributes from user-supplied input, directly mitigating XSS vulnerabilities.
HTML escaping JSON values before embedding them in an HTML context and then parsing them with JSON.parse ensures that the JSON data is treated as data, not executable HTML or script, preventing XSS.
Concept tested: Cross-Site Scripting (XSS) prevention methods
Source: https://owasp.org/www-community/attacks/xss/
Topics
Community Discussion
No community discussion yet for this question.