# GHSA-pfr9-2p92-qrhq: Databento Binary Encoding (DBN) has a heap buffer overflow using c_chars_to_str function

- Severity: Medium (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2024-10-07T12:00:00.000Z
- Modified: 2026-05-20T01:00:15.746Z
- Also known as: RUSTSEC-2024-0377
- Weaknesses: CWE-126

## Description

The `heap-buffer-overflow` is triggered in the `strlen()` function when handling the `c_chars_to_str` function in the dbn crate. This vulnerability occurs because the `CStr::from_ptr()` function in Rust assumes that the provided C string is null-terminated. However, there is no guarantee that the input chars array passed to the c_chars_to_str function is properly null-terminated.

If the chars array does not contain a null byte (\0), strlen() will continue to read beyond the bounds of the buffer in search of a null terminator. This results in an out-of-bounds memory read and can lead to a heap-buffer-overflow, potentially causing memory corruption or exposing sensitive information.

(As written by GitHub Advisory Database.)

## Affected

- dbn (crates.io): before 0.22.1; from 0.0.0-0 before 0.22.1-0

## Every score

- GitHub: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`

## References

- <https://github.com/databento/dbn/issues/67> (report, web)
- <https://github.com/databento/dbn/commit/339efb90fdb980920a5e8829008abc1114f4bfdd> (web)
- <https://github.com/databento/dbn> (package)
- <https://rustsec.org/advisories/RUSTSEC-2024-0377.html> (advisory, web)
- <https://crates.io/crates/dbn> (package)

## Sources

- GitHub Advisory Database: [GHSA-pfr9-2p92-qrhq](https://github.com/advisories/GHSA-pfr9-2p92-qrhq), CC-BY-4.0, modified 2026-05-20
- RustSec Advisory Database: [RUSTSEC-2024-0377](https://rustsec.org/advisories/RUSTSEC-2024-0377.html), CC0-1.0, modified 2025-10-28

---

Page: https://cve.day/GHSA-pfr9-2p92-qrhq · Whole record: https://cve.day/GHSA-pfr9-2p92-qrhq.json · Rebuilt by cve.day 2026-11-25T22:56:43.217Z
