10190 matches found
Divide before multiply
Lines of code Vulnerability details Divide before multiply Impact Solidity integer division might truncate. As a result, performing multiplication before division can sometimes avoid loss of precision. Details In general, this is a problem due to precision. In this case, it also affects...
Oracle may be relying on a low reserves pair, which is easy to manipulate
Lines of code Vulnerability details Impact While the observations isn't easy to manipulate, it's still possible to manipulate some of them using an MEV bot and some tokens. In case of a pair with low reserves, the manipulation is going to be cheaper and might be worth for an attacker. Since there...
[M03] Incorrect price calculation for non-stablecoin pairs marked as stable
Lines of code Vulnerability details Impact Pairs that don't have NOTE token but that are still marked as stable will always have an incorrect price calculated for them. Proof of Concept As it can be concluded from the code, stablecoin pairs are pairs with NOTE token: However, there's a separate...
Should add check for Insufficient allowance
Lines of code Vulnerability details Impact There is not check for Insufficient allowance inside transferFrom method. Proof of Concept Tools Used Code analytics Recommended Mitigation Steps requirecurrentAllowance = amount, "ERC20: insufficient allowance"; --- The text was updated successfully, bu...
[M04] Incorrect price calculation for non-stable pairs without CANTO token
Lines of code Vulnerability details Impact A non-stable pair that doesn't have CANTO token will always have an incorrect price calculated for it. Proof of Concept The code assumes that all pairs are pairs with either NOTE or CANTO token: However, the createPair function doesn't require one of the...
WHEN PAIR TOKENS ARE ALL NOT NOTE OR WANCTO GETPRICELP() WILL PRODUCE WRONG LP TOKEN PRICE
Lines of code Vulnerability details Impact If pair tokens all is not wcanto or note ,it will calculate wrong lp price of getPriceLP . Proof of Concept with docs description,Canto Lending Market will allow LP tokens from Canto’s native decentralized exchange to be used as collateral ,and createPai...
USING SYMBOL FOR TOKEN IDENTIFICATION
Lines of code Vulnerability details Impact Proof of Concept An exploiter may create a fake tokens whose symbols are cNOTE, cUSDT or cUSDC. When somebody call computrolle’s liquidateCalculateSeizeTokens ,it will give an unlisted token with other token's it can be unlisted token or listed token...
Price can be manipulated by flashloan
Lines of code Vulnerability details Impact The last observation of the TWAP can be manipulated by a flashloan, which thus manipulates the price. Proof of Concept The price calculated in getPriceLP is based on the last 8 observations. As the last observation may be in the current block it is...
HARDCODED PRICES FOR STABLECOINS
Lines of code Vulnerability details Impact Hardcoded prices of stablecosins may open some arbitrage opportunities and produce many bad loans in CLM. Proof of Concept Hardcoding price of cUSDT and cUSDC as 1 may open some arbitrage opportunities when real price for each token is a little bit...
Tokens with low trading volumes will have distorted time weighting
Lines of code Vulnerability details Proof of Concept Although the docs talk of time weighted values, the actual processing of values by update,reserves, sampleReserves and sampleSupply weights all observations as equal, regardless of duration. So long as update is being called frequently, this...
Sudden price fluctuations occuring at a call to _update() will not be reflected by reserves(), sampleReserves() and sampleSupply() until after periodSize seconds
Lines of code Vulnerability details Impact Consider the situation where a token suddenly drops drastically in price in the market. Consider a call to BaseV1Pair.swap which makes a very large swap between the two tokens accurately reflecting the change in price and also causes a new observation to...
Division Before Multiplication Can Lead To Precision Loss
Lines of code Vulnerability details Impact There is a division before multiplication bug that exists in getPriceLP. When this occurs the returned TWAP pricing of the LP tokens from pairs will be off. Proof of Concept Consider the following example: a = 100 b = 30 c = 13 function mathuint256 a,...
Two-step change of privileged roles
Lines of code Vulnerability details Impact Lack of two-step procedure for critical operations is error-prone and can lead to irrevocable mistakes, might leave the system operationally with no/malicious privileged role. For example, when transfer admin role, in a single-step change, if the current...
getUnderlyingPrice returns an incorrect value for cUSDC
Lines of code Vulnerability details BaseV1Router01.getUnderlyingPricecToken returns the price of cToken in $NOTE. As per the docs, the function is designed so that cStable coins USDC, USDT, NOTE have prices that are statically set to 1e18. The issue is that USDC uses 6 decimal places of precision...
# WRONG DESIGN/IMPLEMENTATION OF ADDLIQUIDITY() ALLOWS ATTACKER TO STEAL FUNDS FROM THE LIQUIDITY POOL
Lines of code Vulnerability details The current design/implementation of Vader pool allows users to addLiquidity using arbitrary amounts instead of a fixed ratio of amounts in comparison to Uni v2. We believe this design is flawed and it essentially allows anyone to manipulate the price of the po...
Missing checks for Comptroller can block expected/correct flows getUnderlyingPrice
Lines of code Vulnerability details Missing checks for Comptroller can block expected/correct flows getUnderlyingPrice Summary Zero address should be checked to be avoided Also a 2 steps assign would help to not going wrong or a check within a whitelist Details getUnderlyingPrice would be blocked...
No validation on wcanto may lead into lock deposit because of arbitrary address in deposit call
Lines of code Vulnerability details No validation on wcanto may lead into lock deposit because of arbitrary address in deposit call Impact Address wcanto is not being validated. In case of wrong deployment, function swapExactCANTOForTokens will lock ether in a wrong contract. Consideration...
setPeriodSize need check for value range
Lines of code Vulnerability details Impact If periodSize is mistakenly set too small, 0 or a small value, the price oracle might be easier to manipulate. As a consequence, multiple functionality depending on oracle price feed may lose accuracy, and even incur large fund loss. Proof of Concept The...
Controlling the ERC20 Token contract from symbol is not secure
Lines of code Vulnerability details Impact BaseV1-periphery.solL491 in the getUnderlyingPrice function , the correctness of the CToken contract received from the instance is done with if compareStringssymbol, "cCANTO" on line BaseV1-periphery.solL490 This is not a safe way, fake contracts similar...
Division before multiplication can lead to an error
Lines of code Vulnerability details Division before multiplication can lead to an error Impact LP token price can be half of actual price by this mistake. Proof of Concept For simplicity, let us say decimals is 1018. Prices can be nearly 1, but slightly smaller than 1. In that case, token0TVL = 0...
The skim function allows to withdraw tokens for any address
Lines of code Vulnerability details Impact Any address can call the skim function and remove tokens that are in excess of the reserves of those tokens. This would lead to the loss of token 0 and 1. Recommended Mitigation Steps You should have an access control so that only the factory, for exampl...
Unbounded loop on array can lead to DoS
Lines of code Vulnerability details Description: As this array can grow quite large, the transaction’s gas cost could exceed the block gas limit and make it impossible to call this function at all a push exist but there's no pop in the solution, that means it will continuously only push which wil...
Stable/non-stable pair creation mistake could be abused
Lines of code Vulnerability details Impact Stable and non-stable pair use different formula to calculate the invariant k. If a non-stable pair is treated as stable, or vice versa. $x^3y+y^3x$ behave quite differently compare with $xy$, on the edge of relative stable price range, price volatility...
Lack of input array length check in UNSAFE_swapExactTokensForTokens() could lock user's funds
Lines of code Vulnerability details Impact In case the amounts and routes array do not match in length by mistake: the swap might fail the swap could stop early during the swap path user funds could be locked forever in some situations Proof of Concept src/Swap/BaseV1-periphery.sol function...
Lack of minimal sufficient liquidity check can result in unreliable prices
Lines of code Vulnerability details function getPriceCantoaddress token internal view returnsuint erc20 token = erc20token; address pair = pairForaddresswcanto, addresstoken, false; if !isPairpair return 0; // this pair does not exist with Canto uint decimals = 10 token.decimals; // get decimals ...
blockTimestampLast not initialised to block.timestamp results in wrong calculations for reservesCumulative and totalSupplyCumulative in _update() function
Lines of code Vulnerability details Impact Default value of blockTimestampLast is 0 and affects the calculations done in the first call of update. observations would store the wrong value and affect subsequent calculations of price when a sample size that includes this wrong observation is taken...
Rounding error for low decimal token
Lines of code Vulnerability details Impact Some token has low decimal USDC has only 6, as a result, the rounding may introduce substantial error in stable pair calculation, causing wrong getAmountOut quote, at the end lead to fund loss in swap function. Malicious user can abuse the wrong quote to...
There is a problem with price calculation using BaseV1Pair._getAmountOut.
Lines of code Vulnerability details Impact Currently, it calculates token price with the amount of decimals here and normalizes using 1e18 after that. There are some irregular tokens with small decimals and the token price might be calculated wrongly. Proof of Concept As we can see here, some...
USE SAME SYMBOL CAN GET FAKED PRICE OF TOKEN
Lines of code Vulnerability details Impact it compare symbol to identify token,it can be exploit to produce fake price of token. Proof of Concept attacker can create a token which is like cToken and has symbol of cNOTE .When somebody call comptroller’s liquidateCalculateSeizeTokens ,it will give ...
Hardcoded cUSDT and cUSDC prices are dangerous to the system when those stablecoins depeg
Lines of code Vulnerability details Proof of Concept function getUnderlyingPriceCToken ctoken external override view returnsuint address underlying; //manual scope to pop symbol off of stack string memory symbol = ctoken.symbol; if compareStringssymbol, "cCANTO" underlying = addresswcanto; return...
Upgraded Q -> M from 202 [1662178014316]
Judge has assessed an item in Issue 202 as Medium risk. The relevant finding follows: --- The text was updated successfully, but these errors were encountered: All reactions...
Upgraded Q -> M from 208 [1662178021917]
Judge has assessed an item in Issue 208 as Medium risk. The relevant finding follows: --- The text was updated successfully, but these errors were encountered: All reactions...
Upgraded Q -> M from 167 [1662177851548]
Judge has assessed an item in Issue 167 as Medium risk. The relevant finding follows: --- The text was updated successfully, but these errors were encountered: All reactions...
Upgraded Q -> M from 167 [1662177846442]
Judge has assessed an item in Issue 167 as Medium risk. The relevant finding follows: --- The text was updated successfully, but these errors were encountered: All reactions...
Upgraded Q -> M from 272 [1662178113276]
Judge has assessed an item in Issue 272 as Medium risk. The relevant finding follows: --- The text was updated successfully, but these errors were encountered: All reactions...
# ERC20 transfer / transferFrom with not checked return value
Lines of code Vulnerability details ERC20 transfer / transferFrom with not checked return value Impact Not every ERC20 token follows OpenZeppelin's recommendation. It's possible inside ERC20 standard that a transferFrom doesn't revert upon failure but returns false. Code doesn't check return...
PRICE's getCurrentPrice() can return zero price
Lines of code Vulnerability details Currently no price validity check is performed in getCurrentPrice. This way zero ohmEthPriceFeed.latestRoundData produced prices will yield zero getCurrentPrice which will be passed over to the logic. Also, negative OHM price or zero / negative reserve...
Moving average precision is lost
Lines of code Vulnerability details Now the precision is lost in moving average calculations as the difference is calculated separately and added each time, while it typically can be small enough to lose precision in the division involved. For example, 10000 moves of 990 size, numObservations =...
USER CAN BLOCK GOVERNANCE VOTING BY SUBMITTING MULTIPLE PROPOSALS
Lines of code Vulnerability details Impact A user can submit multiple proposals and then endorse each one of them to be able to activate them, and because the Governance contract allow only one active proposal, this user will be able to always activate his proposals and thus not allowing any othe...
[NAZ-M1] Chainlink's latestRoundData Might Return Stale Results
Lines of code Vulnerability details Impact Across these contracts, you are using Chainlink's latestRoundData API, but there is only a check on updatedAt. This could lead to stale prices according to the Chainlink documentation: Historical Price data Checking Your returned answers The result of...
The _movingAverage always have the same value as _movingAverage + (currentPrice / numObs)
Lines of code Vulnerability details Impact On updateMovingAverage the calculate new moving average is always movingAverage == movingAverage + currentPrice / numObs Proof of Concept 1- keeper invoke beat on Heart.sol 2- this PRICE.updateMovingAverage; to updating the moving average on the Price...
In Governance.sol, it might be impossible to activate a new proposal forever after failed to execute the previous active proposal.
Lines of code Vulnerability details Impact Currently, if users vote for the active proposal, the VOTES are transferred to the contract so that users can't vote or endorse other proposals while the voted proposal is active. And the active proposal can be replaced only when the proposal is executed...
The users are not able to withdraw the swapped amount
Lines of code Vulnerability details Impact The user will invoke swap from Operator.sol to swap their OHM tokens. But he will transfer their OHM and will never get the AmountOut Proof of Concept On Operator.sol: 1- invoking swap with tokenIn == ohm 2- the ohm.safeTransferFrommsg.sender, addressthi...
User can get loan without dept
Lines of code Vulnerability details Impact User can get loan without permission and dept Proof of Concept TRSRY.withdrawReserves does same validation with TRSRY.getLoan and TRSRY.withdrawReserves does not have permissioned modifier, so anyone can get loan from Treasury without any permission and...
Swap at the lower cushion is impossible due to non approved withdrawal. Wrong implementation can cause free swaps.
Lines of code Vulnerability details Impact Currently it is not clear how the swap user is approved for withdrawing from treasury. Depending on implementation, user could swap without spending any tokens, due to approval mechanism in the TRSRY module. Description In the swap function it should be...
User Votes will stuck
Lines of code Vulnerability details Impact Due to insufficient checks User will not be able to withdraw there Votes after a non successful proposal. 1. The effect could be permanent if majority vote holders participated in the proposal, such that new proposal can't be created due to noone having...
## block.timestamp used as time proxy
Lines of code Vulnerability details block.timestamp used as time proxy Summary: Risk of using block.timestamp for time should be considered. Details: block.timestamp is not an ideal proxy for time because of issues with synchronization, miner manipulation and changing block times. This kind of...
Lock of voting power
Lines of code Vulnerability details Description There is a function vote in OlympusGovernance smart contract. It contains the logic for voting on proposals. In the case of failed vote voters' tokens will remain on the balance of OlympusGovernance until the activation of the new proposal. But for...
Proposal functions are lacking access control for Governance.sol
Lines of code Vulnerability details Impact For the Governance.sol contract, the functions activateProposal and executeProposal can be called by anyone. Proof of Concept An malicious user could monitor the protocal DAO and activate or execute a proposal in a time not intended by the proposal...
BondCallback Re-Entrancy vulnerability
Lines of code Vulnerability details Impact when withdraw reserves from TRSRY to msg.sender,it may go to other external uncontrollable contract logic if reserve token contract transferFrom function call to other contract ,it will cause other market use this callback asset loss or this contract...