Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1qNDk2LWNyZ2gtMzRteM4AA6qW

ibc-go: Potential Reentrancy using Timeout Callbacks in ibc-hooks

Name: ASA-2024-007: Potential Reentrancy using Timeout Callbacks in ibc-hooks
Component: ibc-go
Criticality: Critical (ACMv1: I:Critical; L:AlmostCertain)
Affected versions: < v4.6.0, < v5.4.0, < v6.3.0, < v7.4.0, < v8.2.0
Affected users: Chain Builders + Maintainers

Summary

Through the deployment and subsequent use of a malicious CosmWasm contract via IBC interactions, an attacker could potentially execute the same MsgTimeout inside the IBC hook for the OnTimeout callback before the packet commitment is deleted. On chains where ibc-hooks wraps ICS-20, this vulnerability may allow for the logic of the OnTimeout callback of the transfer application to be recursively executed, leading to a condition that may present the opportunity for the loss of funds from the escrow account or unexpected minting of tokens.

Affected Configurations

Chains which satisfy all of the following requirements are considered to be impacted by this vulnerability:

Next Steps for Impacted Chain Builders and Maintainers

It is advised to immediately upgrade to the latest patch fix version of ibc-go for your chain. If you have already applied a soft-patch through private coordination, we recommend additionally updating to the latest ibc-go version via normal software upgrade governance.

If you have not upgraded your chain yet, and you desire to mitigate exposure to this vulnerability in the meantime, it is advisable to limit code uploading for contracts to trusted parties on your chain.

If your chain only allows permissioned, access-controlled contract uploads, it is still strongly recommended to update to the latest patched ibc-go version for your chain per your normal software upgrade process.

Preparing for future coordination

If your chain would like to be included in future coordination efforts, please ensure your chain has a prominently displayed or otherwise easily available up-to-date email address for technical security contact available. A security.md file in the root of your projects’ code repository should contain this information. Additionally, please test this security contact with an unaffiliated email to ensure it works as expected and can receive emails from outside of your domain.

To ensure that your chain is included in future impact assessments, please keep your chain information up to date in the Cosmos Chain Registry with code location, network name, and public RPC and API endpoints in the details.

We recommend that all chains configure and practice the use of the Circuit Breaker module in the Cosmos SDK, as future vulnerability notifications may require the use of this mechanism as a mitigation against exploitation.

Recognition

This issue was reported to the Cosmos Bug Bounty Program on HackerOne on 3/26/24 by Maxwell Dulin (Strikeout) at Asymmetric Research. If you believe you have found a bug in the Interchain Stack or would like to contribute to the program by reporting a bug, please see https://hackerone.com/cosmos.

Notes

Due to the critical nature of this issue, both the ibc-go team and Amulet independently performed impact assessments for the ecosystem, which informed a risk-driven private patching effort that preceded this public release. This private patching effort significantly reduced the exposure of the ecosystem to this vulnerability. We appreciate the diligence and professionalism of all chains and validators involved with this effort – your ability to move quickly while maintaining confidentiality was instrumental in protecting the wider Interchain Ecosystem.

If you ever have questions about security coordination efforts, public or private, please reach out to our official communication channel at [email protected].

For more information about ibc-go, please see https://ibc.cosmos.network/main.

For more information about the Interchain Foundation’s engagement with Amulet, please see https://github.com/interchainio/security.

Permalink: https://github.com/advisories/GHSA-j496-crgh-34mx
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1qNDk2LWNyZ2gtMzRteM4AA6qW
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Critical
Classification: General
Published: 8 months ago
Updated: 8 months ago


CVSS Score: 9.1
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

Identifiers: GHSA-j496-crgh-34mx
References: Repository: https://github.com/cosmos/ibc-go
Blast Radius: 24.8

Affected Packages

go:github.com/cosmos/ibc-go
Dependent packages: 680
Dependent repositories: 526
Downloads:
Affected Version Ranges: < 4.6.0
No known fixed version
All affected versions: 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.5.0
go:github.com/cosmos/ibc-go/v2
Dependent packages: 712
Dependent repositories: 398
Downloads:
Affected Version Ranges: < 4.6.0
No known fixed version
All affected versions: 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.4.2, 2.5.0
go:github.com/cosmos/ibc-go/v3
Dependent packages: 1,056
Dependent repositories: 436
Downloads:
Affected Version Ranges: < 4.6.0
No known fixed version
All affected versions: 3.0.0, 3.0.1, 3.0.2, 3.1.0, 3.1.1, 3.2.0, 3.2.1, 3.3.0, 3.3.1, 3.4.0
go:github.com/cosmos/ibc-go/v8
Dependent packages: 141
Dependent repositories: 6
Downloads:
Affected Version Ranges: < 8.2.0
Fixed in: 8.2.0
All affected versions: 8.0.0, 8.0.1, 8.1.0, 8.1.1
All unaffected versions: 8.2.0, 8.2.1, 8.3.0, 8.3.1, 8.3.2, 8.4.0, 8.5.0, 8.5.1
go:github.com/cosmos/ibc-go/v7
Dependent packages: 582
Dependent repositories: 147
Downloads:
Affected Version Ranges: < 7.4.0
Fixed in: 7.4.0
All affected versions: 7.0.0, 7.0.1, 7.1.0, 7.2.0, 7.2.1, 7.2.2, 7.2.3, 7.3.0, 7.3.1, 7.3.2
All unaffected versions: 7.4.0, 7.4.1, 7.5.0, 7.5.1, 7.5.2, 7.6.0, 7.7.0, 7.8.0
go:github.com/cosmos/ibc-go/v6
Dependent packages: 350
Dependent repositories: 149
Downloads:
Affected Version Ranges: < 6.3.0
Fixed in: 6.3.0
All affected versions: 6.0.0, 6.1.0, 6.1.1, 6.1.2, 6.2.0, 6.2.1, 6.2.2, 6.2.3
All unaffected versions: 6.3.0, 6.3.1
go:github.com/cosmos/ibc-go/v5
Dependent packages: 386
Dependent repositories: 158
Downloads:
Affected Version Ranges: < 5.4.0
Fixed in: 5.4.0
All affected versions: 5.0.0, 5.0.1, 5.1.0, 5.2.0, 5.2.1, 5.3.0, 5.3.1, 5.3.2
All unaffected versions: 5.4.0
go:github.com/cosmos/ibc-go/v4
Dependent packages: 404
Dependent repositories: 38
Downloads:
Affected Version Ranges: < 4.6.0
Fixed in: 4.6.0
All affected versions: 4.0.0, 4.0.1, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.2.0, 4.2.1, 4.2.2, 4.3.0, 4.3.1, 4.4.0, 4.4.1, 4.4.2, 4.4.3, 4.5.0, 4.5.1
All unaffected versions: 4.6.0