Link to the code that reproduces this issue
GHSA-f88m-g3jw-g9cj
To Reproduce
- Create an empty folder and with the following
package.json:
{
"name": "next-sharp-audit-example",
"private": true,
"dependencies": {
"next": "16.2.11",
"react": "^19.0.0",
"react-dom": "^19.0.0"
}
}
- Install dependencies
- Inspect the resolved dependency tree
- Run an audit
Current vs. Expected behavior
Current
next@16.2.11 resolves sharp@0.34.5. Running npm audit reports GHSA-f88m-g3jw-g9cj.
Expected
A release should resolve a non-vulnerable sharp version or guidance should exist for a supported workaround.
Provide environment information
## Environment
- Next.js version: 16.2.11
- Node.js version: 22.x
- npm version: 10.x
- OS: macOS
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
No response
Link to the code that reproduces this issue
GHSA-f88m-g3jw-g9cj
To Reproduce
package.json:{ "name": "next-sharp-audit-example", "private": true, "dependencies": { "next": "16.2.11", "react": "^19.0.0", "react-dom": "^19.0.0" } }Current vs. Expected behavior
Current
next@16.2.11resolvessharp@0.34.5. Runningnpm auditreportsGHSA-f88m-g3jw-g9cj.Expected
A release should resolve a non-vulnerable
sharpversion or guidance should exist for a supported workaround.Provide environment information
## Environment - Next.js version: 16.2.11 - Node.js version: 22.x - npm version: 10.x - OS: macOSWhich area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
No response
Hi,
I do believe, that because
sharpis anoptionalDependencyit is through your package manager configs that it ends up installed, or not. You can take control of that with an override.This worked for the repo I am working with right now. I guess for
npm, oryarnit is slightly different.However, there seems to be issues in Vercel with that version, see lovell/sharp#4567. It seems fixed on canary though, which might justify patching 16.2.