-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Fix TransparentUpgradeableProxy's transparency #4154
Fix TransparentUpgradeableProxy's transparency #4154
Conversation
🦋 Changeset detectedLatest commit: b082da8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…Amxx/openzeppelin-contracts into fix/TransparentUpgradeableProxy/ifAdmin
…arentUpgradeableProxy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix looks good to me but all of the checks are failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a minor comment
Co-authored-by: Ernesto García <ernestognw@gmail.com> Co-authored-by: Francisco <fg@frang.io>
Co-authored-by: Francisco <fg@frang.io> Co-authored-by: Ernesto García <ernestognw@gmail.com> (cherry picked from commit 5523c14)
/** | ||
* @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. | ||
* | ||
* _Available since v4.9._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct since it's released as part of v4.8.3
. Will open a PR @Amxx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI #4183
The TransparentUpgradeableProxy uses the
ifAdmin
modifier to achieve transparency. If a non-admin address calls the proxy the call should be frowarded transparently. This works well in most cases, but the forwarding of some functions can fail if there is a selector conflict and decoding issue.Lets consider the
upgradeTo(address)
function. The associated function selector is0x16a27ecd
.If the implementation ever includes another function signature that happens to:
Then calling this function would not be possible. Any call would match
upgradeTo(address)
on the proxy, and before theifAdmin
proxy has any chance to redirect the call, the abi decoder would fail to retrieve the expected address.This could be used by malicious a developer to block access to functions that is correctly implemented.
PR Checklist
npx changeset add
)