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
Difference between revisions of "Abridged XSS Prevention Cheat Sheet"
From OWASP
(Created page with "= Introduction = The following table briefly describes how to defeat Cross Site Scripting in a variety of different contexts. = XSS Prevention = {| class="wikitable" |- ! Head...") |
m (→XSS Prevention) |
||
| Line 7: | Line 7: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| − | ! | + | ! Data Type |
| − | ! | + | ! Context |
| − | ! | + | ! Defense |
|- | |- | ||
| − | | | + | | Numeric, Type safe language |
| − | | | + | | Any Context |
| − | | | + | | Cast to Numeric |
|- | |- | ||
| − | | | + | | String |
| − | | | + | | HTML Body |
| − | | | + | | HTML Entity Encode |
|- | |- | ||
| − | | | + | | String |
| − | | | + | | HTML Attribute, quoted |
| − | | | + | | HTML Entity Encode single and double quotes |
|} | |} | ||
| − | |||
= Related Articles = | = Related Articles = | ||
Revision as of 01:37, 12 November 2011
Introduction
The following table briefly describes how to defeat Cross Site Scripting in a variety of different contexts.
XSS Prevention
| Data Type | Context | Defense |
|---|---|---|
| Numeric, Type safe language | Any Context | Cast to Numeric |
| String | HTML Body | HTML Entity Encode |
| String | HTML Attribute, quoted | HTML Entity Encode single and double quotes |
Related Articles
OWASP Cheat Sheets Project Homepage
Authors and Primary Editors
Jim Manico - jim [at] owasp.org