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

Wrong revert message #171

Open
code423n4 opened this issue Jan 6, 2022 · 2 comments
Open

Wrong revert message #171

code423n4 opened this issue Jan 6, 2022 · 2 comments
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

Handle

Czar102

Vulnerability details

Impact

Wrong revert messages might lead to confusion.

Proof of Concept

In line 52 of XDEFIDistribution, the reason for a fail of a reentrant call is "LOCKED". In DeFi, it usually means that contract's functionality is temporarily limited. This is not true in this case.

Recommended Mitigation Steps

Consider changing the revert string to "REENTRY_NOT_ALLOWED".

@code423n4 code423n4 added 0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working labels Jan 6, 2022
code423n4 added a commit that referenced this issue Jan 6, 2022
@deluca-mike deluca-mike added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Jan 8, 2022
@deluca-mike
Copy link
Collaborator

Valid point. We are going to use if-reverts with custom error messages, and therefore it will be error NoReentering();

@deluca-mike
Copy link
Collaborator

This was done in release candidate contract via custom error messages. For this specific case, the custom error message is defined here and thrown here.

@deluca-mike deluca-mike added the resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) label Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

2 participants