CVE-2023-53156: transpose Buffer Overflow Due To Integer Vulnerability

MODERATE
Advisory Identifier: GHSA-5gmm-6m36-r7jh
CVSS 4.5
CWE-190 CWE-120
Published
Advisory Summary

CVE-2023-53156 is a MODERATE (CVSS 4.5) buffer overflow due to integer vulnerability (CWE-190: Integer Overflow or Wraparound) affecting transpose libraries in the crates.io ecosystem. The issue involves buffer overflow due to integer overflow. Remediation is available by upgrading affected packages to version 0.2.3.

CVE-2023-53156 at a Glance

CVE Identifier CVE-2023-53156
GHSA Identifier GHSA-5gmm-6m36-r7jh
Severity MODERATE
CVSS v3.1 Base Score 4.5
CWE Classification CWE-190: Integer Overflow or Wraparound
Affected Product transpose
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 4.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:L).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2023-53156

To remediate this vulnerability, upgrade all affected transpose dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

transpose fixed: 0.2.3
Upgrade transpose to 0.2.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for transpose

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-53156, inspect your project dependencies for transpose:

inspect dependencies for transpose

Analyze the terminal output to locate any version of transpose in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In transpose, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Given the function `transpose::transpose`: ```rust 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.

CVE-2023-53156 Affected transpose Versions

1 component(s)
Fixed Versions:
0.2.3
Product / Package Ecosystem Affected Versions Fixed Version
transpose
crates.io
≥ 0.1.0
< 0.2.3
0.2.3

References

Frequently Asked Questions

What is CVE-2023-53156?
CVE-2023-53156 is a security vulnerability in transpose involving Buffer overflow due to integer overflow under CWE-190: Integer Overflow or Wraparound.
Which transpose versions are affected?
Affected versions include releases prior to 0.2.3 across affected packages: transpose.
What version fixes CVE-2023-53156?
Upgrading to 0.2.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is transpose affected?
Yes, transpose is affected in releases prior to 0.2.3. Upgrade your dependency to 0.2.3 or later.
What is the CVSS score of CVE-2023-53156?
CVE-2023-53156 has a CVSS v3.1 base score of 4.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:L.
What CWE is associated with CVE-2023-53156?
CVE-2023-53156 is classified under CWE-190: Integer Overflow or Wraparound (The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.).
How can I check crates.io dependencies for CVE-2023-53156?
Run the dependency tree command: 'inspect dependencies for transpose'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5gmm-6m36-r7jh",
  "modified" : "2025-07-28T15:54:18Z",
  "published" : "2024-04-05T15:41:34Z",
  "aliases" : [ "CVE-2023-53156" ],
  "summary" : "transpose: Buffer overflow due to integer overflow",
  "details" : "Given the function `transpose::transpose`:\n```rust\nfn transpose<T: Copy>(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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "transpose"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "fixed" : "0.2.3"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-120", "CWE-190" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-05T15:41:34Z",
    "nvd_published_at" : null
  }
}