From b5f70a875bf67d7704b94f742f354ad1c1b27526 Mon Sep 17 00:00:00 2001 From: Yaokun Zhang - nju <76199015+yaokunzhang@users.noreply.github.com> Date: Tue, 12 May 2026 22:29:08 +0800 Subject: [PATCH] Add advisory for sfbinpack: OOB read via BitReader --- crates/sfbinpack/RUSTSEC-0000-0000.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 crates/sfbinpack/RUSTSEC-0000-0000.md diff --git a/crates/sfbinpack/RUSTSEC-0000-0000.md b/crates/sfbinpack/RUSTSEC-0000-0000.md new file mode 100644 index 0000000000..b0953aa177 --- /dev/null +++ b/crates/sfbinpack/RUSTSEC-0000-0000.md @@ -0,0 +1,24 @@ +```toml +[advisory] +id = "RUSTSEC-0000-0000" +package = "sfbinpack" +date = "2026-05-02" +url = "https://github.com/Disservin/binpack-rust/issues/17" +informational = "unsound" +categories = ["memory-corruption"] +keywords = ["out-of-bounds"] + +[versions] +patched = [] +``` + +# Out-of-bounds read via `BitReader` in `CompressedTrainingDataEntryReader` + +`CompressedTrainingDataEntryReader` constructs a `BitReader` from a raw +pointer without tracking length. A crafted chunk with `num_plies > 0` but no +movetext bytes triggers out-of-bounds reads via the `BitReader`, which uses +`*self.movetext.add(self.read_offset)` without bounds checks. + +This can be triggered through safe public APIs — +`CompressedTrainingDataEntryReader::new()` and `.next()` — with no `unsafe` +required from the caller. \ No newline at end of file