This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Abridged XSS Prevention Cheat Sheet

From OWASP
Revision as of 11:35, 16 November 2011 by Jmanico (talk | contribs)

Jump to: navigation, search

DRAFT CHEAT SHEET - WORK IN PROGRESS

Introduction

Cross site scripting is the most common web vulnerability. It represents a serious threat because cross site scripting allows evil attacker code to run in a victim’s browser. More details about XSS can be found here: https://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29

XSS Prevention Overview

Output Encoding Types

Encoding Type Encoding Mechanism
HTML Entity Encoding & --> &
< --> &lt;
> --> &gt;
" --> &quot;
' --> &#x27; ' is not recommended
/ --> &#x2F; forward slash is included as it helps end an HTML entity
HTML Attribute Encoding TODO
URL Encoding TODO
JavaScript HEX Encoding TODO
CSS Hex Encoding TODO

Related Articles

OWASP Cheat Sheets Project Homepage


Authors and Primary Editors

Jim Manico - jim [at] owasp.org
Jeff Williams - jeff [at] aspectsecurity.com