[Aikido] Fix 13 security issues in astro, sharp - #22
Open
aikido-autofix[bot] wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
1. Default
compressHTMLbehavior change (Astro 7.0.0)Where your code is affected: Throughout all
.astrofiles insrc/pages/andsrc/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., "textcodemore text" could become "textcodemore text").Remediation: Add
compressHTML: falsetoastro.config.mjsto preserve all whitespace, or setcompressHTML: truefor HTML-aware compression that respects inline element spacing.2.
@astrojs/markdown-remarkno longer installed by default (Astro 7.0.0)Where your code is affected: The package is present in
package-lock.jsonas a dependency but not explicitly listed inpackage.jsondependenciesImpact: 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-remarktopackage.jsondependencies and configure it as the Markdown processor inastro.config.mjsif 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)
installscript frompackage.jsonfile. Compiling from source is now opt-in via thebuildscript.iqquality metrics.limitInputChannelswith a default value of 5.failOnErrorconstructor property.paletteBitDepthfrommetadataresponse.sharpenoperation.format.jp2kasformat.jp2for API consistency.✅ 13 CVEs resolved by this upgrade, including 1 critical 🚨 CVE
This PR will resolve the following CVEs:
🤖 Remediation details
Fix critical and high-severity vulnerabilities in
astroandsharpShort summary
This PR remediates multiple security vulnerabilities affecting two npm packages:
astro(the direct dependency declared in the rootpackage.json) andsharp(a transitive optional dependency pulled in byastro). The fix updates the declared version spec forastroinpackage.jsonand refreshespackage-lock.jsonto resolve both packages to patched versions.astro
astrois a direct dependency in the rootpackage.json, previously declared as^5.7.10and resolved to5.18.1. Eleven advisories across the6.xand7.xlines required a minimum resolved version of7.2.8, so the declared spec was updated to^7.2.8andnpm install --package-lock-onlywas run to resolve it to7.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
sharpis a transitive optional dependency introduced byastro, previously resolved to0.34.5. Two advisories requiresharp >= 0.35.0and>= 0.35.4respectively. Underastro@5.x, the declared range forsharpwas^0.34.0, which cannot satisfy0.35.x. Bumpingastroto7.xcaused it to declaresharpas^0.35.4, allowing npm to resolvesharpto0.35.4without any override. No separate manifest edit was needed forsharp; the parent bump was sufficient.Version changes
astro^5.7.10(resolved5.18.1)^7.2.8(resolved7.3.2)sharp0.34.50.35.4astro); new parent declares^0.35.4