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

Add contract codehash verification to Add exisiting contract #6692

Open
agryaznov opened this issue Dec 16, 2021 · 0 comments
Open

Add contract codehash verification to Add exisiting contract #6692

agryaznov opened this issue Dec 16, 2021 · 0 comments

Comments

@agryaznov
Copy link
Contributor

Currently it is possible to imperceptibly forge contract, i.e. add existing contract with codeHash other than that one specified in ABI

Context

We have two contracts:

  1. normal candle_ok.contract (src)
  2. malicious modified candle_mal.contract (src)

(both contract builds are attached to this issue)

Steps to reproduce:

  1. Upload & Instantiate malicious contract
  2. (better in other browser session) Click on Add existing contract, upload ABI of normal contract, but specify the address of the malicious contract instance

Preferred behavior:
Compare the codeHash of contract at specified address with the one specified in ABI, and since it differs, return an error

Actual behavior:
UI shows everything is fine

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

No branches or pull requests

2 participants