GHSA-pfr9-2p92-qrhq Databento Binary Encoding (DBN) has a heap buffer overflow using c_chars_to_str function
- Published
- Updated
- Exploit status
- No public exploit known
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.
Upgrade path
1 package: 1 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| crates.io dbn(crates.io) | < 0.22.1; <= 0.22.0; >= 0.0.0-0, < 0.22.1-0 | 0.22.1, 0.22.1-0 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| crates.io dbn(crates.io) | < 0.22.1 | 0.22.1 |
| crates.io dbn(crates.io) | >= 0.0.0-0, < 0.22.1-0 | 0.22.1-0 |
| crates.io dbn(crates.io) | <= 0.22.0 | No fix listed |
References
- github.com issue-tracking
- github.com patch
- github.com product
- rustsec.org vendor-advisory
- crates.io product
- github.com