darylldoyle / svg-sanitizer

A PHP SVG/XML Sanitizer
GNU General Public License v2.0
456 stars 68 forks source link

Use whitelist to fix any issues with scripts/data embeds in href value #34

Closed darylldoyle closed 4 years ago

darylldoyle commented 4 years ago

We were previously using a regex to try and strip scripts from the href value by checking for a value starting in data: or containing script:. After a couple of bypasses were found, we've now locked this down and are only allowing values that start with one of the following: https://, http://, / or #. This will fix the issues flagged in #31.