From 6c259b061a3dcb44c8bb997863643d8ae749b133 Mon Sep 17 00:00:00 2001 From: George Androutsopoulos <72753726+GeorgeAndrou@users.noreply.github.com> Date: Mon, 8 Sep 2025 05:10:32 -0400 Subject: [PATCH] Buffer Overflow in toodee DrainCol destructor (#2325) Co-authored-by: Georgios Androutsopoulos --- crates/toodee/RUSTSEC-0000-0000.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 crates/toodee/RUSTSEC-0000-0000.md diff --git a/crates/toodee/RUSTSEC-0000-0000.md b/crates/toodee/RUSTSEC-0000-0000.md new file mode 100644 index 00000000..42da37af --- /dev/null +++ b/crates/toodee/RUSTSEC-0000-0000.md @@ -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.