-
Notifications
You must be signed in to change notification settings - Fork 30
Attribute escaping #21
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. |
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. |
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 |
@craigfrancis |
This repository has been closed and moved to laminas/laminas-escaper; a new issue has been opened at laminas/laminas-escaper#3. |
Which requires escaping a large number of characters in attributes?
[^a-z0-9,\.\-_]
URL's in html looks ugly and are larger than possible
The text was updated successfully, but these errors were encountered: