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

bank.SendKeeper breaks intended least authority permissioning #2887

Closed
cwgoes opened this issue Nov 22, 2018 · 4 comments
Closed

bank.SendKeeper breaks intended least authority permissioning #2887

cwgoes opened this issue Nov 22, 2018 · 4 comments

Comments

@cwgoes
Copy link
Contributor

cwgoes commented Nov 22, 2018

bank.SendKeeper is intended only to allow transfers of coins between accounts, but in fact it allows arbitrary minting or burning of coins with keeper.inputOutputCoins, because the invariant inputs.Sum() == outputs.Sum() is only checked in ValidateBasic() on bank.MsgSend. Modules which are passed a bank.SendKeeper have just as much power as modules which are passed the full bank.BaseKeeper.

Recommended mitigation: remove inputOutputCoins from the sendKeeper (it isn't used in any other modules presently).
Alternative mitigation: repeat the necessary validation, which is very inexpensive, in the keeper.

@alexanderbez
Copy link
Contributor

We'd need this for IBC, correct? I think my vote would be to remove it and possibly create a new IBC bank keeper which the IBC module uses?

@cwgoes
Copy link
Contributor Author

cwgoes commented Nov 23, 2018

We'd need this for IBC, correct? I think my vote would be to remove it and possibly create a new IBC bank keeper which the IBC module uses?

There already is such as keeper - BaseKeeper.

@alexanderbez
Copy link
Contributor

I mean BaseKeeper w/o I/O coins.

@cwgoes
Copy link
Contributor Author

cwgoes commented Nov 23, 2018

I see, sure; let's wait to see exactly what the IBC module needs to do first though.

cwgoes added a commit that referenced this issue Nov 29, 2018
…istency

* Update PENDING.md

* New structure

* Start transactions section

* Remove MsgIssue

* Update keepers.md

* Add state.md

* Update keepers.md, discovered #2887

* Move inputOutputCoins to BaseKeeper

* Remove no-loner-applicable tests

* More spec updates

* Tiny cleanup

* Clarify storage rationale

* Warn the user

* Remove extra newline
mircea-c pushed a commit that referenced this issue Dec 4, 2018
…istency

* Update PENDING.md

* New structure

* Start transactions section

* Remove MsgIssue

* Update keepers.md

* Add state.md

* Update keepers.md, discovered #2887

* Move inputOutputCoins to BaseKeeper

* Remove no-loner-applicable tests

* More spec updates

* Tiny cleanup

* Clarify storage rationale

* Warn the user

* Remove extra newline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants