Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-xgr7-jgq3-mhmc

Опубликовано: 06 июн. 2024
Источник: github
Github: Прошло ревью
CVSS3: 7.5

Описание

Contract balance not updating correctly after interchain transaction

Summary

Short summary of the problem. Make the impact and severity as clear as possible. For example: An unsafe deserialization vulnerability allows any unauthenticated user to execute arbitrary code on the server.

Details

We discovered a bug walking through how to liquid stake using Safe which itself is a contract. The bug only appears when there is a local state change together with an ICS20 transfer in the same function and uses the contract's balance, that is using the contract address as the sender parameter in an ICS20 transfer using the ICS20 precompile

Proof of Concept

// This function does not reduce the contract balance correctly but liquid stakes correctly function transfer( string memory sourcePort, string memory sourceChannel, string memory denom, uint256 amount, string memory receiver, string memory evmosReceiver ) external returns (uint64 nextSequence) { counter += 1; # Only happens when there is a local state update together with an ICS20 Transfer Height memory timeoutHeight = Height(100, 100); string memory memo = buildLiquidStakeMemo(receiver, evmosReceiver); return ICS20_CONTRACT.transfer( sourcePort, sourceChannel, denom, amount, address(this), # this is the sender address which is the contract receiver, timeoutHeight, 0, memo ); }

Impact

This is in essence the "infinite money glitch" allowing contracts to double the supply of Evmos after each transaction.

Severity

Based on ImmuneFi Severity Classification System the severity was evaluated to Critical since the attack could have lead to create new supply of EVMOS and therefore lead to Direct loss of funds's value.

Patches

The issue has been patched in versions >=V18.1.0.

For more information

If you have any questions or comments about this advisory:

Reach out to the Core Team in Discord Open a discussion in evmos/evmos Email us at security@evmos.org for security questions

Пакеты

Наименование

github.com/evmos/evmos/v18

go
Затронутые версииВерсия исправления

<= 18.0.0

18.1.0

Наименование

github.com/evmos/evmos/v17

go
Затронутые версииВерсия исправления

<= 17.0.1

18.1.0

Наименование

github.com/evmos/evmos/v16

go
Затронутые версииВерсия исправления

<= 16.0.4

18.1.0

Наименование

github.com/evmos/evmos/v15

go
Затронутые версииВерсия исправления

<= 15.0.0

18.1.0

Наименование

github.com/evmos/evmos/v14

go
Затронутые версииВерсия исправления

<= 14.1.0

18.1.0

Наименование

github.com/evmos/evmos/v13

go
Затронутые версииВерсия исправления

<= 13.0.2

18.1.0

Наименование

github.com/evmos/evmos/v12

go
Затронутые версииВерсия исправления

<= 12.1.6

18.1.0

Наименование

github.com/evmos/evmos/v11

go
Затронутые версииВерсия исправления

<= 11.0.2

18.1.0

Наименование

github.com/evmos/evmos/v10

go
Затронутые версииВерсия исправления

<= 10.0.1

18.1.0

Наименование

github.com/evmos/evmos/v9

go
Затронутые версииВерсия исправления

<= 9.1.0

18.1.0

Наименование

github.com/evmos/evmos/v8

go
Затронутые версииВерсия исправления

<= 8.2.3

18.1.0

Наименование

github.com/evmos/evmos/v7

go
Затронутые версииВерсия исправления

<= 7.0.0

18.1.0

Наименование

github.com/evmos/evmos/v6

go
Затронутые версииВерсия исправления

<= 6.0.4

18.1.0

EPSS

Процентиль: 65%
0.00485
Низкий

7.5 High

CVSS3

Дефекты

CWE-670

Связанные уязвимости

CVSS3: 7.5
nvd
больше 1 года назад

Evmos is the Ethereum Virtual Machine (EVM) Hub on the Cosmos Network. There is an issue with how to liquid stake using Safe which itself is a contract. The bug only appears when there is a local state change together with an ICS20 transfer in the same function and uses the contract's balance, that is using the contract address as the sender parameter in an ICS20 transfer using the ICS20 precompile. This is in essence the "infinite money glitch" allowing contracts to double the supply of Evmos after each transaction.The issue has been patched in versions >=V18.1.0.

EPSS

Процентиль: 65%
0.00485
Низкий

7.5 High

CVSS3

Дефекты

CWE-670