-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update initializer modifier to prevent reentrancy during initialization #57
Comments
This is valid, but the scope is restricted to having a corrupt proxy admin, as during deployment initialization is done in the proxy constructor (and even if it wasn't, there is basically nothing at risk during initial deployment). |
While I appreciate the in depth finding, I don't see any external calls made in any of the |
As far as I'm aware, contracts containing an |
Merging into #60 and marking as |
Lines of code
https://github.com/aave/lens-protocol/blob/main/package.json#L74
https://github.com/code-423n4/2022-02-aave-lens/blob/main/contracts/upgradeability/VersionedInitializable.sol#L20-L21
https://github.com/aave/protocol-v2/blob/6a503eb0a897124d8b9d126c915ffdf3e88343a9/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol#L2
https://github.com/aave/protocol-v2/commits/6a503eb0a897124d8b9d126c915ffdf3e88343a9/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol
OpenZeppelin/openzeppelin-contracts#3006
Vulnerability details
This is mainly a risk I feel should be brought to the sponsor's and the judge's attention. I can't fully exploit and remediate to this, but I'll try to be as clear as possible in every steps, as it might be a high risk finding.
The issue
The solution uses
"@openzeppelin/contracts": "4.4.0"
(https://github.com/aave/lens-protocol/blob/main/package.json#L74)This version has a known high risk vulnerability on
initializer
: https://snyk.io/test/npm/@openzeppelin/contracts/4.4.0 . This finding was published and disclosed around December 15th 2021. Here's the pull request: OpenZeppelin/openzeppelin-contracts#3006However, this solution doesn't use OpenZeppelin's Initializable: it instead implements its own
VersionedInitializable
, inspired from Aave's version: https://github.com/aave/protocol-v2/blob/6a503eb0a897124d8b9d126c915ffdf3e88343a9/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol#L2But this Aave Initializable is still inspired from the old OpenZeppelin's Initializable, and the last commit is from January 27th 2021 (almost a year before the
4.4.0
's vulnerability discovery) : https://github.com/aave/protocol-v2/commits/6a503eb0a897124d8b9d126c915ffdf3e88343a9/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol .With these lack of up-to-date information / versions and commit in mind: I believe the same vulnerability discovered in OpenZeppelin's Initializable 2 months ago can be replicated here and should be paid attention to.
While this is certainly a potential finding found by searching, a more experienced security researcher is needed to fully prove with a POC that
VersionedInitializable
is indeed vulnerable.The text was updated successfully, but these errors were encountered: