Datachain - IBC

QuantstampRepository at commit ca7a56c

Quantstamp reviewed Datachain (Datachain - IBC) on 9 Dec 2024: 13 findings, 0 critical; 10 marked fixed, 3 acknowledged.

No open critical findings
Open the reportOpen Datachain’s security record

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings13

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High015
Medium002
Low023
HighDoS Can Close a Channel by Abusing Different Gas Limits Between ChainsAcknowledged

In order to send data (a packet) through IBC, a module needs to call the function `IBCChannelPacketSendRecv.sendPacket()`, and then the `IBCChannelPacketSendRecv.recvPacket()` function is called by a module in order to receive an IBC packet sent on the corresponding channel end on the counterparty chain. If a packet timeouts instead of being executed, on the originated chain the function `IBCChannelPacketTimeout.timeoutPacket()` is invoked, and the channel will be closed if it is of type `ORDERED`, thus not allowing following packets to be send. This feature can be leveraged in the context of EVM chains where you could find chains with significant gas limit differences per block (e.g, Ethereum with 30m gas limit vs Zircuit with 10m gas limit) to create a DoS by sending a large amount of data that could be processed by one chain but not by the other, therefore running into an `out of gas` error and making the packet timeout. The bigger the difference between the chains' gas limit per block, the easier it is to exploit the vulnerability.

Low`channelCloseConfirm()` Does Not Delete Upgrade Paths of the Channel Being ClosedAcknowledged

[The specs](https://github.com/cosmos/ibc/blob/499818e9c4b136029717a436a04af15113f4424f/spec/core/ics-004-channel-and-packet-semantics/README.md?plain=1#L588) describe that in `channelCloseConfirm()` any upgrade stored at the channel upgrade path should be deleted during this process, however there is no deletion taking place.

LowDeviations From ICS-SpecsAcknowledged

Below, we include a non-exhaustive list of all deviations from the ICS-Specs in the ibc-solidity implementatio. These deviations are not standalone issues, however we list these deviations for transparency for all future users of ibc-solidity. Many of these deviations are a result of the limitations of the Solidity language and the EVM environment, such as gas costs or transaction gas limits and are intentional design decisions made by the Datachain team. The team has documented these changes in the files at `docs/adr`. Overall, we note that ibc-solidity does not support multi-hop connections or for the `ORDERED_ALLOW_TIMEOUT` channel ordering mechanism, as described in the ICS-Specs. Therefore, all logic associated with that is not present in the ibc-solidity implementation. Deviations: - `authenticateCapability()` does not exist in the ibc-solidity implementation as a single function, as described in the ICS specs. Instead, the owner of the `IBCHandler` contract will invoke `bindPort()` to assign module address to given ports in the provable store of the `IBCHandler`. Then, throughout conneciton and channel handshakes, capabilities are authenticated through functions such as `IBCModuleManager.lookupModuleByPort()` and `lookupModuleByChannel()`, which proves there is a non-zero address mapped at the port or channel, showing that the module has been bound by an IBC admin, and the channel has been written. During handshakes, module callback functions such as `onRecvPacket()` will only be invoked on the module addresses assigned by the Admin. - `clientConnectionsPath()` providing a reverse mapping from clients to a set of connections is not included in the implementation. - This means, there is no way that `queryClientConnections()` can be implemented and this data will have to be queried using other methods. - `ConnectionEnd` structural deviation: - `delayPeriodBlocks` is not defined to be a field within a Connection. Instead, when this field is needed for message passing, it is calculated during the transaction, as a function of the `delayPeriodTime` and the `expectedTimePerBlock` which is configurable by the IBCHandler admin. - Further, the `ConnectionEnd` doesn't have fields like `counterPartyPrefix` and instead, these fields are defined within a counterparty data structure which is a field within the ConnectionEnd itself - `channelOpenInit()` & `channelOpenTry()` do not confirm that the generated `channelId` is not already stored, as specified in the specs. We recognize that a clash is highly unlikely, as there are 2^64 possible ids. However, a check like this is done in `connectionOpenInit()` and we recommend verifying that there is nothing stored at the generated id for thoroughness. - `emit RecvPacket()` does not include the Order and Connection fields as [specified in ICS-specs](https://github.com/cosmos/ibc/blob/499818e9c4b136029717a436a04af15113f4424f/spec/core/ics-004-channel-and-packet-semantics/README.md?plain=1#L879) - the `_writeAcknowledgement()` function is emitting an event that is missing the following fields, that are otherwise specified in the specs: - `timeoutHeight` - `timeoutTimestamp` - `packet.data` - `sendPacket()` does not check that the connection exists. However, since the connection is stored within the `Channel.Data` itself, and the channel's existence is confirmed, we see no major issue here and include this to note the discrepancy. - Specs allow for a packet to received more than once, with just an identical event being emitted, however, in the implementation, we cannot receive a packet more than once, and the transaction will revert. the Datachain team has already acknowledged this to be a design choice however we note here for thoroughness and transparency. - `counterpartyUpgradePaths()` are not written to the provable store

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (53)

  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCHostConfigurator.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/03-connection/IIBCConnection.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/IIBCClient.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/OwnableUpgradeableIBCHandler.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/IIBCClientErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/26-router/IBCModuleManager.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/Channel.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/Commitment.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/03-connection/IBCConnection.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/IBCClientConnectionChannelHandler.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IIBCHostConfigurator.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCHost.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/ILightClient.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/apps/commons/IBCChannelUpgradableModule.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/IBCHeight.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/apps/commons/IBCAppBase.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCCommitment.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IBCChannelPacketSendRecv.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IIBCChannelUpgrade.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/26-router/IIBCModuleUpgrade.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/Client.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/IBCClient.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/apps/commons/IIBCChannelUpgradableModule.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/GoogleProtobufAny.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/QBFT.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCSelfStateValidator.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IIBCChannelErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/MockClient.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/IBCClientLib.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IIBCHostErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/IIBCQuerier.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/IIBCHandler.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IBCChannelPacketTimeout.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IBCChannelHandshake.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IIBCChannel.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IBCChannelLib.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/ProtoBufRuntime.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/03-connection/IBCConnectionLib.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCHostLib.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/03-connection/IIBCConnectionErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/Connection.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/OwnableIBCHandler.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/26-router/IIBCModuleErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/03-connection/IBCConnectionSelfStateNoValidation.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/26-router/IIBCModule.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/ILightClientErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/Localhost.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/IBCHandler.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IBCChannelUpgrade.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/26-router/IIBCModuleManager.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IIBCChannelUpgradeErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/IBCQuerier.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCStore.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61

Part of Datachain’s security record

Datachain
Audits7 audits by 1 firmLast audit Jul 2025, by Quantstamp.
Critical findingsNo open critical findingsAcross 7 reports.
Open Datachain’s security record

Security firm

Quantstamp

236 projects reviewed · 332 reports · latest Oct 2026

See Quantstamp’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us