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 and unexpected parameters passed to constructor in KatanaV3PoolProxy. #40

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-26 🤖_primary AI based primary 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-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/core/KatanaV3PoolProxy.sol#L11

Vulnerability details

Description

This KatanaV3PoolProxy contract have a constructor with parameter as address(0) passed to beaconProxy contract which further _setBeacon with zero address. This address(0) is passed as beacon address to beaconProxy and then beaconProxy contract's constructor call _setBeacon function with address(0) as beacon. This _setBeacon function has a check which revert this call require(Address.isContract(beacon),"BeaconProxy: beacon is not a contract");.

Impact

KatanaV3PoolProxy contract always revert on deployment, restricted code or dead contract. Because this can never be initialized.

Proof of Concepts

  • address(0) passed from KatanaV3PoolProxy contract:
    constructor() BeaconProxy(address(0), "") { }

  • BeaconProxy's Contructor called _setBeacon:

constructor(address beacon, bytes memory data) payable {
       assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1));
       _setBeacon(beacon, data);
   }
  • _setBeacon requires checks:
function _setBeacon(address beacon, bytes memory data) internal virtual {
        require(
            Address.isContract(beacon),
            "BeaconProxy: beacon is not a contract"
        );
  • So address(0) can't be a contract's address, It reverts.

Assessed type

Other

@howlbot-integration howlbot-integration bot added 3 (High Risk) Assets can be stolen/lost/compromised directly 🤖_primary AI based primary recommendation bug Something isn't working duplicate-26 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
Copy link

alex-ppg marked the issue as unsatisfactory:
Invalid

@c4-judge c4-judge added the unsatisfactory does not satisfy C4 submission criteria; not eligible for awards label Nov 11, 2024
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-26 🤖_primary AI based primary 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