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
| |
This Project has been identified as an orphaned one. If you find interest in assuming its lead, please contact the Global Projects Committee. |
| |
AntiXSS is a class for use with PHP 5+ that helps to reduce XSS (cross-site scripting) vulnerabilities by automatically encoding output to behave only as intended.
|
NOTE: This library will eventually replaced by the ESAPI for PHP port. That effort is not complete as yet. The actual API will not change dramatically between AntiXSS library and ESAPI for PHP. |
Hello, <php echo AntiXSS:HTMLEncode($nameOfMyUser); ?>!
... alert(myFunction('<?php echo AntiXSS:JavaScriptEncode($myVariable); ?>'); ...
... http://example.com/myscript.php?<?php echo AntiXSS::URLEncode($myQueryStringValue); ?> ...
<myelement myattribute="<?php echo AntiXSS::XMLAttributeEncode($myAttributeValue); ?>"><?php echo AntiXSS::XMLEncode($myElementValue); ?></myelement >
Downloads are not yet available.
The AntiXSS class will use any character encoding supported by libmbfl, the library upon which the mbstring functions are based, with the exception of 7bit and BASE64.
A list of supported character sets is available at PHP.net: [2]
The Owasp AntiXSS class utilizes the following encodings: UTF-32, HTML-ENTITIES
Typically, your doctype definition will match the encoding of your source files and your database source. If you run into issues where some characters don't display or display wrong, check the encoding of every data source and file involved.
And particularly if you wish to output extended or multibyte characters from within your source files, make sure the encoding of all files involved matches the output format, unless you will be handling your conversions manually using mb_convert_encoding.
Purpose: N/A
License: N/A
Project Maintainer:
Project Contributor(s): N/A
3x slide Project Presentation: N/A
Mailing list: N/A
Project Roadmap: N/A
Main links: N/A
Project Health: Not Reviewed (Provisional)
To be reviewed under Assessment Criteria v2.0
This category currently contains no pages or media.