tx.origin may be removed in future and its usage is not recommended #204
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
low quality report
This report is of especially low quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/nounsDAO/nouns-monorepo/blob/718211e063d511eeda1084710f6a682955e80dcb/packages/nouns-contracts/contracts/governance/NounsDAOLogicV2.sol#L1043
Vulnerability details
Impact
There is a chance that tx.origin will be removed from the Ethereum protocol in the future, so code that uses tx.origin must be avoid using it.
There is also some EIPs being proposed for change/remove of tx.origin.
ethereum/EIPs#637
https://www.reddit.com/r/ethereum/comments/6d11lv/erc_about_txorigin_change_for_account_abstraction/
In NounsDAOLogicV2.sol,
Here, the function has used tx.origin as recipient to refund the amount but these can not work in future if the new EIPs concerning to remove tx.origin removal due to security issues got approved and tx.origin is removed from Ethereum protocol.
Proof of Concept
https://github.com/nounsDAO/nouns-monorepo/blob/718211e063d511eeda1084710f6a682955e80dcb/packages/nouns-contracts/contracts/governance/NounsDAOLogicV2.sol#L1043
For example:
In NounsDAOV3Votes.sol, the same function logic has used msg.sender instead of tx.origin. The same should be considered in NounsDAOLogicV2.sol,
Tools Used
Manual review
Recommended Mitigation Steps
Use msg.sender instead of tx.origin.
Assessed type
Other
The text was updated successfully, but these errors were encountered: