RustFund

First Flight #36
Beginner FriendlyRust
100 EXP
View results
Submission Details
Severity: low
Invalid

Unused `ErrorCode::UnauthorizedAccess` Definition

Summary

The codebase defines an ErrorCode::UnauthorizedAccess in the error enumeration, but no actual usage occurs. This creates confusion and potentially missed security checks.

Vulnerability Details

  • The error code is declared, but the contract logic never invokes it.

  • Typically, an UnauthorizedAccess error is used in permission checks or role checks (e.g., only the creator can withdraw), but the code is either relying on other mechanisms or missing the check entirely.

Impact

  • Misleading Code: Auditors or maintainers might assume there is an active check for unauthorized access where none exists.

  • Possible Future Oversight: Developers might add new features or rely on a nonexistent pattern, leading to real vulnerabilities.

Tools Used

  • Manually view all calls and checks in functions. Recommendations

Recommendations

  • Either integrate the use of ErrorCode::Unauthorized Access where explicit verification of rights is required (for example, when withdrawing funds if the success condition is not met), or remove it from the list for clarity.

  • To refactor the code so that all the defined ErrorCode have a practical application.

Updates

Appeal created

bube Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

[Invalid] Unused `UnauthorizedAccess` error

This is informational finding, there is no impact for the protocol.

Support

FAQs

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