Skip to content

Commit

Permalink
Merge pull request from GHSA-j496-crgh-34mx
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim authored Apr 5, 2024
1 parent bbf1066 commit 04275aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ go 1.19
module github.com/cosmos/ibc-go/v6

retract (
[v6.1.1, v6.2.1] // contains ASA-2024-007 vulnerability
v6.1.0 // contains huckleberry vulnerability
[v6.0.0, v6.0.1] // depends on SDK version < v0.46.7
)
Expand Down
20 changes: 10 additions & 10 deletions modules/core/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,17 +476,17 @@ func (k Keeper) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*c
return nil, sdkerrors.Wrap(err, "timeout packet verification failed")
}

// Delete packet commitment
if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil {
return nil, err
}

// Perform application logic callback
err = cbs.OnTimeoutPacket(ctx, msg.Packet, relayer)
if err != nil {
return nil, sdkerrors.Wrap(err, "timeout packet callback failed")
}

// Delete packet commitment
if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil {
return nil, err
}

defer func() {
telemetry.IncrCounterWithLabels(
[]string{"ibc", "timeout", "packet"},
Expand Down Expand Up @@ -542,6 +542,11 @@ func (k Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeo
return nil, sdkerrors.Wrap(err, "timeout on close packet verification failed")
}

// Delete packet commitment
if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil {
return nil, err
}

// Perform application logic callback
//
// NOTE: MsgTimeout and MsgTimeoutOnClose use the same "OnTimeoutPacket"
Expand All @@ -551,11 +556,6 @@ func (k Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeo
return nil, sdkerrors.Wrap(err, "timeout packet callback failed")
}

// Delete packet commitment
if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil {
return nil, err
}

defer func() {
telemetry.IncrCounterWithLabels(
[]string{"ibc", "timeout", "packet"},
Expand Down

0 comments on commit 04275aa

Please sign in to comment.