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

BUG: cw-ics721 attacked by malicious CW721 contract #246

Open
giansalex opened this issue Mar 3, 2023 · 1 comment
Open

BUG: cw-ics721 attacked by malicious CW721 contract #246

giansalex opened this issue Mar 3, 2023 · 1 comment
Labels
ics-721 Possible protocol vulnerability

Comments

@giansalex
Copy link
Contributor

giansalex commented Mar 3, 2023

Summary of Bug

A cw721 contract containing malicious code added to TransferNft method, which would then be executed by ICS721 to redeem an NFT (on IBC Rcv).

Environment

Steps to Reproduce

  • Customize cw721-base contract, add infinte loop code to transfer_nft handler.
  • Upload code, Instantiate and mint an NFT
  • Transfer NFT to IRIS network
  • Return NFT to JUNO Network

Expected and Actual Behavior

Expected: ACK with error for exceeding the gas limit
Actual: Transaction on JUNO (IBC Recv) never completes

Additional Context

This can cause a DoS attack, where relayers are busy trying to execute transactions that cannot be completed.

Malicious cw721 contract
https://blueprints.juno.giansalex.dev/#/contracts/juno1rn6q7hdd95wly4tuun7ffjc4x2rak27twd6ypynlyplpc84um03qqvtq7h

@giansalex giansalex changed the title BUG: ICS721 attacked by malicious CW721 contract AWARD: Disperze, ICS721 attacked by malicious CW721 contract Mar 3, 2023
@giansalex giansalex changed the title AWARD: Disperze, ICS721 attacked by malicious CW721 contract AWARD: Disperze, cw-ics721 attacked by malicious CW721 contract Mar 3, 2023
@giansalex giansalex changed the title AWARD: Disperze, cw-ics721 attacked by malicious CW721 contract BUG: cw-ics721 attacked by malicious CW721 contract Mar 6, 2023
@giansalex
Copy link
Contributor Author

giansalex commented Mar 13, 2023

Also the malicious contract can send more packets when executed by cw-ics721, turning it into an endless loop of packets.

example: Juno <> Iris
image

Irisnet does not have a max gas per block configured.

@taramakage taramakage added the ics-721 Possible protocol vulnerability label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ics-721 Possible protocol vulnerability
Projects
None yet
Development

No branches or pull requests

2 participants