Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Patched Fix ASA-2024-006: ValidateVoteExtensions helper function in Cosmos SDK may allow incorrect voting power assumptions #181

Closed
wants to merge 1 commit into from

Conversation

bangtabil
Copy link

Summary

The default ValidateVoteExtensions helper function infers total voting power based off of the injected VoteExtension, which are injected by the proposer. If your chain utilizes the ValidateVoteExtensions helper in ProcessProposal, a dishonest proposer can potentially mutate voting power of each validator it includes in the injected VoteExtension, which could have potentially unexpected or negative consequences on modified state. Additional validation on injected VoteExtension data was added to confirm voting power against the state machine.

Details
The ValidateVoteExtensions helper function in Cosmos SDK allows a dishonest proposer to mutate the voting power of validators included in the injected VoteExtension. This can lead to unexpected or negative consequences on the modified state of the blockchain. The function infers the total voting power based on the injected VoteExtension, which can be manipulated by the proposer. To mitigate this vulnerability, additional validation on the injected VoteExtension data has been added to confirm voting power against the state machine.

…on in Cosmos SDK may allow incorrect voting power assumptions

## Summary
The default `ValidateVoteExtensions` helper function infers total voting power based off of the injected `VoteExtension`, which are injected by the proposer. If your chain utilizes the `ValidateVoteExtensions` helper in ProcessProposal, a dishonest proposer can potentially mutate voting power of each validator it includes in the injected `VoteExtension`, which could have potentially unexpected or negative consequences on modified state. Additional validation on injected `VoteExtension` data was added to confirm voting power against the state machine.

**Details**
The ValidateVoteExtensions helper function in Cosmos SDK allows a dishonest proposer to mutate the voting power of validators included in the injected VoteExtension. This can lead to unexpected or negative consequences on the modified state of the blockchain. The function infers the total voting power based on the injected VoteExtension, which can be manipulated by the proposer. To mitigate this vulnerability, additional validation on the injected VoteExtension data has been added to confirm voting power against the state machine.
@github-actions github-actions bot added the packet-forward-middleware Label for items related to the packet forward middleware label Mar 26, 2024
@Reecepbcups
Copy link
Member

Thankfully since this repo is only an import it should not affect upstreams versions (they can bump without this having to also be updated).

does need a go mod tidy. if issues persist after that there is a pending SDK patch for v0.50.5

@faddat
Copy link
Contributor

faddat commented Apr 8, 2024

I've a strong preference to keeping deps up to date anywhere, regardless.

The reason for this is that these repositories are used for reference, and people may reference the versions elsewhere and then end up with an ouchie.

@faddat
Copy link
Contributor

faddat commented Apr 8, 2024

This PR very nice, because it will prevent downgrades of packages to versions containing security issues.

go get github.com/cosmos/ibc-apps/modules/ibc-hooks/v7@26f3ad8
go: downloading github.com/cometbft/cometbft v0.37.1
go: downloading github.com/cosmos/cosmos-sdk v0.47.3-0.20230513170018-83d600596f5d
go: downloading github.com/cosmos/ibc-go/v7 v7.0.0

Basically when upstream doesn't keep strictly up to date, downstream gets cholera.

... but it seems that this was addressed in a PR by @hoank101 and this one is now safe to close.

faddat added a commit to faddat/ibc-apps that referenced this pull request Apr 8, 2024
@faddat faddat mentioned this pull request Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packet-forward-middleware Label for items related to the packet forward middleware
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants