Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7e58f5b
IBC-2: fix to update channel commitment in `timeoutPacket()`
bluele Nov 23, 2024
2e03fe8
Merge pull request #302 from hyperledger-labs/audit-202409-ibc-2
bluele Nov 23, 2024
baddaf2
IBC-3: fix to ensure `connection.state` is `OPEN` in `channelOpenAck()`
bluele Nov 23, 2024
9375b2a
Merge pull request #304 from hyperledger-labs/audit-202409-ibc-3
bluele Nov 23, 2024
877957b
IBC-4: fix to ensure the commitment of consensus state corresponding …
bluele Nov 23, 2024
4d59343
Merge pull request #305 from hyperledger-labs/audit-202409-ibc-4
bluele Nov 24, 2024
2b90889
IBC-5: delete packet commitment in `timeoutOnClose()`
bluele Nov 23, 2024
037ce6f
Merge pull request #307 from hyperledger-labs/audit-202409-ibc-5
bluele Nov 24, 2024
6321e35
IBC-14: clarify which sequence commitments are stored
bluele Nov 25, 2024
3b309dd
IBC-7: fix to remove state check in `timeoutPacket()` and `timeoutOnC…
bluele Nov 25, 2024
c9efed2
Merge pull request #308 from hyperledger-labs/audit-202409-ibc-7
bluele Nov 26, 2024
43f77d2
split `IBCChannelUpgradeBase` into two contracts
bluele Nov 24, 2024
deac22d
add `counterpartyUpgradeTimeout` to the storage
bluele Nov 24, 2024
eadd74c
introduce `hostHeight()` and check whether `upgradeTimeout` has passe…
bluele Nov 24, 2024
b36720b
Merge pull request #309 from hyperledger-labs/audit-202409-ibc-1
bluele Nov 29, 2024
c13824e
IBC-8: fix missing checks on `revision_number`
bluele Nov 25, 2024
ba1ce2b
use cancun for e2e-test
bluele Nov 25, 2024
9759e51
Merge pull request #310 from hyperledger-labs/audit-202409-ibc-8
bluele Dec 2, 2024
4a6f4c9
Merge pull request #313 from hyperledger-labs/audit-202409-ibc-14
bluele Dec 4, 2024
7e97315
IBC-11: fix `clientType` and `clientId` validations
bluele Nov 25, 2024
952f782
Merge pull request #311 from hyperledger-labs/audit-202409-ibc-11
bluele Dec 4, 2024
9c6b1c8
improve docs for `routerUpdateClient()`
bluele Nov 25, 2024
530737c
Merge pull request #312 from hyperledger-labs/audit-202409-ibc-12
bluele Dec 4, 2024
6ace215
S7: improve validation for `Version` in `connectionOpenInit()`
bluele Nov 25, 2024
718fe09
S8: remove redundant ERC165 checks
bluele Nov 25, 2024
1a8e20d
S1: improve comments for connection
bluele Nov 26, 2024
3c82e7a
S6: fix incorrect comment for `channelOpenConfirm()`
bluele Nov 26, 2024
c690dde
S4: fix to add address validation for `IBCClientConnectionChannelHand…
bluele Nov 26, 2024
11c488e
S3: separate `TimeoutPacket` event for `timeoutPacket()` and `timeout…
bluele Nov 26, 2024
15ecd73
S9: add some fields to `IBCChannelUnexpectedNextSequenceRecv` error
bluele Dec 4, 2024
61c65ec
Merge pull request #314 from hyperledger-labs/audit-202409-suggestions
bluele Dec 4, 2024
93311b1
fix to check if the generated channel ID is not already stored
bluele Dec 5, 2024
476a6d8
add main deviations from ibc spec to `architecture.md`
bluele Dec 5, 2024
0471691
Merge pull request #315 from hyperledger-labs/audit-202409-ibc-15
bluele Dec 5, 2024
af68fc1
IBC-6: add module developer warning to doc of `sendPacket()`
bluele Dec 6, 2024
3788b23
Merge pull request #316 from hyperledger-labs/audit-202409-ibc-6
bluele Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions contracts/core/02-client/IBCClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ contract IBCClient is IBCHost, IIBCClient, IIBCClientErrors {
*/
function updateClient(MsgUpdateClient calldata msg_) external override {
(address lc, bytes4 selector, bytes memory args) = routeUpdateClient(msg_);
// NOTE: We assume that the client contract was correctly validated by the authority at registration via `registerClient` function.
// For details, see the `registerClient` function in the IBCHostConfigurator.
(bool success, bytes memory returndata) = lc.call(abi.encodePacked(selector, args));
if (!success) {
if (returndata.length > 0) {
Expand All @@ -62,6 +64,9 @@ contract IBCClient is IBCHost, IIBCClient, IIBCClientErrors {
/**
* @dev routeUpdateClient returns the LC contract address and the calldata to the receiving function of the client message.
* Light client contract may encode a client message as other encoding scheme(e.g. ethereum ABI)
* WARNING: If the caller is an EOA like a relayer, the caller must validate the return values with the allow list of the contract functions before calling the LC contract with the data.
* This validation is always required because even if the caller trusts the IBC contract, a malicious RPC provider can return arbitrary data to the caller.
* Check ADR-001 for details.
*/
function routeUpdateClient(MsgUpdateClient calldata msg_)
public
Expand All @@ -70,6 +75,7 @@ contract IBCClient is IBCHost, IIBCClient, IIBCClientErrors {
returns (address, bytes4, bytes memory)
{
ILightClient lc = checkAndGetClient(msg_.clientId);
// NOTE: The `lc.routeUpdateClient` function must be validated by the authority at registration via `registerClient` function.
(bytes4 functionId, bytes memory args) = lc.routeUpdateClient(msg_.clientId, msg_.protoClientMessage);
return (address(lc), functionId, args);
}
Expand Down
2 changes: 2 additions & 0 deletions contracts/core/24-host/IIBCHostConfigurator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ interface IIBCHostConfigurator {
* The authority should verify the light client contract is a valid implementation as follows:
* - The contract implements ILightClient
* - To avoid reentrancy attack, the contract never performs `call` to the IBC contract directly or indirectly in the `verifyMembership` and the `verifyNonMembership`
* - `routerUpdateClient` function returns the correct selector and arguments for updating the client
* - This is important because a malicious client can make arbitrary function calls to the IBC contract through `updateClient()`.
*/
function registerClient(string calldata clientType, ILightClient client) external;

Expand Down
Loading