Remote Code Execution in next
Published 4 Sept 2020 · Updated 28 Apr 2022
Affected package
- Affected
- >=0.9.9 <5.1.0
- Fixed in
- 5.1.0
npm install next@5.1.0Details
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.
Is GHSA-5vj8-3v2h-h38v in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected next, and gives you the command that fixes it.
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.