Advisory

RUSTSEC-2024-0338

Also known as: CVE-2024-58263, GHSA-8724-5xmm-w5xq

Summary

Arithmetic overflows in cosmwasm-std

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.

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

Severity

Not rated by the source.

Dates

Published
2024-04-24 12:00 UTC
Modified
2025-10-28 06:02 UTC

Affected packages and fixes

cosmwasm-std

crates.io · All systems

Affected

  • introduced 1.3.0, fixed 1.4.4, introduced 1.5.0, fixed 1.5.4, introduced 2.0.0, fixed 2.0.2 (semver)

Fixed versions

1.4.4, 1.5.4, 2.0.2

Fix

  • Fixed version 1.4.4
    cargo update -p cosmwasm-std --precise 1.4.4
  • Fixed version 1.5.4
    cargo update -p cosmwasm-std --precise 1.5.4
  • Fixed version 2.0.2
    cargo update -p cosmwasm-std --precise 2.0.2

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: RustSec Advisory Database · CC0-1.0

Sources & licences