News for hackers. Stuff that matters.
Re:We pwned X, Vercel, Cursor, and Discord through a supply-... by css_apologist on Thursday December 18, 2025 @04:50PM (#46319285)
is santizing SVGs hard, or just everyone forgets they can contain js?
Re:We pwned X, Vercel, Cursor, and Discord through a supply-... by rslashuser on Thursday December 18, 2025 @06:11PM (#46320115)
I gather from the HN discussion that it's not simple to disable scripting in an SVG, in retrospect a tragically missing feature.

I guess the next step is to propose a simple "noscripting" attribute, which if present in the root of the SVG doc inhibits all scripting by conforming renderers. Then the renderer layer at runtime could also take a noscripting option, so the rendering context could force it if appropriate. Surely someone at HN is on this committee, so see what you can do!

Edit: thinking about it a little more - maybe it's best to just require noscripting as a parameter to the rendering function. Then the browsers can have a corresponding checkbox to control SVG scripting and that's it.

Re:We pwned X, Vercel, Cursor, and Discord through a supply-... by css_apologist on Thursday December 18, 2025 @06:47PM (#46320449)
its common to santize html string to parse it and remove/error on script tags (and other possible vulnerabilities)

i wonder do people not do this with svgs?

Re:We pwned X, Vercel, Cursor, and Discord through a supply-... by staticassertion on Thursday December 18, 2025 @10:36PM (#46322034)
Disabling script execution in svgs is very easy, it's just also easy to not realize you're about to embed an svg. `<img src="evil.svg">` will not execute scripts, a bit like your "noscripting" attribute except it's already around and works. Content Security Policy will prevent execution as well, you should be setting one for image endpoints that blocks scripts.

Sanitizing is hard to get right by comparison (svgs can reference other svgs) but it's still a good idea.

Re:We pwned X, Vercel, Cursor, and Discord through a supply-... by rslashuser on Friday December 19, 2025 @01:38AM (#46322879)
I had the impression from elsewhere in this thread that loading the svg in some other way, then you are not protected. This makes a no-brainer "don't run these ever" option in the browser seem appealing.
Re:We pwned X, Vercel, Cursor, and Discord through a supply-... by zahlman on Friday December 19, 2025 @03:52PM (#46330759)
> This makes a no-brainer "don't run these ever" option in the browser seem appealing.

Firefox has this: svg.disabled in about:config. It doesn't seem to be properly documented, and might cause other problems for the developer (I found it accidentally, and a more deliberate search turns up mainly bug tracker entries.)

Re:We pwned X, Vercel, Cursor, and Discord through a supply-... by AmbroseBierce on Thursday December 18, 2025 @05:19PM (#46319625)
User name checks out.
Re:We pwned X, Vercel, Cursor, and Discord through a supply-... by coolcoder613 on Friday December 19, 2025 @01:03AM (#46322700)
I believe the username is from the AI simulation of HN in 10 years.