10190 matches found
It is possible to override pool params in PoolRegistry.sol since the creator field is never set for a venus pool
Lines of code Vulnerability details Proof of Concept PoolRegistry.createPoolRegistry will call PoolRegistry.registerPool which will make a check on the creator field for a pool. VenusPool memory venusPool = poolByComptrollercomptroller; requirevenusPool.creator == address0, "PoolRegistry: Pool...
Lack of method to delete a rewardsDistributor in Comptroller.sol can break rewards distribution permanently
Lines of code Vulnerability details Proof of Concept The storage array rewardsDistributors will be used to distribute the rewards across the hooks in Comptroller.sol, namely preMintHook, preRedeemHook, preBorrowHook, preRepayHook, preSeizeHook and preTransferHook We can see addRewardsDistributor...
Holders only get the rewards they Accrued for supplying when they claim rewards in the RewardsDistributor.sol .
Lines of code Vulnerability details Holders only get the rewards they Accrued for supplying when they claim rewards in the RewardsDistributor.sol . Summary The holder only gets rewards for supplying instead of getting the rewards for both borrowing and supplying in martkets because in the...
Bad debt auctions can be DoSed forever
Lines of code Vulnerability details Vulnerability Details For function Shortfall::placeBid in shortfall contract on L183 and L190 , the previous highest bidder’s funds stored in the shortfall contract has to be sent back to the bidder. This operation has to be successful before any new bid can be...
vTokenPrice used instead of weightedVTokenPrice when calculating snapshot.totalCollateral in _getHypotheticalLiquiditySnapshot
Lines of code Vulnerability details Impact In the getHypotheticalLiquiditySnapshot function when the value of snapshot.totalCollateral is calculated the vTokenPrice is used instead of weightedVTokenPrice, this will lead the function to return the wrong value for snapshot.totalCollateral resulting...
A user asset cannot be seized if the supplied market's collateral to seize(vTokenCollateral)is different than the pool(seizerContract) where the liquidateBorrow function is called.
Lines of code Vulnerability details Impact A user asset cannot be seized if the supplied market's collateral to seizevTokenCollateralis different than the poolseizerContract where the liquidateBorrow function is called. Proof of Concept A user asset cannot be seized if the supplied market's...
First 1 wei deposit can produce lose of user xETH funds in wxETH
Lines of code Vulnerability details Description The present implementation of the wxETH::stake functions permits the sending of tokens to the contract, even if the quantity of wxETH is zero. This can result in users losing funds, particularly when the initial deposit is only 1 wei, and the extent...
Missing transaction expiration check result in asset tokens selling at a lower price
Lines of code Vulnerability details Impact Selling of asset tokens misses the transaction expiration check, which may lead to reward tokens being sold at a price that's lower than the market price at the moment of a swap. Proof of Concept The swapAsset function, which is responsible for selling...
Virgin stake can claim all drops
Lines of code Vulnerability details Impact If wxETH drips when nothing is staked, then the first staker can claim every drop. Proof of Concept Suppose drip is enabled when totalSupply == 0. At least one block passes and the first staker stakes, just 1 xETH is enough. This mints her 1 wxETH. This...
Malicious actor can win auction unfavorably to the protocol by block stuffing
Lines of code Vulnerability details Vulnerability Details When protocol’s bad debt is auctioned off with 10% incentive at the beginning. A user who gives the best bid, wins. The auction ends when at least one account placed a bid, and current block number is bigger than nextBidderBlockLimit:...
User can bypass _ensureMaxLoops check
Lines of code Vulnerability details Impact The user can bypass ensureMaxLoops check in Comptroller.sol to add in accountAssets all possible markets through borrow functions of VToken.sol. Proof of Concept The user adds max number of markets through enterMarkets. Then user can add another markets...
Wrong blocksPerYear in WhitePaperInterestRateModel
Lines of code Vulnerability details Impact Venus is deployed on BNB Chain instead of Ethereum. Their block times are different. And WhitePaperInterestRateModel.sol is modified from compound. Therefore, blocksPerYear should be modified or Venus would get the wrong rate when using...
Bad debt bidders’ funds are locked forever when Shortfall address is changed during ongoing debt auction
Lines of code Vulnerability details Vulnerability Details When the protocol accrues bad debt, it can be auctioned off to anyone who is willing to pay. Each user wanting to participate in the auction has to lock their bid in Shortfall contract: function placeBidaddress comptroller, uint256 bidBps...
Inadequate checks for comptroller in PoolRegistry#addMarket allows malicious comptrollers to be added
Lines of code Vulnerability details Impact Malicious comptrollers will be available in the protocol Proof of Concept The addMarket function only checks that the input.comptroller is not the 0 address, but does not check if the comptroller was actually created by the PoolRegistry contract. A...
preBorrowHook and preRepayHook can call updateRewardTokenBorrowIndex with old borrowIndex
Lines of code Vulnerability details Impact Under normal circumstances, the user calls VToken.borrow, further calls accrueInterest to update borrowIndex, and then calls preBorrowHook to trigger updateRewardTokenBorrowIndex. But since preBorrowHook is an externl function, an attacker can directly...
Deflation bricking
Lines of code Vulnerability details Impact First staker can block staking by making exchangeRate == 0. Proof of Concept As can be seen function exchangeRate public view returns uint256 /// @dev if there are no tokens minted, return the initial exchange rate uint256 totalSupply = totalSupply; if...
AMO2 doesn't add the lp balance of the CVXStaker to the withdrawable token amount
Lines of code Vulnerability details Impact The lp tokens held by CVXStaker can't be able to used or withdrew by AMO2. Although the jam is not permanent and the owner of the CVXStaker can use recoverToken function to withdraw them, it will cause the functions about removing liquidity break down in...
getAccountSnapShot always returns NO_ERROR no matter what's its inputs is.
Lines of code Vulnerability details Impact In the safeGetAccountSnapShot function, it seems the getAccountSnapshot always return NOERROR, so the checking if err != 0 revert SnapshotErroraddressvToken, user; Becomes meaningless because err is always equal to 0. This may lead to critical issues...
Precision differences when calculating the _startAuction of funds accumulated in RiskFund
Lines of code Vulnerability details Impact When calculating startAuction uint256 usdValue in RiskFund, Auction state divides the value of each market in the vToken list in token list precision. This skew is fine for most tokens but will cause problems with certain token pairs. Proof of Concept Wh...
Incorrect calculation of the remaining updatedRewards leads to possible underflow error
Lines of code Vulnerability details Impact RewardsManage.sol keeps track of the total number of rewards collected per epoch for all pools: File: 2023-05-ajna\ajna-core\src\RewardsManager.sol 73: /// @dev epoch = rewards claimed mapping. 74: mappinguint256 = uint256 public override rewardsClaimed;...
Inconsistence input of depositTime might lead to unexpected result
Lines of code Vulnerability details Impact Inconsistency by relying on depositTime at positions hashmap instead of reading the value from lenderInfo Proof of Concept The depositTime is being read from fromPosition.depositTime at moveLiquidity function and not from lenderInfo L268 and L285...
Lack of Access Control in claimRewards Function
Lines of code Vulnerability details Impact The calculateNewRewards function should also check whether the rewardsCapped variable is greater than the rewardsClaimedInEpoch variable to ensure that rewards are not claimed that exceed the reward cap, because an attacker could exploit this vulnerabili...
Treasury accounting miss voters rewards
Lines of code Vulnerability details treasury is overstated over time as each distribution period it adds back the delegate rewards part, which is actually spent on voters rewards. I.e. it is updated with fundsAvailable - totalTokensRequested difference, while totalTokensRequested is limited to 90...
_updateBucketExchangeRates could possibly revert
Lines of code Vulnerability details Impact updateBucketExchangeRates will not work correctly and would revert in case totalBurnedLatest totalBurnedAtBlock causing DOS for the users when they try to claimRewards, moveStakedLiquidity, stake or unstake. Proof of Concept When the curBurnEpoch doesn't...
NOT CONFIRMED
Lines of code L1 Vulnerability details NOT CONFIRMED Assessed type Decimal --- The text was updated successfully, but these errors were encountered: All reactions...
Race condition vulnerability in positionManager minting function
Lines of code Vulnerability details Impact race condition vulnerability can result in the issuance of duplicate token IDs. When multiple transactions are executed in quick succession attempting to mint tokens, they may end up being assigned the same ID due to a shared counter or variable used to...
Lack of Access Control in GrantFund Smart Contract's fundTreasury Function
Lines of code Vulnerability details Impact The fundTreasury function in the GrantFund.sol contract allows anyone to add funds to the contract's treasury without any access control, which can lead to unauthorized access to the contract's funds. The problem with this function is that it doesn't hav...
An expired parameter is required because there may be slippage in the calculation.
Lines of code Vulnerability details Impact Due to changes in interest rates, failure to process transactions in a timely manner may result in missing out on ideal rewards. Proof of Concept The calculation of the clainRewards function involves interest rates, which are variable. If...
NOT CONFIRMED
Lines of code L1 Vulnerability details NOT CONFIRMED Assessed type Decimal --- The text was updated successfully, but these errors were encountered: All reactions...
PositionManager's moveLiquidity can freeze funds by removing destination index even when the move was partial
Lines of code Vulnerability details positionIndex.removeparams.fromIndexremoves the PositionManager entry even when it is only partial removal as a result of IPoolparams.pool.moveQuoteToken... call. I.e. it is correct to do fromPosition.lps -= vars.lpbAmountFrom, but the resulting amount might no...
Logic error in _transferAjnaRewards function
Lines of code Vulnerability details Context: ajna-core/src/RewardsManager.sol: 836 / 837: function transferAjnaRewardsuint256 rewardsEarned internal 838: // check that rewards earned isn't greater than remaining balance 839: // if remaining balance is greater, set to remaining balance 840: uint25...
PositionManager's moveLiquidity can set wrong deposit time and permanently freeze LP funds moved
Lines of code Vulnerability details moveLiquidity set new destination index LP entry deposit time to be equal to the source index deposit time, while destination bucket might have defaulted after that time. This is generally not correct as source bucket bankruptcy is controlled i.e. LP shares tha...
Attacker can drain the token from the user's account
Lines of code Vulnerability details Vulnerability details Impact There is a potential vulnerability if the increaseLPAllowance function is not implemented safely and allows for arbitrary increases to the token allowance. File: ajna-core/src/PositionManager.sol pool.increaseLPAllowanceowner,...
unstake() function: The unstake function permits the unstaking of multiple position NFTs from the same liquidity pool (LP) by the same lender. This opens the possibility for a lender to claim more Ajna token rewards than they are entitled to by staking and unstaking multiple NFTs associated with the same LP.
Lines of code Vulnerability details Impact The absence of a mechanism to prevent a lender from unstaking multiple NFTs for the same liquidity pool LP could potentially lead to the exploitation of the Ajna token reward system. A lender can mint, stake, and unstake multiple NFTs for the same LP fro...
_transferAjnaRewards doesn't save the remaining rewards of a staker for the next transfer
Lines of code Vulnerability details Impact Staker will earn less than expected Proof of Concept On claimRewards function at transferAjnaRewards is being called to claim rewardsEarned for staker according to the tokenId, the issue here drop at if rewardsEarned ajnaBalance rewardsEarned =...
The design flaws have resulted in unfairness in the protocol.
Lines of code Vulnerability details Impact Ordinary traders are not aware that the contract does not have sufficient ajna tokens when receiving rewards, resulting in partial loss of ajna. Smart traders will check the contract token balance before claiming rewards, which leads to unfairness. Proof...
Incorrect Calculation of Max Amount of Quote Tokens in moveLiquidity() Function in PositionManager.sol.
Lines of code Vulnerability details Impact The updateInterest function is called before retrieving the fromPosition value from positionsparams.tokenIdparams.fromIndex in the moveLiquidity function. This means that the bucketDeposit value may not reflect the current accrued interest, which can...
Insufficient Validation of Total Tokens Requested.
Lines of code Vulnerability details Impact In the proposeExtraordinary function in the Funding contract. Specifically, in the following line: L105 if uint256totalTokensRequested getSliceOfTreasuryMaths.WAD - getMinimumThresholdPercentage revert InvalidProposal; If the totalTokensRequested paramet...
Integer Overflow/Underflow in function fundTreasury.
Lines of code Vulnerability details Impact fundTreasury function in the GrantFund.sol contract is vulnerable to integer overflow if the value of treasury variable is close to the maximum value of a uint256 integer, which is 2^256-1, and a large value of fundingAmount is added to it. It is possibl...
Users may lose rewards
Lines of code Vulnerability details Impact In RewardsManager.sol we have claimRewards function: function claimRewards uint256 tokenId, uint256 epochToClaim external override StakeInfo storage stakeInfo = stakestokenId; if msg.sender != stakeInfo.owner revert...
ExtraordinaryFunding may fail due to a decrease in the treasury funds due to a StandardFunding new distribution round
Lines of code Vulnerability details Impact Users could spend gas and possibly other off chain resources voting on an ExtraordinaryFunding proposal which would later revert when executing. Proof of Concept If an ExtraordinaryFunding proposal requests an amount of tokens between 48.5% and 50% of th...
stake() function: The provided stake function lacks checks to prevent a lender from staking multiple NFTs in the same Ajna pool. The function allows any owned position NFT to be staked without considering whether the lender has already staked in the pool. This potentially opens up the system to an abuse where a lender stakes multiple NFTs for the same liquidity position.
Lines of code Vulnerability details Impact The current stake function lacks checks to prevent a lender from staking multiple NFTs in the same Ajna pool. This could lead to an abuse of the system where a lender stakes multiple NFTs for the same liquidity position, potentially earning more rewards...
Contracts are vulnerable to fee-on-transfer-token-related accounting issues
Lines of code Vulnerability details Vulnerability details Impact Without measuring the balance before and after the transfer, there's no way to ensure that enough tokens were transferred, in the cases where the token has a fee-on-transfer mechanic. If there are latent funds in the contract,...
It is possible to steal the unallocated part of every delegation period budget
Lines of code Vulnerability details Attacker can monitor the standard proposals distribution and routinely steal each low activity period remainder by submitting a transfer to self proposal and voting a dust amount for it. Since the criteria for the final slate update is that any increase in tota...
mint() function: an attacker can mint multiple position NFTs for one or more legit Ajna users who have LP in Ajna pools. This should not be possible.
Lines of code Vulnerability details Impact The current implementation of the mint function does not ensure that only the owner of a liquidity pool LP deposit can mint position NFTs. As a result, an attacker can mint multiple position NFTs on behalf of legitimate Ajna users who have LP in Ajna...
There can be a maximum of 11 proposals
Lines of code Vulnerability details Impact Overflow Proof of Concept The proposeExtraordinary function restricts that the result of the getMinimumThresholdPercentage function must be less than or equal to 1018. The maximum length of the fundedExtraordinaryProposals array is 10, but there is no...
Unchecked increment in calculateRewards function of RewardsManager.sol.
Lines of code Vulnerability details Impact In the calculateRewards function, there is an unchecked increment in the for loop, in the code it can allow an attacker to cause an integer overflow in the calculateRewards function by manipulating the loop variable, resulting in incorrect rewards...
Risk of Gas Limit Exceedance During Proposal Sorting
Lines of code Vulnerability details Impact The array of up to 10 proposals using the insertion sort algorithm in insertionSortProposalsByVotes function in the StandardFunding.sol contract but, if the number of proposals exceeds 10, the sorting process may cause the function to exceed the block ga...
Integer Overflow in executeExtraordinary Function.
Lines of code Vulnerability details Impact The executeExtraordinary function casts a uint128 value to a uint256 value, which could lead to an integer overflow vulnerability. An attacker can provide a large uint128 value that exceeds the maximum value for uint256, causing the value to overflow and...
Missing Proposal Validations in Funding Contract.
Lines of code Vulnerability details Impact The Funding.sol contract's validateCallDatas function validates the targets, values, and calldatas parameters for a proposal but does not check if the proposal is valid based on the current state of the contract. For example, it does not check if the...