From 67981ca3091dd0793c320e8a749ec3c749131c17 Mon Sep 17 00:00:00 2001 From: Yaokun Zhang - nju <76199015+yaokunzhang@users.noreply.github.com> Date: Tue, 12 May 2026 22:29:11 +0800 Subject: [PATCH] Add advisory for trk-io: OOB read in ArraySequence Index --- crates/trk-io/RUSTSEC-0000-0000.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 crates/trk-io/RUSTSEC-0000-0000.md diff --git a/crates/trk-io/RUSTSEC-0000-0000.md b/crates/trk-io/RUSTSEC-0000-0000.md new file mode 100644 index 0000000000..02dfac2eb2 --- /dev/null +++ b/crates/trk-io/RUSTSEC-0000-0000.md @@ -0,0 +1,23 @@ +```toml +[advisory] +id = "RUSTSEC-0000-0000" +package = "trk-io" +date = "2026-05-02" +url = "https://github.com/imeka/trk-io/issues/24" +informational = "unsound" +categories = ["memory-corruption"] +keywords = ["out-of-bounds"] + +[versions] +patched = [] +``` + +# Out-of-bounds read in `ArraySequence` `Index` implementation + +The `Index` implementation for `ArraySequence` uses `get_unchecked(i)` and +`get_unchecked(i+1)` on `self.offsets` without validating bounds. An empty +`ArraySequence` (offsets = `[0]`, len() = 0) indexed at 0 calls +`get_unchecked(1)` which is out-of-bounds. + +This can be triggered through safe public APIs — `ArraySequence::empty()` +followed by `&seq[0]` — with no `unsafe` required from the caller. \ No newline at end of file