Skip to content
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

Openzeppelin Contract Vulnerability #99

Closed
code423n4 opened this issue Jan 8, 2022 · 2 comments
Closed

Openzeppelin Contract Vulnerability #99

code423n4 opened this issue Jan 8, 2022 · 2 comments
Labels
bug Something isn't working invalid This doesn't seem right sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue

Comments

@code423n4
Copy link
Contributor

Handle

defsec

Vulnerability details

Impact

Initializer functions that are invoked separate from contract creation (the most prominent example being minimal proxies) may be reentered if they make an untrusted non-view external call.

Once an initializer has finished running it can never be re-executed. However, an exception put in place to support multiple inheritance made reentrancy possible in the scenario described above, breaking the expectation that there is a single execution.

Note that upgradeable proxies are commonly initialized together with contract creation, where reentrancy is not feasible, so the impact of this issue is believed to be minor.

Proof of Concept

  1. Go to contracts directory.

  2. On the package.json, openzeppelin 4.1.0 is defined.

https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Convenience/package.json

Tools Used

None

Recommended Mitigation Steps

Avoid untrusted external calls during initialization.

A fix is included in the version v4.4.1 of @openzeppelin/contracts and @openzeppelin/contracts-upgradeable.

Reference

GHSA-9c22-pwxw-p6hx

@code423n4 code423n4 added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working labels Jan 8, 2022
code423n4 added a commit that referenced this issue Jan 8, 2022
@Mathepreneur Mathepreneur added the sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue label Jan 18, 2022
@Mathepreneur
Copy link
Collaborator

We are not using initializer.

@0xean
Copy link
Collaborator

0xean commented Jan 25, 2022

closing as invalid.

@0xean 0xean closed this as completed Jan 25, 2022
@0xean 0xean added invalid This doesn't seem right and removed 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments labels Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Projects
None yet
Development

No branches or pull requests

3 participants