diamondCut
doesn't validate _init
and _calldata
#159
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
duplicate
This issue or pull request already exists
Lines of code
https://github.com/code-423n4/2022-06-connext/blob/4dd6149748b635f95460d4c3924c7e3fb6716967/contracts/contracts/core/connext/libraries/LibDiamond.sol#L95-L118
Vulnerability details
Malicious or compromised governance can send a different
_init
and_calldata
payload than the one that was proposed. This is dangerous as they will be used for adelegatecall
operation. An attacker can pretend to propose a safe upgrade and later execute adelegatecall
to steal funds orselfdestruct
the system.Proof of Concept
_init
and_calldata
._init
pointing to a malicious contract, stealing funds from the system.Recommended Mitigation Steps
Consider hashing
_init
and_calldata
alongside_diamondCut
as theacceptanceTimes
key, to ensure the execution will use the same payload.The text was updated successfully, but these errors were encountered: