Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Valid

Incorrect Revert Error Signatures in `mulWad` and `mulWadUp` Functions

Summary

The revert errors in the mulWad and mulWadUp functions are not correctly linked to their respective error messages. Specifically, the error signatures used do not match the expected 4-byte error selector for MathMasters__MulWadFailed().

Vulnerability Details

In both mulWad and mulWadUp functions, the revert error is intended to be MathMasters__MulWadFailed(). However, the hardcoded 4-byte error signatures in these functions (0xbac65e5b) do not match the actual 4-byte selector for MathMasters__MulWadFailed() (0xa56044f7). This discrepancy means that when a revert occurs due to these errors, the intended error message is not correctly displayed, potentially leading to confusion and difficulty in debugging.

POC

Poc:

cast sig "MathMasters__MulWadFailed()"
> 0xa56044f7
cast 4byte 0xbac65e5b
> MulWadFailed()

Impact

The primary impact of this issue is on the clarity and transparency of error handling. Developers relying on accurate revert messages for debugging will not receive the correct error information. This could lead to an increased difficulty in identifying and fixing issues related to multiplication operations handled by these functions.

Tools Used

Manual revision, cast for POC

Recommendations

To resolve this issue, update the revert error signatures in both the mulWad and mulWadUp functions to match the correct 4-byte selector for MathMasters__MulWadFailed(), which is 0xa56044f7. This change ensures that the correct error message is displayed when a revert occurs. Additionally, it's recommended to establish a practice of verifying error signatures as part of the development process to avoid similar issues in the future.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Wrong error selector

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.