Astro: Remote code execution through AVIF image optimizationGHSA-26w7-cxv4-gfx2
CRITICALFix: withastro/astro@ecb4082GHSA-26w7-cxv4-gfx2 is a critical-severity (CVSS 9.8) remote code execution vulnerability in astro. A fix is available for astro — see the affected versions and patch details below.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
astronpmDescription
A vulnerability in libheif, used by the default Sharp image service in Astro, can lead to remote code execution when a malicious AVIF image is optimized.
Projects are affected when an attacker can cause Astro to process an untrusted AVIF image.
The fix was released in Astro 7.2.8, which requires Sharp 0.35.4.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | astro | all versions | 7.2.8npm install astro@7.2.8 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for astro, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update astro to 7.2.8 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-26w7-cxv4-gfx2 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is GHSA-26w7-cxv4-gfx2 in your dependencies?
Find it across npm, including transitive dependencies.