-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attribute escaping #3
Comments
"Ugly" is not the problem when security-sensitive contexts. Also, most source viewers will already make these attributes simple to read (Firefox does, for example). As for the size, gzip compression generally deals with it. Originally posted by @Ocramius at zendframework/zend-escaper#21 (comment) |
That not easy to understand where is security improvements here. For example, why "dot" is secure character but "semicolon" is not? As for the size: On my example cyrillic page where escapeHtmlAttr partially used: Same with gzip Indeed, the size is not crucial. Originally posted by @autowp at zendframework/zend-escaper#21 (comment) |
Are you asking to add more characters to the whitelist, so they don't get encoded? Maybe you could argue that certain characters like ":" don't need to be escaped, but it's easier to have a very small white-list of "known good" characters ( For anyone not familiar with the background... the reason Lets say someone did:
Notice that it does not include quote marks. This creates the fairly "ugly" output:
What happens if
Without using
This means they can create an onclick event handler on your website :-) You could still use
So that it creates:
Or, if you want to use
PS: Have a look at adding a CSP (Content Security Policy), and set it so that it does not allow Originally posted by @craigfrancis at zendframework/zend-escaper#21 (comment) |
@craigfrancis Originally posted by @froschdesign at zendframework/zend-escaper#21 (comment) |
We recently ran into issues with some browsers and escaped forward slashes in URLs. What is the security reasoning behind escaping forward slashes in HTML attributes and would it be possible to add it to the allowed character list? |
For more informations see: "OWASP – Cross Site Scripting Prevention Cheat Sheet" |
Which requires escaping a large number of characters in attributes?
[^a-z0-9,\.\-_]
URL's in html looks ugly and are larger than possible
Originally posted by @autowp at zendframework/zend-escaper#21
The text was updated successfully, but these errors were encountered: