Advisory

GHSA-5gmm-6m36-r7jh

Also known as: CVE-2023-53156, RUSTSEC-2023-0080

Summary

transpose: Buffer overflow due to integer overflow

Details

Given the function transpose::transpose:

fn transpose<T: Copy>(input: &[T], output: &mut [T], input_width: usize, input_height: usize)

The 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().
As 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.

Exploiting 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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2024-04-05 15:41 UTC
Modified
2025-07-28 16:42 UTC

Affected packages and fixes

transpose

crates.io · All systems

Affected

  • introduced 0.1.0, fixed 0.2.3 (semver)

Fixed versions

0.2.3

Fix

  • Fixed version 0.2.3
    cargo update -p transpose --precise 0.2.3

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences