Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. transpose
  4. ›
  5. CVE-2023-53156

CVE-2023-53156: transpose: Buffer overflow due to integer overflow

April 5, 2024 (updated July 28, 2025)

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.

References

  • github.com/advisories/GHSA-5gmm-6m36-r7jh
  • github.com/ejmahler/transpose
  • github.com/ejmahler/transpose/commit/c4bcd39fabca9a31a401d0cc42d4090869b5a37a
  • github.com/ejmahler/transpose/issues/11
  • nvd.nist.gov/vuln/detail/CVE-2023-53156
  • rustsec.org/advisories/RUSTSEC-2023-0080.html

Code Behaviors & Features

Detect and mitigate CVE-2023-53156 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.1.0 before 0.2.3

Fixed versions

  • 0.2.3

Solution

Upgrade to version 0.2.3 or above.

Impact 4.5 MEDIUM

CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:L

Learn more about CVSS

Weakness

  • CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
  • CWE-190: Integer Overflow or Wraparound

Source file

cargo/transpose/CVE-2023-53156.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 19 Aug 2025 12:18:50 +0000.