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

Cosmwasm: (HAL-01) VULNERABLE WASM SMART CONTRACT LEADS TO CHAIN HALT #1189

Open
4 tasks
Tracked by #802
RafilxTenfen opened this issue Aug 1, 2022 · 1 comment
Open
4 tasks
Tracked by #802
Assignees

Comments

@RafilxTenfen
Copy link
Contributor

Summary

A vulnerability in the WASM integration and the authz module in the cosmos
-sdk has been detected, and was recently exploited to halt another chain
(JUNO). In the vulnerability, A smart contract abused non-deterministic
state in authz grants to save a different hash to all validators.
Juno Halt Root Cause Steps:
• An attacker is deployed a malicious contract on the Juno.
• A malicious contract is located on the Mint Scan

Problem Definition

• During the review of malicious contract, It has been observed that an
attacker’s contract is calling Authz Module MsgGrant and MsgRevoke.
• The smart contract leads to a non-determinism in Authz’s MsgGrant
where the grant expiration was suspected to default to the node’s
OS time if unset by the message sender.
• The reply() feature of CosmWasm allows calling a message and getting back its output events. With a couple of messages, a nondeterministic event ordering occurred in the Authz module, which
causes chain halt.

Proposal

  • Disable authz module on cosmwasm or wait for #12781 to be merged and update to that sdk

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@RafilxTenfen RafilxTenfen self-assigned this Aug 1, 2022
@RafilxTenfen RafilxTenfen mentioned this issue Aug 1, 2022
3 tasks
@RafilxTenfen RafilxTenfen changed the title Cosmwasm: (HAL-01) Cosmwasm: (HAL-01) VULNERABLE WASM SMART CONTRACT LEADS TO CHAIN HALT Aug 1, 2022
@bruce-wayne2
Copy link

At present, the problem can also be solved by upgrading the version of wasmd.
v0.28.0

https://github.com/CosmWasm/wasmd/blob/288609255ad92dfe5c54eae572fe7d6010e712eb/x/wasm/keeper/msg_dispatcher.go#L112

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