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

KatanaGovernance::_isAuthorized function allows user to perform action even after expiry time has passed. #43

Closed
howlbot-integration bot opened this issue Nov 4, 2024 · 1 comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-22 edited-by-warden 🤖_18_group AI based duplicate group recommendation sufficient quality report This report is of sufficient quality unsatisfactory does not satisfy C4 submission criteria; not eligible for awards

Comments

@howlbot-integration
Copy link

Lines of code

https://github.com/ronin-chain/katana-operation-contracts/blob/27f9d28e00958bf3494fa405a8a5acdcd5ecdc5d/src/governance/KatanaGovernance.sol#L375-L381

Vulnerability details

Proof of Concept

If current block time is greater than expiry time then _isAuthorized function returns true.
This logic allow users to perform action even after the expiry time has ended which could allow users to perform unauthorized actions and make project unstable and.

Recommended Mitigation Steps

/**
   * @dev Checks if an account is authorized.
   * @param account The address of the account to check authorization for.
   * @return A boolean indicating whether the account is authorized or not.
   */
  function _isAuthorized(Permission storage $, address account) private view returns (bool) {
    uint256 expiry = $.whitelistUntil;
    if (expiry == UNAUTHORIZED) return false;
    // if (expiry == AUTHORIZED || block.timestamp > expiry) return true;
    if (expiry == AUTHORIZED || block.timestamp < expiry) return true;

    return $.allowed[account];
  }

Assessed type

Access Control

@howlbot-integration howlbot-integration bot added 3 (High Risk) Assets can be stolen/lost/compromised directly 🤖_18_group AI based duplicate group recommendation bug Something isn't working duplicate-22 edited-by-warden sufficient quality report This report is of sufficient quality labels Nov 4, 2024
howlbot-integration bot added a commit that referenced this issue Nov 4, 2024
@c4-judge c4-judge added the unsatisfactory does not satisfy C4 submission criteria; not eligible for awards label Nov 11, 2024
@c4-judge
Copy link

alex-ppg marked the issue as unsatisfactory:
Invalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-22 edited-by-warden 🤖_18_group AI based duplicate group recommendation sufficient quality report This report is of sufficient quality unsatisfactory does not satisfy C4 submission criteria; not eligible for awards
Projects
None yet
Development

No branches or pull requests

1 participant