Closed bijoy26 closed 4 years ago
Do we really need this?..sequenceNumber
applies only to msg.sender
who is the election taskMaster...this is only useful when voters are interacting with the contract directly
I think you are correct. The only address that is making the transaction is of election auditor's. And also, he is the only guy authorized to do multiple transactions from same address.
We can simply put a check if the msg.sender is one of the valid election auditor's access when the vote() function runs and we won't be needing nonce checking then.
For this case, we need sequencenumber check. Though Ethereum has this flaw, I'm not sure if Matic has the exact security issue. We can skip it for now if it seems inconvenient to implement nonce check.
OK... Will implement the onlyAuditor
and nonce
checks then update the contract ABI
@Timidan Mention this issue, move it to 'Done' and close it when you push onlyAuditor
enabled contract on the repo.
Done!
Task Handler : @Timidan
Replay Attack
Replay attacks are addressed in ethereum by following -
In Matic, replay attack is likely to occur on Ante Handler -
Using the above information, you job is to properly pass a parameter
sequenceNumber
(which basically the nonce) on the vote() function and keep a mapping check to ensure the transaction is executed only onceEdit-1 :
We are addressing "Replay attack" by Implementing 'onlyAuditor modifier'
We keep the issue of addressing "Cross-contract Replay attack" for future work.
It can be performed by using OpenZeppelin library's 'Upgradeable contracts' feature which allows upgrading existing contracts without changing the deployed address.
If we have a storage and proxy contract, it is possible to perform Update functions to the already deployed contracts through openzeppelin-cli.