Skip to content

Commit a4cabb7

Browse files
MJUCOMydongyeonShnatsel
authored
Dbn heap buffer overflow (#2097)
* Report Heap Buffer Overflow in dbn * Report Heap Buffer Overflow in dbn * Drop unrecognized field --------- Co-authored-by: ydongyeon <[email protected]> Co-authored-by: Sergey "Shnatsel" Davidoff <[email protected]>
1 parent a68ca4a commit a4cabb7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

crates/dbn/RUSTSEC-0000-0000.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
```toml
2+
[advisory]
3+
id = "RUSTSEC-0000-0000"
4+
package = "dbn"
5+
date = "2024-10-07"
6+
url = "https://github.com/databento/dbn/issues/67"
7+
categories = ["memory-corruption"]
8+
keywords = ["Heap-Buffer-Overflow"]
9+
10+
[versions]
11+
patched = ["> 0.22.0"]
12+
```
13+
# Heap Buffer overflow using c_chars_to_str function
14+
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.
15+
16+
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.
17+

0 commit comments

Comments
 (0)