Emacs -- Heap out-of-bounds write when rendering SVG images
Problem Description When GNU Emacs renders an SVG image whose image spec includes a :css property, an off-by-one error in svg_load_image() writes a NUL byte one position past the end of a heap allocation. The copied string is also left without NUL termination within its allocation, causing a subsequent out-of-bounds read. Impact A single NUL byte heap overflow is a well-understood exploitation primitive ("poison NUL …
Affected versions
- emacs, emacs-canna, emacs-nox, emacs-wayland >= 28.1,3 < 30.2_4,3
- emacs-devel, emacs-devel-nox < 31.0.50.20250201,3
By system
1 still vulnerable, 3 fixed. Where VuXML applies (FreeBSD, DragonFly, FreeBSD's derivatives) a port is vulnerable while its version is in a range; pkgsrc says itself whether it lists a CVE of this advisory; OpenBSD and MidnightBSD keep no list this site reads, so their row is only an estimate: FreeBSD's ranges applied to upstream's version.
| System | Port | Version | State | Fixed |
|---|---|---|---|---|
| DragonFly | editors/emacs | 30.1_2,3 | vulnerable since 2026-07-06 | |
| OpenBSD | editors/emacs | 31.1-gtk3 | out of range, by version | |
| NetBSD | editors/emacs | 30.2 | not listed | |
| MidnightBSD | editors/emacs | 31.1_5,3 | out of range, by version | |
| FreeBSD | editors/emacs | 31.1_3,3 | fixed | (33 days after) |
| DragonFly | editors/emacs-devel | 31.0.50.20250315_1,3 | fixed | |
| MidnightBSD | editors/emacs-devel | 31.0.50.20250515_4,3 | out of range, by version | |
| FreeBSD | editors/emacs-devel | 32.0.50.20261019,3 | fixed | (12 days after) |