Repository navigation
fix(security): Fix 11 security issues in next, sharp - #798
Closed
aikido-autofix[bot] wants to merge 1 commit into
Closed
aikido-autofix[bot] wants to merge 1 commit into
aikido-autofix[bot] wants to merge 1 commit into
Conversation
✅ Security Analysis ResultsNo security issues found. 3 files reviewed.
|
Collaborator
|
[BOT] Preview available with hash |
Author
|
Aikido's automated cron job opened a newer AutoFix. It fixes the same vulnerabilities and more: fix(security): Fix 10 security issues in next, sharp |
aikido-autofix
Bot
deleted the
fix/aikido-security-update-packages-158254451-aavi
branch
October 31, 2026 03:53
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 Next.js and Sharp to fix critical RCE vulnerabilities in image optimization (AVIF/libheif), memory corruption on glibc Linux, and high-severity SSRF, DoS, and deserialization issues. This update includes breaking changes that require manual migration.
Sharp - Node.js version requirement
Where your code is affected: The root
package.jsonspecifies"node": ">=18"(line 5), but sharp 0.35.0+ requires Node.js >= 20.9.0. Sharp is a transitive dependency of Next.js (visible inyarn.lock).Impact: The application will fail to install or run on Node.js 18.x, which is currently allowed by the project's engine requirements.
Remediation: Update the
engines.nodefield inpackage.jsonto">=20.9.0"to match sharp's new requirement and ensure all environments (CI/CD, production, development) use Node.js 20.9.0 or higher.All other breaking changes from both Next.js and sharp do not affect this codebase as they are not used:
No usage of
experimental.dynamicIO,experimental.strictNextHead,useMDXComponents,unstable_rootParams, AMP features, or direct sharp API callsNo synchronous access to
cookies()orheaders()at runtimeNo usage of deprecated sharp properties like
failOnError,paletteBitDepth, orformat.jp2kAll breaking changes by upgrading next from version 15.4.8 to 15.5.28 (CHANGELOG)
experimental.strictNextHead: #81882window.next.turbopackinstead: #82580All breaking changes by upgrading sharp from version 0.34.5 to 0.35.5 (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.✅ 11 CVEs resolved by this upgrade, including 2 critical 🚨 CVEs
This PR will resolve the following CVEs:
libheiflibrary used bysharpwhich Next.js uses for image optimization can lead to remote code execution when AVIF files are optimized.Until a fix has propagated, optimization of AVIF files is disabled.
DELETE/OPTIONSrequests allows attackers to bypass route restrictions and access unintended backend endpoints. An attacker could smuggle malicious requests to internal or admin routes through request boundary disagreement between proxy and backend.🤖 Remediation details
Bump
nextandsharpto resolve critical/high/medium security vulnerabilitiesShort summary
This PR remediates security vulnerabilities in two packages:
next(the direct dependency) andsharp(a transitive optional dependency pulled in bynext). Thenextversion was updated in both the rootpackage.json(devDependencies) and thepackages/demo-nextjsworkspace manifest (dependencies). Thesharpresolution was fixed automatically as a consequence of thenextbump. Bothyarn.lockand the two manifests were updated; noresolutionsoverrides were required.next
nextwas pinned exactly at15.4.8in two places: the rootpackage.jsondevDependencies and thepackages/demo-nextjs/package.jsonworkspace dependencies. Both pins were updated to15.5.28, the minimum release that satisfies every listed advisory's patched-version requirement across the full set of Next.js CVEs targeted by this task. Because the version was an exact pin (no caret or tilde), Yarn would never have resolved a newer release without an explicit manifest change; updating both manifests and runningyarn install --ignore-engines --ignore-scriptsfrom the repo root refreshed the lockfile to the patched release.sharp
sharpis not a direct dependency; it is pulled in as anoptionalDependencyofnext. Atnext@15.4.8the declared spec forsharpwas^0.34.3, which cannot resolve to0.35.5(a different minor series). Bumpingnextto15.5.28widened that spec to^0.34.3 || ^0.35.5, which allows Yarn to resolvesharpto0.35.5. No separate manifest entry orresolutionsoverride was needed; the lockfile entry forsharpupdated automatically during the sameyarn installrun that applied thenextbump.Version changes
next15.4.815.5.28package.jsonandpackages/demo-nextjs/package.jsonsharp0.34.50.35.5nextbump widened its declared spec