Lucene search
K
Code423n4Recent

10190 matches found

Code423n4
Code423n4
added 2023/05/15 12:0 a.m.11 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.14 views

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...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.11 views

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...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.11 views

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...

7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.10 views

Incorrect decimal handling in _startAuction, resulting in wrong auction.startBidBps

Lines of code Vulnerability details Shortfall.startAuction uses the oracle price of the underlying tokens to price the pool bad debt: Shortfall.sol 389: for uint256 i; i the price returned by priceOracle.getUnderlyingPrice has a number of decimals equal to 36 - vToken decimals. This means the...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.8 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.8 views

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...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.12 views

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...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.10 views

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...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.8 views

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:...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.8 views

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...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.6 views

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...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.6 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.9 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.8 views

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...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.13 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.22 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.6 views

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...

7.2AI score
Exploits0
Code423n4
Code423n4
added 2023/05/15 12:0 a.m.9 views

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...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.10 views

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;...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.7 views

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...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.10 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.9 views

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...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.15 views

_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...

7.3AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.8 views

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...

7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.10 views

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...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.10 views

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...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.9 views

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...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.12 views

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...

7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.15 views

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...

6.5AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.12 views

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...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.13 views

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...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.9 views

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,...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.10 views

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...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.8 views

_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 =...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.8 views

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...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.12 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.5 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.10 views

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...

7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.15 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.9 views

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...

7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.9 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.16 views

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,...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.6 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.16 views

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...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.7 views

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...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.9 views

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...

7.1AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.10 views

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...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.15 views

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...

7.1AI score
Exploits0
Code423n4
Code423n4
added 2023/05/11 12:0 a.m.13 views

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...

7.1AI score
Exploits0
Total number of security vulnerabilities10190