CVE-2024-58263: Cosmwasm std CosmWasm Affected By Arithmetic Overflows Vulnerability

LOW
Advisory Identifier: GHSA-8724-5xmm-w5xq
CVSS 3.7
CWE-190
Published
Advisory Summary

CVE-2024-58263 is a LOW (CVSS 3.7) cosmwasm affected by arithmetic overflows vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Cosmwasm std libraries in the crates.io ecosystem. The issue involves cosmwasm affected by arithmetic overflows. Remediation is available by upgrading affected packages to version 1.4.4, 1.5.4, 2.0.2.

CVE-2024-58263 at a Glance

CVE Identifier CVE-2024-58263
GHSA Identifier GHSA-8724-5xmm-w5xq
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-190: Integer Overflow or Wraparound
Affected Product Cosmwasm std
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 3.7

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

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

How to Fix CVE-2024-58263

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

cosmwasm-std fixed: 1.4.4
Upgrade cosmwasm-std to 1.4.4
cosmwasm-std fixed: 1.5.4
Upgrade cosmwasm-std to 1.5.4
cosmwasm-std fixed: 2.0.2
Upgrade cosmwasm-std to 2.0.2
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 cosmwasm-std

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-58263, inspect your project dependencies for Cosmwasm std:

inspect dependencies for cosmwasm-std

Analyze the terminal output to locate any version of Cosmwasm std in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.4), 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 Cosmwasm std, 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

Some mathematical operations in `cosmwasm-std` use wrapping math instead of panicking on overflow for very big numbers. This can lead to wrong calculations in contracts that use these operations. Affected functions: - `Uint{256,512}::pow` / `Int{256,512}::pow` - `Int{256,512}::neg` Affected if `overflow-checks = true` is not set: - `Uint{64,128}::pow` / `Int{64,128}::pow` - `Int{64,128}::neg`

CVE-2024-58263 Affected Cosmwasm std Versions

3 component(s)
Fixed Versions:
1.4.41.5.42.0.2
Product / Package Ecosystem Affected Versions Fixed Version
cosmwasm-std
crates.io
≥ 1.3.0
< 1.4.4
1.4.4
cosmwasm-std
crates.io
≥ 1.5.0
< 1.5.4
1.5.4
cosmwasm-std
crates.io
≥ 2.0.0
< 2.0.2
2.0.2

References

Frequently Asked Questions

What is CVE-2024-58263?
CVE-2024-58263 is a security vulnerability in Cosmwasm std involving CosmWasm affected by arithmetic overflows under CWE-190: Integer Overflow or Wraparound.
Which Cosmwasm std versions are affected?
Affected versions include releases prior to 1.4.4, 1.5.4, 2.0.2 across affected packages: cosmwasm-std.
What version fixes CVE-2024-58263?
Upgrading to 1.4.4, 1.5.4, 2.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cosmwasm-std affected?
Yes, cosmwasm-std is affected in releases prior to 1.4.4, 1.5.4, 2.0.2. Upgrade your dependency to 1.4.4, 1.5.4, 2.0.2 or later.
What is the CVSS score of CVE-2024-58263?
CVE-2024-58263 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2024-58263?
CVE-2024-58263 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-2024-58263?
Run the dependency tree command: 'inspect dependencies for cosmwasm-std'. 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-8724-5xmm-w5xq",
  "modified" : "2025-07-28T15:52:31Z",
  "published" : "2024-04-24T17:37:59Z",
  "aliases" : [ "CVE-2024-58263" ],
  "summary" : "CosmWasm affected by arithmetic overflows",
  "details" : "Some mathematical operations in `cosmwasm-std` use wrapping math instead of panicking on overflow for very big numbers. This can lead to wrong calculations in contracts that use these operations.\n\nAffected functions:\n\n- `Uint{256,512}::pow` / `Int{256,512}::pow`\n- `Int{256,512}::neg`\n\nAffected if `overflow-checks = true` is not set:\n\n- `Uint{64,128}::pow` / `Int{64,128}::pow`\n- `Int{64,128}::neg`",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "cosmwasm-std"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.3.0"
      }, {
        "fixed" : "1.4.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "cosmwasm-std"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.0"
      }, {
        "fixed" : "1.5.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "cosmwasm-std"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-58263"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/CosmWasm/cosmwasm/commit/607e7fc710fb9441096e8edbaa12879b552c8f65"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/CosmWasm/cosmwasm/commit/a6a639e09adc355b5f889a09141649005cb08a46"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/CosmWasm/cosmwasm/commit/eff79bcbe73b61178817aacf0a6449437adad6a9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/CosmWasm/advisories/blob/main/CWAs/CWA-2024-002.md"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/CosmWasm/cosmwasm"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2024-0338.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-190" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-24T17:37:59Z",
    "nvd_published_at" : null
  }
}