# CVE-2021-39131: Improper Handling of Unexpected Data Type in ced

- 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-17T19:55:09.000Z
- Modified: 2026-07-08T06:28:22.894Z
- Also known as: GHSA-27wq-qx3q-fxm9
- Weaknesses: CWE-241, CWE-755
- Assigned by: GitHub_M

## Description

ced detects character encoding using Google’s compact_enc_det library. In ced v0.1.0, passing data types other than `Buffer` causes the Node.js process to crash. The problem has been patched in ced v1.0.0. As a workaround, before passing an argument to ced, verify it’s a `Buffer` using `Buffer.isBuffer(obj)`.

(As written by CVE List.)

## Affected

- sonicdoe ced: < 1.0.0
- ced (npm): before 1.0.0
- ced_project ced: 0.1.0

## 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: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/ced/security/advisories/GHSA-27wq-qx3q-fxm9> (exploit, patch, third-party-advisory, web)
- <https://github.com/sonicdoe/ced/commit/a4d9f10b6bf1cd468d1a5b9a283cdf437f8bb7b3> (patch, third-party-advisory, web)
- <https://github.com/sonicdoe/ced/releases/tag/v1.0.0> (release-notes, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-39131> (advisory)
- <https://github.com/sonicdoe/ced> (package)

## Sources

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

---

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