vulnerabilities at scale with LLMs
A fuzzing campaign against Go's extended image packages found two out-of-memory bugs: a tiny crafted TIFF file with an extreme IFD offset, and a crafted font file with unchecked class counts, both causing multi-gigabyte allocations. An attacker could crash any Go process that decodes untrusted images or fonts.
blog.zsec.uk
Published on blog.zsec.uk
Recently I've had a week off my $dayjob so decided to actually write up some of my side projects and sort out various admin tasks, however writing about the 0day machine is something I've wanted todo for a number of weeks.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the decoder trusted size values read from the file (an offset and a product of two counts) and allocated buffers from them without capping against the real input size.
Impact
Any Go process handling untrusted images or fonts, such as web servers, chat platforms and CI pipelines, could be OOM-killed; the text notes WebP and GIF dimension allocations were confirmed as working-as-intended, so only TIFF and SFNT were affected.
What the attacker needed
Attacker supplies a crafted image or font; victim software decodes it with Go x/image
The fix
The fixes were merged: read and allocate in chunks capped to the input size, and validate the class count product against a maximum table length with bounds and overflow checks.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Some programs read image and font files sent in by users. These bugs let a very small, specially shaped file make the program try to reserve gigabytes of memory, so it runs out and crashes. That is a denial of service: the software stops working for everyone using it.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.