Denial of Service condition in Next.js image optimization
Affected releases · next
- 14.x14.0.0 – 14.2.6Fixed in 14.2.7
- 13.x and older10.0.0 – 13.5.11No fix, no longer updated
On 14.x, the newest line:
npm install next@14.2.7Not affected
16.0.0 – 16.4.2
45 releases, latest
Affected
14.0.0 – 14.2.6
17 releases
Fixed
14.2.7 – 14.2.35
29 releases
Affected
13.0.0 – 13.5.11
56 releases
Affected
12.0.0 – 12.3.7
33 releases
Affected
11.0.0 – 11.1.4
7 releases
Affected
10.0.0 – 10.2.3
18 releases
Is your project affected?
Paste your package.json, or type the range you declare for next. It is read in your browser and sent nowhere.
What happens
Impact
The image optimization feature of Next.js contained a vulnerability which allowed for a potential Denial of Service (DoS) condition which could lead to excessive CPU consumption.
Not affected:
The
next.config.jsfile is configured withimages.unoptimizedset totrueorimages.loaderset to a non-default value.The Next.js application is hosted on Vercel.
Patches
This issue was fully patched in Next.js 14.2.7. We recommend that users upgrade to at least this version.
Workarounds
Ensure that the next.config.js file has either images.unoptimized, images.loader or images.loaderFile assigned.
Credits
Brandon Dahler (brandondahler), AWS Dimitrios Vlastaras