No Charset in Content-Type Header in express
Published 23 Oct 2018 · Updated 8 Nov 2023
Is your project on an affected express?
Look after several JavaScript apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- <3.11.0
- Fixed in
- 3.11.0
npm install express@3.11.0- Affected
- >=4.0.0 <4.5.0
- Fixed in
- 4.5.0
npm install express@4.5.0Details
Vulnerable versions of express do not specify a charset field in the content-type header while displaying 400 level response messages. The lack of enforcing user's browser to set correct charset, could be leveraged by an attacker to perform a cross-site scripting attack, using non-standard encodings, like UTF-7.
Recommendation
For express 3.x, update express to version 3.11 or later. For express 4.x, update express to version 4.5 or later.
Is GHSA-gpvr-g6gh-9mc2 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 express, and gives you the command that fixes it.
More advisories for express
- MediumCVE-2024-10491Express ressource injection · 29 Oct 2024
- LowCVE-2024-9266Express Open Redirect vulnerability · 3 Oct 2024
- LowCVE-2024-43796express vulnerable to XSS via response.redirect() · 10 Sept 2024
- MediumCVE-2024-29041Express.js Open Redirect in malformed URLs · 25 Mar 2024
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.