Open sherlock-admin3 opened 5 months ago
Escalate
This valid issue shows that not all taxes will be counted. Only taxes wrapped in BankMsg::Send
will be counted even though some taxes will be wrapped in WasmMsg::Execute
. This causes either valid payment transactions to fail or allows payers to skip paying some taxes.
std/src/common/rates.rs::get_tax_amount() is also in-scope.
Escalate
This valid issue shows that not all taxes will be counted. Only taxes wrapped in
BankMsg::Send
will be counted even though some taxes will be wrapped inWasmMsg::Execute
. This causes either valid payment transactions to fail or allows payers to skip paying some taxes.std/src/common/rates.rs::get_tax_amount() is also in-scope.
You've created a valid escalation!
To remove the escalation from consideration: Delete your comment.
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
Indeed, not all fees are counted when get_tax_amount()
is called. So, I plan to accept the escalation and make the issue a valid Medium.
Thank you 🙏🏼
@gjaldon @MxAxM are there any duplicates?
Result: Medium Unique
g
Medium
Calculating tax amount does not include taxes in
WasmMsg::Execute
messagesSummary
get_tax_amount()
fetches the amount of tax to be paid by totaling the amounts in the message transfers generated by theon_funds_transfer()
hook. However, it only countsCosmosMsg::Bank(BankMsg::Send)
messages and not theWasmMsg::Execute
messages. This either fails the transfer or allows payors to skip paying taxes.Vulnerability Detail
The issue lies in
get_tax_amount()
's mapping logic over the messages generated byon_funds_transfer()
.ref: std/src/common/rates.rs::get_tax_amount()
Only taxes wrapped in
BankMsg::Send
are included. However, fee recipients with amsg
set will get generated aWasmMsg::Execute
message instead.ref: std/src/amp/recipient.rs::generate_direct_msg()
Any taxes sent to recipients with a
msg
set will not be counted byget_tax_amount()
.Impact
The following effects will take place:
WasmMsg::Execute
,get_tax_amount()
will fail. Payment transfers for non-fungible ADO contracts will fail since non-fungible ADO contracts useget_tax_amont()
.WasmMsg::Execute
msg, the tax wrapped in aWasmMsg::Execute
message will be ignored. Payers can skip paying theWasmMsg::Execute
taxes in these cases.In effect, fee recipients with
msg
can not be used or it will lead to failures in non-fungible ADO contracts.Code Snippet
Tool used
Manual Review
Recommendation
Consider modifying
get_tax_amount()
to count the taxes inWasmMsg::Execute
messages.