Index: trunk/phase3/includes/Sanitizer.php |
— | — | @@ -39,6 +39,14 @@ |
40 | 40 | |&\#[xX]([0-9A-Fa-f]+); |
41 | 41 | |(&)/x'; |
42 | 42 | |
| 43 | + /** |
| 44 | + * Blacklist for evil uris like javascript: |
| 45 | + * WARNING: DO NOT use this in any place that actually requires blacklisting |
| 46 | + * for security reasons. There are NUMEROUS[1] ways to bypass blacklisting, the |
| 47 | + * only way to be secure from javascript: uri based xss vectors is to whitelist |
| 48 | + * things that you know are safe and deny everything else. |
| 49 | + * [1]: http://ha.ckers.org/xss.html |
| 50 | + */ |
43 | 51 | const EVIL_URI_PATTERN = '!(^|\s|\*/\s*)(javascript|vbscript)([^\w]|$)!i'; |
44 | 52 | const XMLNS_ATTRIBUTE_PATTERN = "/^xmlns:[:A-Z_a-z-.0-9]+$/"; |
45 | 53 | |