    function execute(Module[] calldata modules, bytes[] calldata calls, bool revertOnFail)
    function _processMarketOperation(
        address _target,
        bytes calldata _actionCalldata,
        uint256 _actionValue,
        bool _allowFailure
    ) private {
        if (!cluster.isWhitelisted(0, _target)) revert Magnetar_NotAuthorized(_target, _target);

        /// @dev owner address should always be first param.
        // addCollateral(address from,...)
        // borrow(address from,...)
        // addAsset(address from,...)
        // repay(address _from,...)
        // buyCollateral(address from,...)
        // sellCollateral(address from,...)
        bytes4 funcSig = bytes4(_actionCalldata[:4]);
        if (
            funcSig == IMarket.execute.selector || funcSig == ISingularity.addAsset.selector /// @audit ??????
                || funcSig == ISingularity.removeAsset.selector
        ) {
            /// @dev Owner param check. See Warning above.
            _checkSender(abi.decode(_actionCalldata[4:36], (address))); /// @audit we can forge this 80%
            _executeCall(_target, _actionCalldata, _actionValue, _allowFailure);
            return;
        }
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import {Test} from "forge-std/Test.sol";
import {console2} from "forge-std/console2.sol";

contract MockCallerChecker {

  function doTheCheck(bytes calldata _actionCalldata) external {
    console2.log("Calldata Length", _actionCalldata.length);
    _checkSender(abi.decode(_actionCalldata[4:36], (address)));
  }

  function _checkSender(address entry) internal {
    console2.log("msg.sender", msg.sender);
    console2.log("entry", entry);
    require(msg.sender == entry);
  }
}


contract BasicTest is Test {
    // 4 bytes is funsig 0xaaaaaaaa
    // 32 bytes are the address (since abi.encoding uses a full word)
    // 0000000000000000000000000000000000000000111111111111111111111111
    bytes data = hex"aaaaaaaa0000000000000000000000000000000000000000111111111111111111111111";

    function testDemo() public {
      MockCallerChecker checker = new MockCallerChecker();
      console2.log(data.length);

      // Same address as the length
      vm.prank(address(0x111111111111111111111111));
      checker.doTheCheck(data);

      // For a real exploit, all we have to do is find the cheapest between available addresses and one we can mine
    }
}
Logs:
  36
  Calldata Length 36
  msg.sender 0x0000000000000000111111111111111111111111
  entry 0x0000000000000000111111111111111111111111

Traces:
  [217996] BasicTest::testDemo()
     [169614]  new MockCallerChecker@0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f
         847 bytes of code
     [0] console::log(36) [staticcall]
         ()
     [0] VM::prank(0x0000000000000000111111111111111111111111)
         ()
     [2931] MockCallerChecker::doTheCheck(0xaaaaaaaa0000000000000000000000000000000000000000111111111111111111111111)
        [0] console::log("Calldata Length", 36) [staticcall]
            ()
        [0] console::log("msg.sender", 0x0000000000000000111111111111111111111111) [staticcall]
            ()
        [0] console::log("entry", 0x0000000000000000111111111111111111111111) [staticcall]
            ()
         ()
      ()
