Junglewise Threat Intelligence

Databento dbn heap buffer overflow in c_chars_to_str

Severity: medium · CVSS 5.5 · Published 2024-10-09

Vendors: crates.io.

Executive brief

A vulnerability in the Databento Binary Encoding (DBN) library, which is used for processing financial market data, could allow an attacker to crash applications or potentially access sensitive information. The issue occurs when the library processes certain data strings that are not properly terminated, leading to memory errors. This could impact the reliability of data processing services or lead to unauthorized data exposure.

Technical details

A heap buffer overflow (specifically a buffer over-read) exists in the 'dbn' Rust crate due to unsafe handling of C-style strings. The 'c_chars_to_str' function utilizes 'CStr::from_ptr()', which expects a null-terminated string. If an input character array lacks a null terminator (\0), the underlying 'strlen()' call will read past the buffer's end. This can result in a crash (denial of service) or the leakage of sensitive memory contents. The vulnerability is fixed in version 0.22.1 by ensuring proper bounds checking or termination.

Affected products

  • Databento dbn <= 0.22.0

Timeline

  • 2024-10-09: disclosed
  • 2024-10-09: advisory
  • 2024-10-09: patched: Fixed in version 0.22.1

References