{"id":"GHSA-5gmm-6m36-r7jh","summary":"transpose: Buffer overflow due to integer overflow","details":"Given the function `transpose::transpose`:\n```rust\nfn transpose\u003cT: Copy\u003e(input: &[T], output: &mut [T], input_width: usize, input_height: usize)\n```\n\nThe safety check `input_width * input_height == output.len()` can fail due to `input_width * input_height` overflowing in such a way that it equals `output.len()`.\nAs a result of failing the safety check, memory past the end of `output` is written to. This only occurs in release mode since `*` panics on overflow in debug mode.\n\nExploiting this issue requires the caller to pass `input_width` and `input_height` arguments such that multiplying them overflows, and the overflown result equals the lengths of input and output slices.","aliases":["CVE-2023-53156","RUSTSEC-2023-0080"],"modified":"2025-07-28T16:42:04.676549Z","published":"2024-04-05T15:41:34Z","database_specific":{"github_reviewed_at":"2024-04-05T15:41:34Z","nvd_published_at":null,"cwe_ids":["CWE-120","CWE-190"],"severity":"MODERATE","github_reviewed":true},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-53156"},{"type":"WEB","url":"https://github.com/ejmahler/transpose/issues/11"},{"type":"WEB","url":"https://github.com/ejmahler/transpose/commit/c4bcd39fabca9a31a401d0cc42d4090869b5a37a"},{"type":"PACKAGE","url":"https://github.com/ejmahler/transpose"},{"type":"WEB","url":"https://rustsec.org/advisories/RUSTSEC-2023-0080.html"}],"affected":[{"package":{"name":"transpose","ecosystem":"crates.io","purl":"pkg:cargo/transpose"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.1.0"},{"fixed":"0.2.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/04/GHSA-5gmm-6m36-r7jh/GHSA-5gmm-6m36-r7jh.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:L"}]}