News for hackers. Stuff that matters.
Re:CSS in GitHub Readmes by chrismorgan on Tuesday December 08, 2020 @01:57PM (#25349805)
When you load an SVG file as an image, JavaScript is not executed, but SMIL animations and CSS (which includes animations) are.

If you open the SVG file directly, then JavaScript will be executed. But any hosting platforms that hosts your content on their domain should filter out any JavaScript on SVG as it would on HTML.

Re:CSS in GitHub Readmes by inetknght on Tuesday December 08, 2020 @02:13PM (#25349970)
> But any hosting platforms that hosts your content on their domain should filter out any JavaScript on SVG as it would on HTML.

That's definitely not a thing that happens. Web servers just serve the file as-is.

Re:CSS in GitHub Readmes by mormegil on Tuesday December 08, 2020 @02:18PM (#25350017)
The point is they either need to filter the served content, or serve it from a different domain (e.g. githubusercontent.com), otherwise you have XSS-like problems.
Re:CSS in GitHub Readmes by michaelmior on Tuesday December 08, 2020 @02:29PM (#25350152)
My understanding is that things like this are one of the reasons GitHub moved GitHub Pages subdomains from github.com to github.io.
Re:CSS in GitHub Readmes by felixfbecker on Tuesday December 08, 2020 @03:22PM (#25350820)
GitHub raw endpoints do it. They will either serve the SVG without an image/svg+xml Content-Type, making it not render in the browser, or you have to append ?sanitize=true to the URL which will, as the name suggest, sanitize it.
Re:CSS in GitHub Readmes by reflectiv on Wednesday December 09, 2020 @10:20PM (#25369240)
ok but that is github...parent poster stated its common to do that...it is not.
Re:CSS in GitHub Readmes by detaro on Wednesday December 09, 2020 @11:13PM (#25369617)
It's web security 101 for handling user uploads. (although in the case of SVG most sites solve it by just not accepting "weird" formats like SVG)
Re:CSS in GitHub Readmes by Kiro on Tuesday December 08, 2020 @02:43PM (#25350319)