6/20/2026 at 6:30:51 AM
Instead of going via pixels, why not use a SVG favicon and directly store markup inside it and extract it?Use this favicon.svg:
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50%" fill="orange"/>
<p>hello HN!</p>
</svg>
use this in your <head> to use a svg favicon: <link id="favicon" rel="icon" href="favicon.svg" type="image/svg+xml">
finally, use this in your <body> to extract it and add it to your document body: <script>
fetch(favicon.href).then(r => r.text()).then(t => document.body.innerHTML += t.match(/<p[\s\S]*p>/)[0]);
</script>
by Tepix
6/20/2026 at 9:22:45 AM
Regular expressions? Ugh. Encode it properly as XML in the correct namespace, load it so, and take it from that.Or just serve the SVG file and use <foreignObject> to embed the HTML, and include <link rel="icon" href=""> inside it. In theory you should be able to define a <view id="icon"> and use <link rel="icon" href="#icon">, but in practice neither Firefox nor Chromium seems to be handling that properly in a favicon, which is disappointing.
by chrismorgan
6/20/2026 at 6:53:14 AM
Hey, yeah, I wrote the article. This (of course) would be more practical. Thanks for pointing it out. I wanted the payload to "live" in actual pixel data rather than hidden text inside an XML file. That’s why I went this way :)by weetii
6/20/2026 at 6:54:47 AM
The ico file format allows multiple resolution icons, so a lot of databy peter-m80
6/20/2026 at 6:59:19 AM
Good point, I might add a section in the article where I list alternative approaches. Thanksby weetii
6/20/2026 at 8:32:39 AM
An SVG can embed raster images: base64 encoded bytes.So you could layer this experiment: favicon is svg, that contains encoded raster, whose bytes are encoded html.
At the very least it would make a mindboggling CTF step.
by berkes