diff --git a/CHANGELOG.md b/CHANGELOG.md index ece47d19b21..7f2a49e7a46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (apps/27-interchain-accounts) [\#6147](https://github.com/cosmos/ibc-go/pull/6147) Emit an event signalling that the host submodule is disabled. * (testing) [\#6180](https://github.com/cosmos/ibc-go/pull/6180) Add version to tm abci headers in ibctesting. * (apps/27-interchain-accounts, apps/tranfer, apps/29-fee) [\#6253](https://github.com/cosmos/ibc-go/pull/6253) Allow channel handshake to succeed if fee middleware is wired up on one side, but not the other. +* (apps/transfer) [\#6268](https://github.com/cosmos/ibc-go/pull/6268) Use memo strings instead of JSON keys in `AllowedPacketData` of transfer authorization. ### Features diff --git a/modules/apps/transfer/types/authz.pb.go b/modules/apps/transfer/types/authz.pb.go index 95f24eca332..1077270e6f1 100644 --- a/modules/apps/transfer/types/authz.pb.go +++ b/modules/apps/transfer/types/authz.pb.go @@ -36,6 +36,9 @@ type Allocation struct { SpendLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=spend_limit,json=spendLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"spend_limit"` // allow list of receivers, an empty allow list permits any receiver address AllowList []string `protobuf:"bytes,4,rep,name=allow_list,json=allowList,proto3" json:"allow_list,omitempty"` + // allow list of memo strings, an empty list prohibits all memo strings; + // a list only with "*" permits any memo string + AllowedPacketData []string `protobuf:"bytes,5,rep,name=allowed_packet_data,json=allowedPacketData,proto3" json:"allowed_packet_data,omitempty"` } func (m *Allocation) Reset() { *m = Allocation{} } @@ -99,6 +102,13 @@ func (m *Allocation) GetAllowList() []string { return nil } +func (m *Allocation) GetAllowedPacketData() []string { + if m != nil { + return m.AllowedPacketData + } + return nil +} + // TransferAuthorization allows the grantee to spend up to spend_limit coins from // the granter's account for ibc transfer on a specific channel type TransferAuthorization struct { @@ -156,35 +166,36 @@ func init() { } var fileDescriptor_b1a28b55d17325aa = []byte{ - // 435 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0x4d, 0x6e, 0xd3, 0x40, - 0x14, 0x8e, 0x9b, 0x0a, 0x29, 0x13, 0xc1, 0xc2, 0xa2, 0xc8, 0xa9, 0xc0, 0x89, 0xbc, 0x40, 0xde, - 0x64, 0x86, 0xc0, 0x22, 0x52, 0x57, 0x34, 0xdd, 0x76, 0x51, 0x2c, 0x56, 0x6c, 0xa2, 0xf1, 0x64, - 0xb0, 0x47, 0x8c, 0xfd, 0x2c, 0xcf, 0xd8, 0xa8, 0x3d, 0x05, 0x48, 0x9c, 0x82, 0x35, 0x87, 0xa8, - 0x58, 0x75, 0xc9, 0x2a, 0xa0, 0xe4, 0x06, 0x3d, 0x01, 0xf2, 0xcc, 0x14, 0x5c, 0x21, 0xb1, 0xb2, - 0xdf, 0xcf, 0xf7, 0xde, 0xf7, 0xbe, 0xf9, 0x50, 0x2c, 0x52, 0x46, 0x68, 0x55, 0x49, 0xc1, 0xa8, - 0x16, 0x50, 0x2a, 0xa2, 0x6b, 0x5a, 0xaa, 0xf7, 0xbc, 0x26, 0xed, 0x82, 0xd0, 0x46, 0xe7, 0x57, - 0xb8, 0xaa, 0x41, 0x83, 0xff, 0x54, 0xa4, 0x0c, 0xf7, 0x3b, 0xf1, 0x5d, 0x27, 0x6e, 0x17, 0xc7, - 0x13, 0x06, 0xaa, 0x00, 0xb5, 0x36, 0xbd, 0xc4, 0x06, 0x16, 0x78, 0xfc, 0x38, 0x83, 0x0c, 0x6c, - 0xbe, 0xfb, 0x73, 0xd9, 0xd0, 0xf6, 0x90, 0x94, 0x2a, 0x4e, 0xda, 0x45, 0xca, 0x35, 0x5d, 0x10, - 0x06, 0xa2, 0xb4, 0xf5, 0xe8, 0xcb, 0x01, 0x42, 0xa7, 0x52, 0x82, 0x5d, 0xe6, 0x2f, 0xd1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2, 0xe4, 0xf9, 0xf7, 0x6f, 0xf3, 0xc8, 0x9d, 0x69, 0x9d, 0x70, 0x77, - 0xe7, 0xbd, 0xcd, 0xab, 0x37, 0xd7, 0xbb, 0xd0, 0xbb, 0xd9, 0x85, 0xde, 0xaf, 0x5d, 0xe8, 0x7d, - 0xda, 0x87, 0x83, 0x9b, 0x7d, 0x38, 0xf8, 0xb1, 0x0f, 0x07, 0xef, 0x96, 0xff, 0x4a, 0x20, 0x52, - 0x36, 0xcf, 0x80, 0xb4, 0x4b, 0x52, 0xc0, 0xa6, 0x91, 0x5c, 0x75, 0xee, 0xeb, 0xb9, 0xce, 0xe8, - 0x92, 0x3e, 0x30, 0x26, 0x78, 0xf5, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x61, 0xe8, 0x65, 0x9c, 0x9f, - 0x02, 0x00, 0x00, + // 462 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x8d, 0x9b, 0x82, 0x94, 0x8d, 0x40, 0xc2, 0x50, 0xe4, 0x54, 0xe0, 0x44, 0x3e, 0x20, 0x5f, + 0xb2, 0x4b, 0xe0, 0x10, 0xa9, 0x27, 0x9a, 0x72, 0xec, 0x21, 0x58, 0x9c, 0xb8, 0x58, 0xeb, 0xf5, + 0x92, 0xac, 0xba, 0xf6, 0x58, 0xde, 0x75, 0x50, 0xfb, 0x15, 0xf0, 0x1b, 0x9c, 0xf9, 0x04, 0x0e, + 0x15, 0xa7, 0x1e, 0x39, 0x05, 0x94, 0xfc, 0x41, 0xbf, 0x00, 0x79, 0x77, 0x0b, 0xa9, 0x90, 0x7a, + 0xb2, 0x67, 0xde, 0x9b, 0xd9, 0x99, 0x37, 0x0f, 0xc5, 0x22, 0x63, 0x84, 0x56, 0x95, 0x14, 0x8c, + 0x6a, 0x01, 0xa5, 0x22, 0xba, 0xa6,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} func (m *Allocation) Marshal() (dAtA []byte, err error) { @@ -207,6 +218,15 @@ func (m *Allocation) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AllowedPacketData) > 0 { + for iNdEx := len(m.AllowedPacketData) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowedPacketData[iNdEx]) + copy(dAtA[i:], m.AllowedPacketData[iNdEx]) + i = encodeVarintAuthz(dAtA, i, uint64(len(m.AllowedPacketData[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } if len(m.AllowList) > 0 { for iNdEx := len(m.AllowList) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.AllowList[iNdEx]) @@ -321,6 +341,12 @@ func (m *Allocation) Size() (n int) { n += 1 + l + sovAuthz(uint64(l)) } } + if len(m.AllowedPacketData) > 0 { + for _, s := range m.AllowedPacketData { + l = len(s) + n += 1 + l + sovAuthz(uint64(l)) + } + } return n } @@ -504,6 +530,38 @@ func (m *Allocation) Unmarshal(dAtA []byte) error { } m.AllowList = append(m.AllowList, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedPacketData", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuthz + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAuthz + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuthz + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowedPacketData = append(m.AllowedPacketData, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAuthz(dAtA[iNdEx:]) diff --git a/modules/apps/transfer/types/keys.go b/modules/apps/transfer/types/keys.go index ec4c76cf596..14930cd72a6 100644 --- a/modules/apps/transfer/types/keys.go +++ b/modules/apps/transfer/types/keys.go @@ -30,6 +30,9 @@ const ( // DenomPrefix is the prefix used for internal SDK coin representation. DenomPrefix = "ibc" + // AllowAllPacketDataKeys holds the string key that allows all memo strings in authz transfer messages + AllowAllPacketDataKeys = "*" + KeyTotalEscrowPrefix = "totalEscrowForDenom" ) diff --git a/modules/apps/transfer/types/transfer_authorization.go b/modules/apps/transfer/types/transfer_authorization.go index f8a7ef18be2..1af6f9c9c43 100644 --- a/modules/apps/transfer/types/transfer_authorization.go +++ b/modules/apps/transfer/types/transfer_authorization.go @@ -2,6 +2,7 @@ package types import ( "math/big" + "strings" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -45,6 +46,11 @@ func (a TransferAuthorization) Accept(ctx sdk.Context, msg sdk.Msg) (authz.Accep return authz.AcceptResponse{}, sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "not allowed receiver address for transfer") } + err := validateMemo(sdk.UnwrapSDKContext(ctx), msgTransfer.Memo, allocation.AllowedPacketData) + if err != nil { + return authz.AcceptResponse{}, err + } + // If the spend limit is set to the MaxUint256 sentinel value, do not subtract the amount from the spend limit. if allocation.SpendLimit.AmountOf(msgTransfer.Token.Denom).Equal(UnboundedSpendLimit()) { return authz.AcceptResponse{Accept: true, Delete: false, Updated: nil}, nil @@ -140,6 +146,35 @@ func isAllowedAddress(ctx sdk.Context, receiver string, allowedAddrs []string) b return false } +// validateMemo returns a nil error indicating if the memo is valid for transfer. +func validateMemo(ctx sdk.Context, memo string, allowedMemos []string) error { + // if the allow list is empty, then the memo must be an empty string + if len(allowedMemos) == 0 { + if len(strings.TrimSpace(memo)) != 0 { + return sdkerrors.Wrapf(ErrInvalidAuthorization, "memo must be empty because allowed packet data in allocation is empty") + } + + return nil + } + + // if allowedPacketDataList has only 1 element and it equals AllowAllPacketDataKeys + // then accept all the memo strings + if len(allowedMemos) == 1 && allowedMemos[0] == AllowAllPacketDataKeys { + return nil + } + + gasCostPerIteration := ctx.KVGasConfig().IterNextCostFlat + for _, allowedMemo := range allowedMemos { + ctx.GasMeter().ConsumeGas(gasCostPerIteration, "transfer authorization") + + if strings.TrimSpace(memo) == strings.TrimSpace(allowedMemo) { + return nil + } + } + + return sdkerrors.Wrapf(ErrInvalidAuthorization, "not allowed memo: %s", memo) +} + // UnboundedSpendLimit returns the sentinel value that can be used // as the amount for a denomination's spend limit for which spend limit updating // should be disabled. Please note that using this sentinel value means that a grantee diff --git a/modules/apps/transfer/types/transfer_authorization_test.go b/modules/apps/transfer/types/transfer_authorization_test.go index a549bce954e..3e29237b0e7 100644 --- a/modules/apps/transfer/types/transfer_authorization_test.go +++ b/modules/apps/transfer/types/transfer_authorization_test.go @@ -1,6 +1,8 @@ package types_test import ( + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" @@ -8,6 +10,11 @@ import ( "github.com/cosmos/ibc-go/v7/testing/mock" ) +const ( + testMemo1 = `{"wasm":{"contract":"osmo1c3ljch9dfw5kf52nfwpxd2zmj2ese7agnx0p9tenkrryasrle5sqf3ftpg","msg":{"osmosis_swap":{"output_denom":"uosmo","slippage":{"twap":{"slippage_percentage":"20","window_seconds":10}},"receiver":"feeabs/feeabs1efd63aw40lxf3n4mhf7dzhjkr453axurwrhrrw","on_failed_delivery":"do_nothing"}}}}` + testMemo2 = `{"forward":{"channel":"channel-11","port":"transfer","receiver":"stars1twfv52yxcyykx2lcvgl42svw46hsm5dd4ww6xy","retries":2,"timeout":1712146014542131200}}` +) + func (suite *TypesTestSuite) TestTransferAuthorizationAccept() { var ( msgTransfer types.MsgTransfer @@ -98,6 +105,73 @@ func (suite *TypesTestSuite) TestTransferAuthorizationAccept() { suite.Require().Nil(res.Updated) }, }, + { + "success: empty AllowedPacketData and empty memo", + func() { + allowedList := []string{} + transferAuthz.Allocations[0].AllowedPacketData = allowedList + }, + func(res authz.AcceptResponse, err error) { + suite.Require().NoError(err) + + suite.Require().True(res.Accept) + suite.Require().True(res.Delete) + suite.Require().Nil(res.Updated) + }, + }, + { + "success: AllowedPacketData allows any packet", + func() { + allowedList := []string{"*"} + transferAuthz.Allocations[0].AllowedPacketData = allowedList + msgTransfer.Memo = testMemo1 + }, + func(res authz.AcceptResponse, err error) { + suite.Require().NoError(err) + + suite.Require().True(res.Accept) + suite.Require().True(res.Delete) + suite.Require().Nil(res.Updated) + }, + }, + { + "success: transfer memo allowed", + func() { + allowedList := []string{testMemo1, testMemo2} + transferAuthz.Allocations[0].AllowedPacketData = allowedList + msgTransfer.Memo = testMemo1 + }, + func(res authz.AcceptResponse, err error) { + suite.Require().NoError(err) + + suite.Require().True(res.Accept) + suite.Require().True(res.Delete) + suite.Require().Nil(res.Updated) + }, + }, + { + "empty AllowedPacketData but not empty memo", + func() { + allowedList := []string{} + transferAuthz.Allocations[0].AllowedPacketData = allowedList + msgTransfer.Memo = testMemo1 + }, + func(res authz.AcceptResponse, err error) { + suite.Require().Error(err) + }, + }, + { + "memo not allowed", + func() { + allowedList := []string{testMemo1} + transferAuthz.Allocations[0].AllowedPacketData = allowedList + msgTransfer.Memo = testMemo2 + }, + func(res authz.AcceptResponse, err error) { + suite.Require().Error(err) + suite.Require().ErrorContains(err, fmt.Sprintf("not allowed memo: %s", testMemo2)) + }, + }, { "test multiple coins does not overspend", func() { @@ -236,6 +310,13 @@ func (suite *TypesTestSuite) TestTransferAuthorizationValidateBasic() { }, true, }, + { + "success: wildcard allowed packet data", + func() { + transferAuthz.Allocations[0].AllowedPacketData = []string{"*"} + }, + true, + }, { "empty allocations", func() { diff --git a/proto/ibc/applications/transfer/v1/authz.proto b/proto/ibc/applications/transfer/v1/authz.proto index 8b27ac9cf7d..cd5c96ee10b 100644 --- a/proto/ibc/applications/transfer/v1/authz.proto +++ b/proto/ibc/applications/transfer/v1/authz.proto @@ -19,6 +19,9 @@ message Allocation { [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; // allow list of receivers, an empty allow list permits any receiver address repeated string allow_list = 4; + // allow list of memo strings, an empty list prohibits all memo strings; + // a list only with "*" permits any memo string + repeated string allowed_packet_data = 5; } // TransferAuthorization allows the grantee to spend up to spend_limit coins from