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 "OWASP Java HTML Sanitizer Project"
From OWASP
(→Inline/Embedded Images) |
(→Inline/Embedded Images) |
||
Line 142: | Line 142: | ||
3) There are a number of things you can do in the matching part such as allow the following instead of just allowing data. | 3) There are a number of things you can do in the matching part such as allow the following instead of just allowing data. | ||
− | + | data:image/... | |
4) Since allowUrlProtocols("data") allows data URLs anywhere data URLs are allowed, you might want to also add a matcher to any other URL attributes that reject anything with a colon that does not start with http: or https: or mailto: | 4) Since allowUrlProtocols("data") allows data URLs anywhere data URLs are allowed, you might want to also add a matcher to any other URL attributes that reject anything with a colon that does not start with http: or https: or mailto: | ||
− | + | .allowAttributes("href") | |
− | + | .matching(...) | |
− | + | .onElements("a") | |
= Questions = | = Questions = |