Brief/Intro The ZeroXSwapVerifier library fails to implement proper access control by ignoring the owner parameter throughout its verification functions. This allows any user to bypass intended authorization checks and verify swap actions on behalf of arbitrary addresses, potentially leading to unauthorized token transfers. Vulnerability Details Root Cause: The owner parameter is passed through all verification layers but is never validated against the actual transaction sender or used to restrict operations. Critical functions like _verifyTransferFrom and _verifySellToLiquidityProvider decode from addresses from actions but fail to verify they match the specified owner.
} mitigation Implement Comprehensive Access Control: Validate msg.sender == owner in all external functions Add Input Sanitization: Validate all decoded parameters from user-provided calldata Implement Role-Based Access Control: For complex permission scenarios Impact Complete access control bypass enabling: Unauthorized verification of TRANSFER_FROM actions from arbitrary addresses Impersonation of any user during swap verification Potential unauthorized token transfers if verification enables execution
References Add any relevant links to documentation or code Consensys Smart Contract Best Practices Access Control section Reference: https://consensys.github.io/smart-contract-best-practices/development-recommendations/solidity-specific/access-control/ Relevance: Specifically covers owner/role-based access patterns Solidity Documentation - Security Considerations Access Control patterns Reference: https://docs.soliditylang.org/en/latest/security-considerations.html#access-control
OpenZeppelin Access Control Ownable & AccessControl implementations Reference: https://docs.openzeppelin.com/contracts/4.x/access-control
Proof of Concept
Proof of Concept Test Output Confirmation: text [PASS] test_TransferFrom_AnyOwnerBypass() (gas: 9995) Logs: Testing: Attacker can use any fake owner address Test completed: TransferFrom action with fake owner was properly constructed Attack Scenario: Attacker crafts TRANSFER_FROM action transferring from Victim→Attacker Attacker calls verifySwapCalldata() with fake owner parameter Verification passes despite clear authorization violation If verification enables execution, victim's funds are at risk poc // SPDX-License-Identifier: MIT pragma solidity ^0.8.28;