Packages / next / Security

HighVulnerabilityGHSA-5vj8-3v2h-h38vPublished 4 Sep 2020

Remote Code Execution in next

Affected releases · next

  • 5.x5.0.0Fixed in 5.1.0
  • 4.x and older0.9.9 – 4.2.3No fix, no longer updated

On 5.x, the newest line:

npm install next@5.1.0
16.x
  1. Not affected

    16.0.0 – 16.4.2

    45 releases, latest

5.x
  1. Affected

    5.0.0

    1 release

  2. Fixed

    5.1.0

    1 release

4.x
  1. Affected

    4.0.0 – 4.2.3

    15 releases

3.x
  1. Affected

    3.0.1 – 3.2.3

    11 releases

2.x
  1. Affected

    2.0.0 – 2.4.9

    17 releases

1.x
  1. Affected

    1.0.0 – 1.2.3

    10 releases

0.x
  1. Not affected

    0.1.0 – 0.4.1

    23 releases

  2. Affected

    0.9.9 – 0.9.11

    3 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

Versions of next prior to 5.1.0 are vulnerable to Remote Code Execution. The /path: route fails to properly sanitize input and passes it to a require() call. This allows attackers to execute JavaScript code on the server. Note that prior version 0.9.9 package next npm package hosted a different utility (0.4.1 being the latest version of that codebase), and this advisory does not apply to those versions.

Recommendation

Upgrade to version 5.1.0.