Lucene search
K
Code423n4Recent

10190 matches found

Code423n4
Code423n4
added 2022/05/30 12:0 a.m.6 views

Must approve 0 first

Lines of code Vulnerability details Impact Some tokens like USDT do not work when changing the allowance from an existing non-zero allowance value.They must first be approved by zero and then the actual allowance must be approved. Proof of Concept Tools Used Manual Review Recommended Mitigation...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2022/05/30 12:0 a.m.14 views

Once-off setter functions can be set multiple times

Lines of code Vulnerability details Impact The once-off setter functions don't use require to limit, resulting in multiple calls. Proof of Concept RewardsDistributor.sol // Once off event on contract initialize function setDepositoraddress depositor external requiremsg.sender == depositor;...

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

notifyRewardAmount() griefing attack by adding MAX_REWARD_TOKENS

Lines of code Vulnerability details function notifyRewardAmountaddress token, uint amount external lock requireamount 0; if !isRewardtoken requirerewards.length Recommendation Consid...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2022/05/30 12:0 a.m.12 views

Anyone can add Gauge reward tokens and cause DoS

Lines of code Vulnerability details Impact The Gauge.notifyRewardAmount function does not have any access restriction. Anyone an attacker can frontrun and call this function to add arbitrary even malicious gauge reward tokens up to MAXREWARDTOKENS = 16. An attacker is able to frontrun and add 16...

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

Griefing Attack By Extending The Reward Duration

Lines of code Vulnerability details Proof-Of-Concept The Gauge.notifyRewardAmount notifies the contract of a newly received rewards. This updates the local accounting and streams the reward over a preset period Five days. It was observed that this function is callable by anyone regardless of...

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

functions deposit() and notifyRewardAmount() in Bribe and Gauge contract don't consider deflationary tokens when transferring

Lines of code Vulnerability details Impact The actual amount that has been transferred can be different than requested amount in deflationary tokens and this is not been addressed in transferring logic in the code. This can cause wrong calculation and rewards distribution for users. Proof of...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2022/05/30 12:0 a.m.4 views

Upon burn, token is not removed from delegate token list

Lines of code Vulnerability details VotingEscrew burn function does not remove the token from the token's delegate token list. Impact Wrong voting results. Delegate's votes will be inflated. Proof of Concept When minting a token, it is added to the owner's delegate using moveTokenDelegates:...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2022/05/30 12:0 a.m.5 views

Wrong reward distribution in Bribe because deliverReward() won't set tokenRewardsPerEpoch[token][epochStart] to 0

Lines of code Vulnerability details Impact Function deliverReward in Bribe contract won't set tokenRewardsPerEpochtokenepochStart to 0 after transferring rewards. Gauge.getReward calls Voter.distribute which calls Gauge.deliverBribes which calls Bribe.deliverReward. so if Gauge.getReward or...

7AI score
Exploits0
Code423n4
Code423n4
added 2022/05/30 12:0 a.m.4 views

Anyone can add Bribe reward tokens and cause DoS

Lines of code Vulnerability details Impact The Bribe.notifyRewardAmount function does not have any access restriction. Anyone an attacker can frontrun and call this function to add arbitrary even malicious reward tokens up to MAXREWARDTOKENS = 16. An attacker is able to frontrun and add 16 fake...

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

Wrong calculation for the new rewardRate[token] can cause some of the late users can not get their rewards

Lines of code Vulnerability details uint bribeStart = block.timestamp - block.timestamp % 7 days + BRIBELAG; uint adjustedTstamp = block.timestamp = periodFinishtoken safeTransferFromtoken, msg.sender, addressthis, amount; rewardRatetoken = amount / DURATION; else uint remaining = periodFinishtok...

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

Bribe.sol is not meant to handle fee-on-transfer tokens

Lines of code Vulnerability details Impact Should a fee-on-transfer token be added as a reward token and deposited, the tokens will be locked in the Bribe contract. Voters will be unable to withdraw their rewards. Proof of Concept Tokens are deposited into the Bribe contract using...

6.5AI score
Exploits0
Code423n4
Code423n4
added 2022/05/30 12:0 a.m.6 views

funds related to one cycle will be locked and lost if update_period() of Minter contract has not been called in a cycle

Lines of code Vulnerability details Impact updateperiod calculates emissions of current cycle and transfer them. but if in one cycle this function is not called then for that cycle emissions wouldn't get calculated and distributed because updateperiod can only do this logic for current cycle not...

7AI score
Exploits0
Code423n4
Code423n4
added 2022/05/30 12:0 a.m.8 views

Repeated calls to deliverBribes() risks draining bribe of assets into Gauge

Lines of code Vulnerability details Impact Funds drain from Bribe prematurely with repeated calls to deliverBribes Proof of Concept Calling deliverBribes calls deliverRewards which transfers the amount specified as the rewards due and sends to gauge. Repeated calls to deliverBribes makes repeated...

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

Bribe Rewards Not Collected In Current Period Will Be Lost Forever

Lines of code Vulnerability details High Bribe Rewards Not Collected In Current Period Will Be Lost Forever Vulnerability Details It was observed that if the bribe rewards are not collected in the current period, they will not be accrued to future epoch, and they will be lost forever...

6.5AI score
Exploits0
Code423n4
Code423n4
added 2022/05/30 12:0 a.m.17 views

Bribe Rewards Struck In Contract If Deposited During First Epoch

Lines of code Vulnerability details Vulnerability Details Bribe rewards added to the Bribe contract in the first epoch will not be claimable by any voters, and the rewards will struck in the Bribe contract. Proof-of-Concept Assume that the current epoch is epoch 0, and start date of epoch 0 is Da...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2022/05/30 12:0 a.m.12 views

External contract calls inside loops may result in DoS.

Lines of code Vulnerability details Impact Calls to external contracts inside a loop are dangerous especially if the loop index can be user-controlled because it could lead to DoS if one of the calls reverts or execution runs out of gas. Reference Proof of Concept for uint i = 0; i 0...

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

Voting overwrites checkpoint.voted in last checkpoint, so users can just vote right before claiming rewards

Lines of code Vulnerability details Impact if cp0.voted reward += cp0.balanceOf rewardPerTokenStored1 - rewardPerTokenStored0 / PRECISION; this line in gauge.earned function looks like the intention here is to incentivize users to keep their escrow.balanceOfNft voted for this gauge. However, it's...

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

Rewards can be locked in Bribe contract because distributing them is depend of base token reward amount and Gauge.deliverBribes() is not get called always by Voter.distribute()

Lines of code Vulnerability details Impact Voter.distribute calls Gauge.deliverBribes if claimablegauge / DURATION 0 was True and claimablegauge shows base token rewards for gauge. Gauge.deliverBribes calls Bribe.deliverReward which transfers the rewards to Gauge. so for Bribe rewards to been...

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

In gauge, checkpoint.voted is incorrectly copied from previous checkpoint (always false in new checkpoint)

Lines of code Vulnerability details Impact When a user interacts with a gauge and a new balance checkpoint is created in storage of this gauge, then checkpoint.voted for this new checkpoint is always false. Unless users are aware of this bug and call voter.poke after each interaction with the gau...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2022/05/30 12:0 a.m.12 views

_writeCheckpoint() in Gauge use wrong index to get prevVoteStatus

Lines of code Vulnerability details Impact All the Voting values calculated by writeCheckpoint when it's not first checkpoint is going to set to False instead of account's last vote and because vote has been used in earned and reward calculation so reward distribution is going to be wrong too...

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

Users can get unlimited votes

Lines of code Vulnerability details Impact Users can get unlimited votes which leads to them: 1. gaining control over governance 2. getting undeserved rewards 3. having their pools favored due to gauge values Proof of Concept mint calls moveTokenDelegates to set up delegation... File:...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2022/05/30 12:0 a.m.4 views

The VotingEscrow steals depositor's rebasing tokens' rewards

Lines of code Vulnerability details Rebasing tokens are tokens that have each holder's balanceof increase over time. This ability of user's balances to grow is a way that some tokens provide rewards to the current holders. Aave aTokens are an example of such tokens. Impact Because the VotingEscro...

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

If extra reward token is "protected token" it the rewards will be taken by other protocols

Lines of code Vulnerability details Impact Misallocation of extra reward tokens Proof of Concept Let's think of a scenario where CRV is being used as an extra incentive for a pickle finance gauge. The extra rewards will be sent to voterProxy but when the extra rewards stash tries to claim them, t...

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

Gauge Functionalities Still Accessible After Being "Killed"

Lines of code Vulnerability details Proof-of-Concept The Voter contract contains a killGauge function that allow the emergency council to kill a gauge. The killGauge function will set the isAlive mapping to false. Thus, calling Voter's functions e.g. Voter.updateGauge, Voter.distributegauge again...

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

Malicious user can populate rewards array with tokens of their interest reaching limits of MAX_REWARD_TOKENS

Lines of code Vulnerability details Impact Malicious user can populate rewards array with different tokens early reaching limit of MAXREWARDTOKENS sending very small amount of different tokens. It will restrict any other tokens to be used as rewards in Bribe.solnotifyRewardAmount Proof of Concept...

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

GettersAndDerivers: Offer and consideration should be sorted when calculating orderHash

Lines of code Vulnerability details Impact When calculating the orderHash in the deriveOrderHash function of the GettersAndDerivers contract, the orderHash will be different due to the order of the elements in the offer and consideration, and the user is likely to get the wrong orderHash due to t...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2022/05/29 12:0 a.m.5 views

Upgraded Q -> M from 26 [1653831187876]

Judge has assessed an item in Issue 26 as Medium risk. The relevant finding follows: --- The text was updated successfully, but these errors were encountered: All reactions...

7AI score
Exploits0
Code423n4
Code423n4
added 2022/05/29 12:0 a.m.6 views

Wrong parameter in _removeTokenFrom call from _burn internal function

Lines of code Vulnerability details Impact Break the posibility of third party callapprove or approvalForAll authorization to withdraw and merge functions what use the burn internal function Proof of Concept If somebody use the withdraw or merge functions as third party "operator" with approve or...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2022/05/29 12:0 a.m.7 views

withdraw() and merge() functions of VotingEscrow won't work when an approved user(not owner) calls because _burn() function fails.

Lines of code Vulnerability details Impact withdraw and merge functions of VotingEscrow won't work when an approved usernot owner calls. Proof of Concept withdraw and merge functions call burn function inside and burn function calls removeTokenFrom using msg.sender. But removeTokenFrom requires...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2022/05/29 12:0 a.m.5 views

OrderValidator: The _cancel function does not validate the order status, the order will be cancelled even if the order does not exist.

Lines of code Vulnerability details Impact In the cancel function of the OrderValidator contract, orderStatusorderHash.isValidated is not checked. If the user's input is incorrect, the non-existing order will be cancelled without any message, causing the user to think that the correct order has...

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

User will get free funds

Lines of code Vulnerability details Impact If contract has an existing balance of WETH, ETH or targetUnderlying then user will get extra funds. Proof of Concept 1. Assume contract has existing amount 10 of targetUnderlying token 2. User calls burnToTarget function which converts all his passed...

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

Incorrect msg.value usage could lead to fund loss

Lines of code Vulnerability details Impact The burnToTarget function is using msg.value in a loop which is passed to swapAll function of swapperRouter. Since msg.value amount will not change within loop, contract will end up using its own ETH Proof of Concept 1. User calls burnToTarget function...

6.5AI score
Exploits0
Code423n4
Code423n4
added 2022/05/29 12:0 a.m.32 views

Voting Escrow System could be wrapped and made useless without contract whitelisting

Lines of code Vulnerability details Impact Anyone could create a contract or a contract factory, say “Velo Locker" with a fonction to deposit VELO tokens through a contract, lock them and delegate the voting power to the contract owner. Then, the ownership of this contract could be sold, or the...

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

Upgraded Q -> M from 94 [1653831846680]

Judge has assessed an item in Issue 94 as Medium risk. The relevant finding follows: --- The text was updated successfully, but these errors were encountered: All reactions...

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

Attacker can block LayerZero channel

Lines of code Vulnerability details Impact According to the LayerZero docs, the default behavior is that when a transaction on the destination application fails, the channel between the src and dst app is blocked. Before any new transactions can be executed, the failed transaction has to be retri...

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

DOS by creating large amount of SupplyCheckpoint

Lines of code Vulnerability details Impact An attacker can repeatedly call withdrawToken to create a large amount of SupplyCheckpoint. When there is a large amount of pending SupplyCheckpoint, updateRewardPerToken might revert due to out-of-gas when trying to processing all the checkpoints, rewar...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2022/05/28 12:0 a.m.13 views

BathToken with initial liquidity of 1 wei causes very expensive share price leading to precision errors and loss of funds

Lines of code Vulnerability details Impact The creator of a new BathToken is able to maliciously manipulate the share price by providing lowest possible amount 1 wei of liquidity initialLiquidityNew and then artificially blowing up the BathToken token balance. Following depositors will loose thei...

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

BathToken.sol#_deposit() attacker can mint more shares with re-entrancy from hookable tokens

Lines of code Vulnerability details BathToken.soldeposit calculates the actual transferred amount by comparing the before and after balance, however, since there is no reentrancy guard on this function, there is a risk of re-entrancy attack to mint more shares. Some token standards, such as ERC77...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2022/05/28 12:0 a.m.19 views

BathToken.sol A malicious early user/attacker can manipulate the vault's pricePerShare to take an unfair share of future users' deposits

Lines of code Vulnerability details function deposituint256 assets, address receiver internal returns uint256 shares uint256 pool = underlyingBalance; uint256 before = underlyingToken.balanceOfaddressthis; // Assume caller is depositor underlyingToken.transferFrommsg.sender, addressthis, assets;...

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

DoS on deposit(), incrementLock() and createLock() because of a safeApprove(0)

Lines of code Vulnerability details Impact Since SafeERC20 is the one implemented by OpenZeppelin, if one checks the code at this address: You will see that the safeApprove executes this validation: require value == 0 || token.allowanceaddressthis, spender == 0, "SafeERC20: approve from non-zero ...

7.2AI score
Exploits0
Code423n4
Code423n4
added 2022/05/28 12:0 a.m.7 views

Wrong fee calculation between Router & Market

Lines of code Vulnerability details Impact The wrong fee calculation can cause a loss to users' fund and this loss will be stuck in RubiconRouter Proof of Concept We have the default $feeBPS = 20, BPS = 10000$ Let's assume that alice call RubiconRouter.swappayamt=1000000 Through router, alice wil...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2022/05/28 12:0 a.m.5 views

Wrong formula to calculate new t_pay_amt in _matcho function (RubiconMarket.sol)

Lines of code Vulnerability details Impact functionmatcho won't work as expected tpayamount updated incorrectly can lead to reverted transaction because not enough fund to transfer Proof of Concept In matcho function, after matching with offer, tbuyamt and tpayamt will updated as follow: tbuyamto...

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

QA Report

Impact RubiconRouter.swapEntireBalance is supposed to buy at least buyamtmin of Y output tokens by using the caller's entire X input token balance. The problem is that instead of passing the buyamtmin minus the fee to swap, the code uses the caller's X token balance, maxAmount. This means the cal...

7AI score
Exploits0
Code423n4
Code423n4
added 2022/05/28 12:0 a.m.13 views

Reserve ratio isn't enforced after a trade execution

Lines of code Vulnerability details impact Users could get exposed to higher risk than desired and funds to withdraw from the vault could not be available Proof of Concept The reserve ratio is the parameter that ensures a percentage of the tokens is always available to be withdrawn from a pool by...

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

unsafe call using msg.value in loop

Lines of code Vulnerability details description with the function burnToTarget in FeeBurner.sol, a malicious user can swap more funds than they input in ETH if they include multiple address0 in the addresses tokens parameter during the function call, there is a for loop that loops through tokens...

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

Steal user's first deposit

Lines of code Vulnerability details Impact Steal user's first deposit Proof of Concept The attack's flow is as following: 1. The first depositor wants to deposit X in bathToken.sol. 2. We detect it and frontrun 2 operations: 1. We deposit 1 of the underlying to the system. In exchange we receive ...

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

BathPair.sol#rebalancePair() can be front run to steal the pending rebalancing amount

Lines of code Vulnerability details function underlyingBalance public view returns uint256 uint256 pool = IERC20underlyingToken.balanceOfaddressthis; return pool.addoutstandingAmount; function removeFilledTradeAmountuint256 amt external onlyPair outstandingAmount = outstandingAmount.subamt; emit...

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

Casting overflow when updating the status of partially fulfilled orders

Lines of code Vulnerability details Impact In the validateOrderAndUpdateStatus function of OrderValidator, the numerator and denominator of the order status are cast from type uint256 to uint120. However, since the explicit cast does not ensure the value fits the uint120 data type i.e., not...

7AI score
Exploits0
Code423n4
Code423n4
added 2022/05/28 12:0 a.m.5 views

Wrong buy_amt_min calculation in RubiconRouter.swapEntireBalance for multi-hop swaps

Lines of code Vulnerability details Impact The buyamountmin value provided for the swap call is calculating too few fees for multi-hop swaps. Every swap within a multi-hop swap is taking fees. Currently, only a one-time fee is calculated on the basis of the swapEntireBalance function parameter...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2022/05/28 12:0 a.m.2 views

First pool depositor can break minting of shares

Lines of code Vulnerability details Impact First depositor of the pool can break minting of the Bath Token shares Proof of Concept An attacker -who is the first one to deposit- sends 1 wei and bypasses totalSupply == 0 condition. Later a very large amount of donation to the pool and inflates the...

6.7AI score
Exploits0
Total number of security vulnerabilities10190