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.0Not affected
16.0.0 – 16.4.2
45 releases, latest
Affected
5.0.0
1 release
Fixed
5.1.0
1 release
Affected
4.0.0 – 4.2.3
15 releases
Affected
3.0.1 – 3.2.3
11 releases
Affected
2.0.0 – 2.4.9
17 releases
Affected
1.0.0 – 1.2.3
10 releases
Not affected
0.1.0 – 0.4.1
23 releases
Affected
0.9.9 – 0.9.11
3 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
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.