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

Feat.Req - Address frontrun security #3

Open
hopeyen opened this issue Feb 3, 2023 · 0 comments
Open

Feat.Req - Address frontrun security #3

hopeyen opened this issue Feb 3, 2023 · 0 comments

Comments

@hopeyen
Copy link
Collaborator

hopeyen commented Feb 3, 2023

Due to the preferred restriction of 1:1 relationship between indexer and Graphcast agent, there exist a vulnerability for indexers who submits a transaction to set their Graphcast agent, in which a malicious actor can frontrun transactions to disabled someone from setting the desired agent address.

POC

  • Alice wants to set her operator to 0x1234.
    She calls setGossipOperator(0x1234).

  • ​Malicious Bob sees this in the mempool and sends another setGossipOperator(0x1234) with higher gas price.

  • After Bob's tx succeeds, Alice's will fail because operatorRegistered[0x1234] is already set.

Potential solutions

  1. commit/reveal scheme like ENS: first transaction with hash of gossip address, second transaction reveals the preimage and claims it
  2. Instead of requiring the address field for Graphcast operator, instead require a message signed by the operator private key. Message object should contain both operator address and the message sender address. The contract verify the msg.sender and message signature
@hopeyen hopeyen changed the title Feat.Req - Feat.Req - Address frontrun security Feb 3, 2023
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

1 participant