# CVE-2021-39176: Missing Release of Memory after Effective Lifetime in detect-character-encoding

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.89%, higher than 80% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-08-31T18:05:12.000Z
- Modified: 2026-07-08T06:28:33.588Z
- Also known as: GHSA-5rwj-j5m3-3chj
- Weaknesses: CWE-401
- Assigned by: GitHub_M

## Description

detect-character-encoding is a package for detecting character encoding using ICU. In detect-character-encoding v0.3.0 and earlier, allocated memory is not released. The problem has been patched in detect-character-encoding v0.3.1.

(As written by CVE List.)

## Affected

- sonicdoe detect-character-encoding: < 0.3.1
- detect-character-encoding (npm): before 0.3.1
- detect-character-encoding_project detect-character-encoding: before 0.3.1

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:2.0 5.0 Medium `AV:N/AC:L/Au:N/C:N/I:N/A:P`

## References

- <https://github.com/sonicdoe/detect-character-encoding/security/advisories/GHSA-5rwj-j5m3-3chj> (exploit, patch, third-party-advisory, web)
- <https://github.com/sonicdoe/detect-character-encoding/pull/6> (issue-tracking, patch, third-party-advisory, web)
- <https://github.com/sonicdoe/detect-character-encoding/commit/d44356927b92e3b13e178071bf6d7c671766f588> (patch, third-party-advisory, web)
- <https://github.com/sonicdoe/detect-character-encoding/releases/tag/v0.3.1> (third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-39176> (advisory)
- <https://github.com/sonicdoe/detect-character-encoding> (package)

## Sources

- CVE List: [CVE-2021-39176](https://www.cve.org/CVERecord?id=CVE-2021-39176), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-5rwj-j5m3-3chj](https://github.com/advisories/GHSA-5rwj-j5m3-3chj), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2021-39176](https://nvd.nist.gov/vuln/detail/CVE-2021-39176), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-39176 · Whole record: https://cve.day/CVE-2021-39176.json · Rebuilt by cve.day 2026-11-25T22:58:03.586Z
