CVE-2021-39157 Improper Handling of Exceptional Conditions in detect-character-encoding
An attacker can crash the Node.js process by providing data that matches no charset, requiring users to upgrade the library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-39157?
CVE-2021-39157 is a high-severity denial of service vulnerability in sonicdoe detect-character-encoding, published on 24 Aug 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
detect-character-encoding is an open source character encoding inspection library. In detect-character-encoding v0.6.0 and earlier, data matching no charset causes the Node.js process to crash. The problem has been patched in [detect-character-encoding v0.7.0](https://github.com/sonicdoe/detect-character-encoding/releases/tag/v0.7.0). No workaround are available and all users should update to resolve this issue.
Weakness: CWE-755
Which versions are affected by CVE-2021-39157?
2 open source packages ship an affected version, including detect-character-encoding. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
detect-character-encoding npm | All versions | 0.7.0 |
detect-character-encoding npm | All versions | 0.7.0 |
Products include Detect-Character-Encoding Project Detect-Character-Encoding.
How do I fix CVE-2021-39157?
Upgrade detect-character-encoding to 0.7.0 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2021-39157 being exploited?
There is no known exploitation of CVE-2021-39157 in the wild and no public exploit code.
Other vulnerabilities in sonicdoe detect-character-encoding
Sources
Also known as GHSA-jqfh-8hw5-fqjr.