64 matches found
incorrect commend and/or rounding issues in AutoPxGmx and AutoPxGlp
Lines of code Vulnerability details Impact The comments on the affected lines state previewWithdraw will round up. However, the implementation, an inner call to convertToShares is made, which actually calls mulDivDown. From further inspection, this pair of functions withdraw, previewWithdraw as...
Code is vulnerable to ERC4626 first depositor shares manipulation exploit
Lines of code Vulnerability details Proof of Concept The normal ERC4626 implementation which is not changed in the repository has a vulnerability which can result in the first depositor stealing every subsequent depositor’s funds. It works like this: 1. Vault is just deployed and Bob deposits jus...
Underlying assets stealing in AutoPxGmx and AutoPxGlp via share price manipulation
Lines of code Vulnerability details Impact pxGMX and pxGLP tokens can be stolen from depositors in AutoPxGmx and AutoPxGlp vaults by manipulating the price of a share. Proof of Concept ERC4626 vaults are subject to a share price manipulation attack that allows an attacker to steal underlying toke...
First depositer can break Vault share distributions
Lines of code Vulnerability details The calculation of exchange rate for shares in PirexERC4626 Vault is done by dividing the total supply of shares by the totalAssets of the vault. The first depositor can mint a very small number of shares, then donate to the vault to manipulate the share price...
AutoPxGlp and AutoPxGmx are not compliant with ERC4626 standard
Lines of code Vulnerability details Proof of Concept In both contracts, the previewWithdraw function has the same body // Calculate shares based on the specified assets' proportion of the pool uint256 shares = convertToSharesassets; // Save 1 SLOAD uint256 totalSupply = totalSupply; // Factor in...
Attackers can manipulate ERC4626 price per share to take an unfair share of future users
Lines of code Vulnerability details Impact The attacker can get funds from future users, and the future users will lose their funds. Proof of Concept A malicious early user can deposit with 1 wei of asset token and get 1 wei of shares. Then he/she can send 10000e18 - 1 of asset tokens and inflate...
Getting collateral value by calling previewRedeem can be manipulated
Lines of code Vulnerability details Proof of Concept The code in EscrowLib is trying to calculate the value of a collateral by calling the previewRedeem method of an ERC4626 vault, when the collateral is a token from such a vault. The EIP4626 specification explicitly says The preview methods retu...
Users cannot use mintWithSignature() function in most cases
Lines of code Vulnerability details Impact Function sfrxETH.mintWithSignature allows users to approve and mint in one transaction. Users will provide input param shares and function will calculate what assets amount needed to be approved in case approveMax = false. uint256 amount = approveMax ?...
Some users may not be able to withdraw till the end of the rewardsCycle, due to possible underflow in the function beforeWithdraw()
Lines of code Vulnerability details Impact In xERC4626.sol If an underflow occur in the function beforeWithdraw, some users may not be able to withdraw till the end of the rewardsCycle. storedTotalAssets is a cached value of total assets, which will only include the unlockedRewards, when the whol...
Upgraded Q -> H from 222 [1656255302682]
Judge has assessed an item in Issue 222 as High risk. The relevant finding follows: L-02 totalAssets of erc4626 should never revert eip-4626 According to the spec, totalAssets of erc4626 should never revert MUST NOT revert. wfcash would revert if it's matured but hasn't settled...
Withdraw function does not conform to EIP4626
Lines of code Vulnerability details Impact The withdraw of wfCashERC4626 is not 4626 compatible. wfCashERC4626.solL186-L191 According to EIP4626 Burns shares from owner and sends exactly assets of underlying tokens to receiver. The withdraw function of ERC4626 should send the exact same amount of...
Re-entrancy in wfCashERC4626.withdraw() can lead to more gains in assets
Lines of code Vulnerability details This is a corrected version of the previous submission and typo mistakes corrected. Impact The withdraw function in wfCashERC4626.sol can be re-entered at the point of redeemInternal. Assume asset tokens are sent to receiver after shares are burnt, and user...
Re-entrancy in wfCashERC4626.withdraw() can lead to more gains in assets
Lines of code Vulnerability details Impact The withdraw function in wfCashERC4626.sol can be re-entered at the point of redeemInternal. Assume asset tokens are sent to receiver after shares are burnt, and user re-enters withdraw after redeemInternal is completed., P.S: there's a separate issue on...
Loss of underlying tokens due to ERC4626 non-compliance in redeem function in wfCashERC4626.sol
Lines of code Vulnerability details Impact Similar to the report I sent earlier on the issue of The withdraw function in wfCashERC4626.sol, the redeem function is missing the code that transfers the underlying tokens to the receiver. According to the EIP-4626 standard, redeem function Burns share...
Loss of underlying tokens due to ERC4626 non-compliance in withdraw function in wfCashERC4626.sol
Lines of code Vulnerability details Impact The withdraw function in wfCashERC4626 is missing the code that transfers the underlying tokens to the receiver. According to the EIP-4626 standard, withdraw function Burns shares from owner and sends exactly assets of underlying tokens to receiver...
[WP-M3] TurboRouter.sol#createSafeAndDeposit*() CreateSafeAndDeposit combo methods won't work as an allowance cannot be granted to a newly created Safe for deposit
Lines of code Vulnerability details The TurboRouter.soldeposit function can be used in a multicall together with approve and pullToken from PeripheryPayments to pull tokens from msg.sender and grant allowance for the ERC4626 Safe to call asset.safeTransferFrom with the msg.sender being the router...
ERC4626.mint() doesn't mint the correct amount
Lines of code Vulnerability details Impact The ERC4626.mint function doesn't mint the correct amount of tokens. Instead of minting amount number of tokens, it should mint shares number of tokens. Since the user doesn't receive the correct amount of tokens I'd rate this issue "HIGH". Proof of...
ERC4626 mint uses wrong amount
Lines of code Vulnerability details Impact The docs/video say ERC4626.sol is in scope as its part of TurboSafe The ERC4626.mint function mints amount instead of shares. This will lead to issues when the asset shares are not 1-to-1 as will be the case for most vaults over time. Usually, the asset...
ERC4626 does not work with fee-on-transfer tokens
Lines of code Vulnerability details Impact The docs/video say ERC4626.sol is in scope as its part of TurboSafe The ERC4626.deposit/mint functions do not work well with fee-on-transfer tokens as the amount variable is the pre-fee amount, including the fee, whereas the totalAssets do not include th...
ERC4626 mints more shares than it should
Lines of code Vulnerability details bug in the mint function of the ERC4626 contract The mint function recieves an amount of shares and an address to and mints the amount of shares to the to address. The sender must transfer an amount of token, so that the ratio will be saved - shares / totalShar...