Packages / next / Security

ModerateVulnerabilityGHSA-g77x-44xx-532mCVE-2024-47831Published 14 Oct 2024

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.7
16.x
  1. Not affected

    16.0.0 – 16.4.2

    45 releases, latest

14.x
  1. Affected

    14.0.0 – 14.2.6

    17 releases

  2. Fixed

    14.2.7 – 14.2.35

    29 releases

13.x
  1. Affected

    13.0.0 – 13.5.11

    56 releases

12.x
  1. Affected

    12.0.0 – 12.3.7

    33 releases

11.x
  1. Affected

    11.0.0 – 11.1.4

    7 releases

10.x
  1. Affected

    10.0.0 – 10.2.3

    18 releases

423 stable releases of next, oldest to newest, one row per major.

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.js file is configured with images.unoptimized set to true or images.loader set 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