Skip to content

[Aikido] Fix 13 security issues in astro, sharp - #22

Open
aikido-autofix[bot] wants to merge 1 commit into
mainfrom
fix/aikido-security-update-packages-112434082-8w7k
Open

[Aikido] Fix 13 security issues in astro, sharp#22
aikido-autofix[bot] wants to merge 1 commit into
mainfrom
fix/aikido-security-update-packages-112434082-8w7k

Conversation

@aikido-autofix

@aikido-autofix aikido-autofix Bot commented Sep 12, 2026

Copy link
Copy Markdown

Upgrade Astro and Sharp to fix critical RCE vulnerabilities in image processing libraries when handling untrusted AVIF, GIF, TIFF, and VIPS images. This update includes breaking changes that require manual migration.

⚠️ Incomplete breaking changes analysis (1/2 analyzed)

⚠️ Breaking changes analysis not available for: astro

⚠️ The Astro upgrade from 5.18.1 to 7.2.8 contains breaking changes that affect this codebase:

1. Default compressHTML behavior change (Astro 7.0.0)

  • Where your code is affected: Throughout all .astro files in src/pages/ and src/layouts/ directories (e.g., src/pages/reference/metrics.astro, src/pages/reference/layers/*.astro, src/layouts/DocLayout.astro, src/layouts/BaseLayout.astro)

  • Impact: The codebase contains extensive use of whitespace between inline elements like <code>, <strong>, <em>, and <a> tags. With the new JSX-based whitespace stripping default, meaningful whitespace between these inline elements will be removed, potentially causing text to run together (e.g., "text code more text" could become "textcodemore text").

  • Remediation: Add compressHTML: false to astro.config.mjs to preserve all whitespace, or set compressHTML: true for HTML-aware compression that respects inline element spacing.

2. @astrojs/markdown-remark no longer installed by default (Astro 7.0.0)

  • Where your code is affected: The package is present in package-lock.json as a dependency but not explicitly listed in package.json dependencies

  • Impact: If the project relies on remark/rehype for Markdown processing (even indirectly through Astro), the new Sätteri processor may handle Markdown differently or the package may not be available after upgrade.

  • Remediation: Explicitly add @astrojs/markdown-remark to package.json dependencies and configure it as the Markdown processor in astro.config.mjs if remark/rehype processing is required.

Note on Sharp: While Sharp 0.35.4 is present as an optional dependency of Astro and has breaking changes (Node.js >= 20.9.0 requirement), it is not directly imported or used in the codebase, so this does not pose a direct risk unless the Node.js version is below 20.9.0.

All breaking changes by upgrading sharp from version 0.34.5 to 0.35.4 (CHANGELOG)

Version Description
0.35.0
Drop support for Node.js 18, now requires Node.js >= 20.9.0.
0.35.0
Remove install script from package.json file. Compiling from source is now opt-in via the build script.
0.35.0
Lossy AVIF output is now tuned using SSIMULACRA2-based iq quality metrics.
0.35.0
Add limitInputChannels with a default value of 5.
0.35.0
Remove deprecated failOnError constructor property.
0.35.0
Remove deprecated paletteBitDepth from metadata response.
0.35.0
Remove deprecated properties from sharpen operation.
0.35.0
Rename format.jp2k as format.jp2 for API consistency.
✅ 13 CVEs resolved by this upgrade, including 1 critical 🚨 CVE

This PR will resolve the following CVEs:

Issue Severity           Description
GHSA-26w7-cxv4-gfx2
🚨 CRITICAL
[astro] A vulnerability in the default Sharp image service allows remote code execution when processing malicious AVIF images. This affects projects where attackers can trigger image optimization of untrusted AVIF files.
AIKIDO-2026-10849
MEDIUM
[astro] Unescaped slot names in server-rendered hydrated components allow attackers to inject HTML/JavaScript into SSR responses, enabling reflected XSS attacks when user-controlled input is used as slot names.
CVE-2026-54299
MEDIUM
[astro] Astro SSR apps with prerendered error pages fetch them via HTTP using an unvalidated Host header, allowing attackers to redirect requests to arbitrary hosts and read responses, enabling information disclosure.
CVE-2026-84376
MEDIUM
[astro] A path traversal vulnerability allows attackers to bypass pathname-based middleware authorization by exploiting improper base path stripping that doesn't verify path-segment boundaries. An unauthenticated attacker could access protected routes by crafting requests with a manipulated path prefix.
CVE-2026-41067
MEDIUM
[astro] A case-sensitive regex in the defineScriptVars function fails to sanitize script tag closures, allowing attackers to bypass sanitization using case variations or whitespace (e.g., </Script>, </script >) to inject arbitrary HTML/JavaScript via the define:vars directive.
CVE-2026-45028
MEDIUM
[astro] Encryption replay vulnerability in server island props and slots allows attackers to swap encrypted values between components, potentially leading to XSS when props and slots share key names and attacker controls prop values.
CVE-2026-50146
MEDIUM
[astro] Unescaped slot names in client directives allow attackers to break out of data attributes and inject arbitrary HTML, enabling reflected XSS attacks during server-side rendering.
CVE-2026-54298
MEDIUM
[astro] A server-side rendering vulnerability in the spreadAttributes function fails to escape object keys when spreading props onto HTML elements, allowing attackers to inject arbitrary HTML attributes and event handlers when keys come from untrusted sources like APIs or URL parameters.
CVE-2026-73422
MEDIUM
[astro] Astro's View Transition CSS generator fails to escape animation properties, allowing attackers to inject arbitrary HTML and JavaScript through unvalidated animation values like duration or easing. This enables arbitrary code execution in the application's origin with access to sensitive data and authenticated actions.
CVE-2026-59729
MEDIUM
[astro] A second attribute-rendering path in renderHTMLElement() fails to validate spread attribute names, allowing XSS attacks through unescaped prop keys on native HTML element subclass components. This bypasses the fix for CVE-2026-54298 by interpolating attribute names without sanitization.
CVE-2026-59727
LOW
[astro] A reflected XSS vulnerability exists when transition directives on client-hydrated components fail to HTML-escape directive values, allowing attackers to inject arbitrary HTML/JavaScript if untrusted input is passed to these directives. The vulnerability requires developers to reflect attacker-controlled input into transition directives, enabling code execution in the rendered output.
GHSA-rgj7-g3m4-5g8c
HIGH
[sharp] Upstream libheif vulnerabilities can lead to remote code execution when processing untrusted AVIF images on glibc-based Linux systems. Affected versions prior to 0.35.4 should be upgraded immediately or AVIF decoding should be blocked.
GHSA-f88m-g3jw-g9cj
HIGH
[sharp] Multiple high-severity vulnerabilities in upstream libvips dependency allow remote code execution when processing untrusted image input (GIF, TIFF, VIPS formats).
🤖 Remediation details

Fix critical and high-severity vulnerabilities in astro and sharp

Short summary

This PR remediates multiple security vulnerabilities affecting two npm packages: astro (the direct dependency declared in the root package.json) and sharp (a transitive optional dependency pulled in by astro). The fix updates the declared version spec for astro in package.json and refreshes package-lock.json to resolve both packages to patched versions.

astro

astro is a direct dependency in the root package.json, previously declared as ^5.7.10 and resolved to 5.18.1. Eleven advisories across the 6.x and 7.x lines required a minimum resolved version of 7.2.8, so the declared spec was updated to ^7.2.8 and npm install --package-lock-only was run to resolve it to 7.3.2 (the latest compatible release). This is a semver-major bump, but it is the smallest change that satisfies all patched-version floors across the full advisory set.

sharp

sharp is a transitive optional dependency introduced by astro, previously resolved to 0.34.5. Two advisories require sharp >= 0.35.0 and >= 0.35.4 respectively. Under astro@5.x, the declared range for sharp was ^0.34.0, which cannot satisfy 0.35.x. Bumping astro to 7.x caused it to declare sharp as ^0.35.4, allowing npm to resolve sharp to 0.35.4 without any override. No separate manifest edit was needed for sharp; the parent bump was sufficient.

Version changes

Package From To Why updated
astro ^5.7.10 (resolved 5.18.1) ^7.2.8 (resolved 7.3.2) Direct CVE fix; semver-major bump required to satisfy all patched-version floors
sharp 0.34.5 0.35.4 Transitive CVE fix after parent bump (astro); new parent declares ^0.35.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants