CVE-2021-39157
JavaScript vulnerability analysis and mitigation

Overview

detect-character-encoding is an open source character encoding inspection library that was found to have a vulnerability (CVE-2021-39157) in versions 0.6.0 and earlier. The vulnerability was discovered and disclosed on August 24, 2021, affecting the library's core functionality when handling data that doesn't match any charset (GitHub Advisory).

Technical details

The vulnerability is classified as an Improper Handling of Exceptional Conditions (CWE-755). When the library encounters data that doesn't match any charset, it fails to properly handle the null return value from the underlying ICU library's ucsdet_detect() function, leading to a segmentation fault. The vulnerability has a CVSS v3.1 base score of 7.5 (High) and a temporal score of 7.2, indicating significant severity (GitHub Advisory).

Impact

When exploited, this vulnerability causes the Node.js process to crash, resulting in a denial of service condition. The impact is particularly severe in network-facing applications that accept untrusted input and pass it directly to detect-character-encoding (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in detect-character-encoding version 0.7.0. The fix involves properly handling the null return value from ucsdet_detect() by returning null instead of attempting to access properties of the null object. Users should upgrade to version 0.7.0 or later to resolve this issue (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66456CRITICAL9.1
  • JavaScriptJavaScript
  • elysia
NoYesDec 09, 2025
CVE-2025-66457HIGH7.5
  • JavaScriptJavaScript
  • elysia
NoYesDec 09, 2025
CVE-2025-65849MEDIUM6.9
  • JavaScriptJavaScript
  • altcha
NoNoDec 08, 2025
CVE-2025-66202MEDIUM6.5
  • JavaScriptJavaScript
  • astro
NoYesDec 09, 2025
CVE-2025-66479LOW1.8
  • JavaScriptJavaScript
  • @anthropic-ai/sandbox-runtime
NoYesDec 04, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management