# GHSA-PFR9-2P92-QRHQ: Databento Binary Encoding (DBN) has a heap buffer overflow using c\_chars\_to\_str function

- Database: GitHub
- Severity: medium (stated by ghsa, no CVSS score)
- Published: 2024-10-09
- Modified: 2026-05-20

## Also published as

- [RUSTSEC-2024-0377](https://cve.now/RUSTSEC-2024-0377.md) (RustSec)

## Affected versions

- dbn (crates.io): fixed in 0.22.1

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

## References

- https://github.com/databento/dbn/issues/67
- https://github.com/databento/dbn/commit/339efb90fdb980920a5e8829008abc1114f4bfdd
- https://github.com/databento/dbn
- https://rustsec.org/advisories/RUSTSEC-2024-0377.html

Page: https://cve.now/GHSA-PFR9-2P92-QRHQ

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
