Databento Binary Encoding (DBN) has a heap buffer overflow using c_chars_to_str function
Moderate severity
GitHub Reviewed
Published
Oct 9, 2024
to the GitHub Advisory Database
•
Updated Oct 9, 2024
Description
Published to the GitHub Advisory Database
Oct 9, 2024
Reviewed
Oct 9, 2024
Last updated
Oct 9, 2024
The
heap-buffer-overflow
is triggered in thestrlen()
function when handling thec_chars_to_str
function in the dbn crate. This vulnerability occurs because theCStr::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