Closed code423n4 closed 1 year ago
raymondfam marked the issue as low quality report
Invalid assumptions.
HickupHH3 marked the issue as duplicate of #40
Therefore, the msg.sender has to be equal to both the trustedExecutor and the _originChainOwner for any calls to the contract to work.
This isn't true; the _msgSender()
in
if (_msgSender() != address(_originChainOwner)) revert OriginSenderNotOwner(_msgSender());
is the appended address to the end of msg.data
(as per ERC-2771), not msg.sender
itself.
HickupHH3 changed the severity to QA (Quality Assurance)
HickupHH3 marked the issue as grade-c
Lines of code
https://github.com/GenerationSoftware/remote-owner/blob/285749ab51e98afc8ebb4e4049a4348d669a3e9d/src/RemoteOwner.sol#L96-L109
Vulnerability details
Impact
Admin calls are verified by the
_checkSender()
. But there is a function that bricks the contract.This is as a result of the check.
Proof of Concept
If we look at the
isTrustedExecutor()
function :where the trustedExecutor is an immutable value set in the constructor.
Therefore, the msg.sender has to be equal to both the
trustedExecutor
and the_originChainOwner
for any calls to the contract to work. If the functionsetOriginChainOwner()
is called, it changes the_originChainOwner
but cannot change thetrustedExecutor
. Hence anytime__checkSender()
is called within a function, the call reverts.The code comments says that the function can be called once, But i believe the function should never be called. Both the
trustedExecutor
and the_originChainOwner
have been set in the constructor. Hence changing any value would either brick the contract or revert if they weren't equal previouslyTools Used
Manual Review https://github.com/GenerationSoftware/ERC5164/blob/main/src/abstract/ExecutorAware.sol https://github.com/GenerationSoftware/remote-owner/blob/285749ab51e98afc8ebb4e4049a4348d669a3e9d/src/RemoteOwner.sol
Recommended Mitigation Steps
Remove the function from the contract completely
Assessed type
DoS