Executive brief
Astro, a popular web framework for building content-driven websites, contains a remote code execution vulnerability in its default image optimization service. An attacker who can upload or cause the server to process a specially crafted AVIF image file can execute arbitrary code on the server. This affects any Astro project that processes untrusted images, potentially leading to complete system compromise and data theft.
Technical details
The vulnerability is a heap buffer overflow (CWE-787 / CWE-125) in libheif's scale_nearest_neighbor() function, triggered by a chain of four behaviors in HEIF/AVIF image processing. A crafted AVIF file with nested iden (identity-derivation) and auxl (auxiliary) item references causes duplicate Alpha planes in the decoded image to be created with different bit depths (8-bit and 10-bit). The scaler allocates a destination Alpha buffer using only the first plane's bit depth (8-bit), then iterates over all source planes. When writing a 10-bit Alpha plane using uint16_t pointers into an 8-bit allocation, it writes twice as many bytes as allocated, causing a controlled overflow. The attack requires the application to process an untrusted AVIF image—no authentication or special API options are needed. Astro versions prior to 7.2.8 are affected through their dependency on vulnerable versions of Sharp. The fix was released in Astro 7.2.8, which requires Sharp 0.35.4 or later.
Affected products
- The Astro Project Astro < 7.2.8
Timeline
- 2026-09-08: disclosed: GHSA-26w7-cxv4-gfx2 published
- 2026-08-26: patched: Astro 7.2.8 released with Sharp 0.35.4
References
- https://github.com/strukturag/libheif/security/advisories/GHSA-g89c-p67h-r497
- https://github.com/withastro/astro/security/advisories/GHSA-26w7-cxv4-gfx2
- https://github.com/withastro/astro/commit/ecb4082131490b4fe9a56aa44fda84b54ef8967b
- https://github.com/withastro/astro
- https://github.com/withastro/astro/releases/tag/astro@7.2.8