Buffer Overflow in toodee DrainCol destructor (#2325)

Co-authored-by: Georgios Androutsopoulos <georgeandrout@gamac.local>
This commit is contained in:
George Androutsopoulos
2025-09-08 05:10:32 -04:00
committed by GitHub
parent 990d59460b
commit 6c259b061a

View File

@@ -0,0 +1,30 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "toodee"
date = "2025-05-22"
url = "https://github.com/antonmarsden/toodee/issues/26"
categories = ["memory-corruption", "memory-exposure"]
keywords = ["memory-safety", "buffer-overflow"]
[versions]
patched = [">= 0.6.0"]
unaffected = ["< 0.2.0"]
[affected.functions]
"toodee::DrainCol::drop" = [">= 0.2.0, <= 0.5.0"]
```
# Heap Buffer Overflow in the DrainCol Destructor
An off-by-one error in the `DrainCol::drop` destructor could cause an unsafe memory copy
operation to exceed the bounds of the associated vector.
The error was related to the size of the data being copied in one of the `ptr::copy`
invocations inside the destructor.
When removing the first column from a TooDee object, the DrainCol return object could cause
a heap buffer overflow vulnerability when it is dropped.
The issue was fixed in commit `e6e16d5` by reducing the copied size by one.