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

Permissions - notSameBlock is insufficient for reentrancy protection #341

Closed
code423n4 opened this issue Dec 1, 2021 · 3 comments
Closed
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 invalid This doesn't seem right

Comments

@code423n4
Copy link
Contributor

Handle

ScopeLift

Vulnerability details

Impact

TBD how bad the impact is

The docs mention that the notSameBlock modifier (and associated _notSameBlock() method) is used to guard against reentrancy. However, users can still call a method twice in a single transaction by using transferring assets/positions between two accounts they control, and re-entering with the other account

Proof of Concept

N/A

Tools Used

Recommended Mitigation Steps

Change notSameBlock to a standard reentrancy guard such as this one from Solmate

abstract contract ReentrancyGuard {
    uint256 private reentrancyStatus = 1;

    modifier nonReentrant() {
        require(reentrancyStatus == 1, "REENTRANCY");
        reentrancyStatus = 2;
        _;
        reentrancyStatus = 1;
    }
}
@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Dec 1, 2021
code423n4 added a commit that referenced this issue Dec 1, 2021
@0xScotch 0xScotch added the duplicate This issue or pull request already exists label Dec 8, 2021
@0xScotch
Copy link
Collaborator

0xScotch commented Dec 8, 2021

#195

@GalloDaSballo
Copy link
Collaborator

Duplicate of #195

@GalloDaSballo GalloDaSballo marked this as a duplicate of #195 Jan 9, 2022
@GalloDaSballo GalloDaSballo added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value and removed 3 (High Risk) Assets can be stolen/lost/compromised directly labels Jan 9, 2022
@GalloDaSballo
Copy link
Collaborator

This is a duplicate submission by the same warden, making as invalid

@GalloDaSballo GalloDaSballo added the invalid This doesn't seem right label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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 invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants