Integer Overflow or Wraparound Affecting cosmwasm-std package, versions >=1.3.0 <1.4.4>=1.5.0 <1.5.4>=2.0.0 <2.0.2


Severity

Recommended
0.0
low
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUST-COSMWASMSTD-6673770
  • published25 Apr 2024
  • disclosed24 Apr 2024
  • creditUnknown

Introduced: 24 Apr 2024

CVE NOT AVAILABLE CWE-190  (opens in a new tab)

How to fix?

Upgrade cosmwasm-std to version 1.4.4, 1.5.4, 2.0.2 or higher.

Overview

Affected versions of this package are vulnerable to Integer Overflow or Wraparound due to certain mathematical operations using wrapping math instead of panicking on overflow for very big numbers. This will be leading to incorrect calculations in contracts that utilize these operations.

Notes:

  1. Affected functions: Uint{256,512}::pow / Int{256,512}::pow / Int{256,512}::neg (the unary negation operator -). The only value that can overflow is Int{256,512}::MIN.

  2. If overflow-checks = true is not set: Uint{64,128}::pow / Int{64,128}::pow / Int{64,128}::neg (the unary negation operator -) will also be affected. The only value that can overflow is Int{64,128}::MIN.

CVSS Scores

version 3.1