GHSA-pfr9-2p92-qrhq

Suggest an improvement
Source
https://github.com/advisories/GHSA-pfr9-2p92-qrhq
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-pfr9-2p92-qrhq/GHSA-pfr9-2p92-qrhq.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-pfr9-2p92-qrhq
Published
2024-10-09T14:34:24Z
Modified
2024-10-09T14:34:24Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
  • 6.8 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
Databento Binary Encoding (DBN) has a heap buffer overflow using c_chars_to_str function
Details

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 ccharsto_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

Affected packages

crates.io / dbn

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.22.0