Skip to content

Add contract codehash verification to Add exisiting contract #6692

@agryaznov

Description

@agryaznov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions