Lucene search
+L
Code423n4Recent

10190 matches found

Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•12 views

Prize token can overlap with drawingToken and prize tokens from other draws.

Lines of code Vulnerability details Impact Creators can create multiple draws with the same prize, but only the first draw to call startDraw will have the prize. This can trick users into entering raffle pools that does not have a prize. Furthermore, the prize token can also be one of the tokens ...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•21 views

Draw admin/owner can rug the winner after recoverTimelock expires.

Lines of code Vulnerability details Impact The admin/owner of VRFNFTRandomDraw can wait for recoverTimelock to expire before making the draw. This way he can use lastResortTimelockOwnerClaimNFT to take back the reward NFT from the contract without any time to allow for the winner to claim. He cou...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•10 views

The recoverTimelock does not sufficiently protect against an admin withdrawing the NFT before a user is able to claim it

Lines of code Vulnerability details Impact When a VRFNFTRandomDraw contract is initialized, the recoverTimelock variable is set. The variable should be used to prevent the admin from calling the lastResortTimelockOwnerClaimNFT function before a certain amount of time has passed to ensure that the...

6.5AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•11 views

Unprotected contract

Lines of code Vulnerability details Impact Anyone can call makeNewDraw and become admin. src/VRFNFTRandomDrawFactory.sol function makeNewDrawIVRFNFTRandomDraw.Settings memory settings external returns address address admin = msg.sender; // Clone the contract address newDrawing =...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•13 views

ERC20 can be mistakenly used instead of ERC721

Lines of code Vulnerability details Impact // Attempt to transfer token into this address try IERC721EnumerableUpgradeablesettings.token.transferFrom // @audit could use ERC20 here msg.sender, addressthis, settings.tokenId catch revert TOKENNEEDSTOBEAPPROVEDTOCONTRACT; Both ERC20 and ERC721 has t...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•17 views

Pending owner can front-run current owner when current owner wants to cancel the ownership transfer.

Lines of code Vulnerability details Impact OwnableUpgradable contract has been modified to transfer ownership in a two-step ownership transfer way. This introduces an issue of front-run when admin adds a pendingOwner but later on decides to cancel the ownership transfer. Pending owner can become...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•22 views

Use safeTransferFrom instead of transferFrom for ERC721 transfers

Lines of code Vulnerability details Impact In the contract VRFNFTRandomDraw.sol every transfer of ERC721 are done with the transferFrom instead of the recommended safeTransferFrom. This transferFrom does not check whether the receiver is capable of proper handling of NFTs. Proof of Concept If the...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•13 views

Truncate of values can be avoided

Lines of code Vulnerability details Truncate of values can be avoided Summary 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 affec...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•13 views

A compromised owner of VRFNFTRandomDraw can claim the NFT to another accomplice addresss

Lines of code Vulnerability details Impact Detailed description of the impact of this finding. A compromised owner of VRFNFTRandomDraw can claim the NFT to another accomplice addresss Proof of Concept Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other...

7.1AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•15 views

Functions of Trading contract can be reentered by Position.sol#mint

Lines of code Vulnerability details Impact Both the contracts of Position and Trading may not work correctly. Proof of Concept The Position.solmint calls safeMint will trigger a checkOnERC721Received callback, which can be used to reenter. Crackers can use this vulnerability to attack the protoco...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•24 views

Miners Can Re-Roll the VRF Output to Game the Protocol

Lines of code Vulnerability details Impact Miners are able to rewrite a chain's history if they dislike the VRF output used by the protocol. Consider the following example: A miner or well-funded user is participating in the PoolTogether protocol. A VRF request is made and fulfilled in the same...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•12 views

Frontrunning the winnerClaimNFT is possible

Lines of code Vulnerability details Impact The winner in the NFT raffle may be frontrun if he has listed his NFT for sale on a marketplace, stealing his raffle NFT. Proof of Concept A new VRFNFTRandomDraw Clone contract is deployed using makeNewDraw, with some NFT collection as drawingToken and...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•15 views

Might lose manager forever

Lines of code Vulnerability details Impact If project sets new manager with a typo, might lose manager forever Proof of Concept function setManager address manager public onlyOwner manager = manager; https://twitter.com/realgmhacker/status/1603362870699429889?s=20&t=vm4wY1ITefLhCW8BDa0oig...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•15 views

lastResortTimelockOwnerClaimNFT() can retrieve the token although drawing is in progress

Lines of code Vulnerability details Impact owner can retrieve the token although drawing is in progress Proof of Concept lastResortTimelockOwnerClaimNFT Be used in: " If no users ultimately claim the NFT, the admin specifies a timelock period after which they can retrieve the raffled NFT. " But i...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•15 views

Draw can be configured without uncancellable-redraw mechanism

Lines of code Vulnerability details Description RandomDraw initialize contains several checks for the range of drawBufferTime and recoveryTimelock. redraw buffer time can be between 1 hour and 1 month, while recoveryTimelock is between 1 week and 1 year from now. The issue is that the relative...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•20 views

Wrong value of MONTH_IN_SECONDS could make it impossible to recover NFT in 7 years

Lines of code Vulnerability details Impact Constant MONTHINSECONDS has incorrect value. Instead of 1 month, it has the value of 7 months. // @dev about 30 days in a month uint256 immutable MONTHINSECONDS = 3600 24 7 30; // @audit wrong value, could allow bufferTime and recoverTimelock become too...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•23 views

integer overflow or underflow

Lines of code Vulnerability details Impact If an integer overflow or underflow occurs in the contract, it could lead to incorrect calculations and potentially unintended consequences, such as the transfer of incorrect amounts of tokens or the allocation of incorrect amounts of rewards. This could...

7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•17 views

LOWER BOUNDARY OF DRAWING TOKEN RANGE IS TOO LOW

Lines of code Vulnerability details Impact The current logic in VRFNFTRandomDraw.sol could lead to undesirable edge cases due to allowing the lower limit of the drawing token range to be as low as 2. It could lead to a long drag before the raffle could end or cancel if one of the drawing tokens i...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•15 views

In case the winner is the address(0)

Lines of code Vulnerability details Impact Temporary freezing NFT this can be more than one period Proof of Concept On VRFNFTRandomDraw.fulfillRandomWords 254 request.currentChosenTokenId = 255 randomWords0 % tokenRange + 256 settings.drawingTokenStartId; In case ownerOfrequest.currentChosenToken...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•12 views

Owner can potentially prevent winner from claiming by starting draw after recover timelock and then calling lastResortTimelockOwnerClaimNFT

Lines of code Vulnerability details Impact The owner can call startDraw at any time, including after the recoverTimelock has expired, which means the owner can call lastResortTimelockOwnerClaimNFT and potentially reclaim the NFT immediately after the draw completes if they do not want the winner ...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•14 views

Wrong address input in BondNFT.createLock results in wrong _owner being saved in memory

Lines of code Vulnerability details Impact Wrong address input in createLock results in function failure of extendLock and claim. Proof of Concept When someone calls lock in Lock.sol, the function BondNFT.createLock is called . bondNFT.createLock asset, amount, period, msg.sender;...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•14 views

Lack of access control

Lines of code Vulnerability details The 'createReferralCode' function in the 'Referrals' contract allows any address to create a referral code. This could potentially lead to spam or misuse of the system. Impact If an attacker is able to create a large number of referral codes, they could...

7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•14 views

Potential race condition when claiming prize

Lines of code Vulnerability details Impact To determine whether a caller has won the raffle, the hasUserWon function of the VRFNFTRandomDraw contract queries the ownerOf function of the drawingToken contract, passing the currentChosenTokenId as argument. In essence, the function is only checking...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•16 views

Attacker can disable contract functionality

Lines of code Vulnerability details Impact Current setup of the protocol is vulnerable to a DoS attack. This can be achieved by anyone calling initialize on the implementation VRFNFTRandomDraw contract. With the implementation contract initialized the created clones cannot be re-initialized and...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•17 views

Malicious ChainLink's VRF manager can decide to not whitelist VRFNFTRandomDraw or brick ongoing raffles

Lines of code Vulnerability details Impact ChainLinks VRF manager has priviledged position, as all VRFNFTRandomDraw instances share the same VRFCoordinatorV2 address, and have to be whitelisted in order to be able to send requestRandomWords function. There is centralization risk in this case, tha...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•11 views

safeTransfer should be used instead of transferFrom in winnerClaimNFT

Lines of code Vulnerability details Impact The winner of the raffle may be a smart contract which doesn't handle NFTs, thus leaving the NFT irretrievably lost instead of being awarded to an address which can handle NFTs. Additionally, the NFT should be in the VRFNFTRandomDraw contract at the time...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•18 views

Unchecked setters

Lines of code Vulnerability details Impact Incorrect data: If the 'referred' or 'protocol' variables are set to incorrect values, it could result in incorrect or unexpected behavior in the contract. Manipulation: Malicious actors could potentially exploit this vulnerability to manipulate the syst...

7.1AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•14 views

Choosing a cheap gas lane may result in no winners

Lines of code Vulnerability details Impact The drawer can choose whichever gas lanekeyHash they like. Giving this choice to the drawer may result in no winners if the network is congested and the drawer chooses a cheap gas lane. Recommended Mitigation Steps Check the options of keyHashes that can...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•12 views

In consistent parameters settings can break the business logic

Lines of code Vulnerability details Impact The usual business logic of the raffle should be that: If a user wins a raffle, he can always claim the NFT before a redraw can be initialized. However, the settings parameters can be set to inconsistent so that a winner may not be able to claim the NFT...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•18 views

Malicious drawingToken can make bad actor claim the raffle NFT

Lines of code Vulnerability details Description Malicious drawingToken address passed into factory.makeNewDraw can claim the raffle NFT. It can be exploited via a social engineering attack or another scenario is that a malicious owner can pretend to make a raffle with a malicious drawingToken and...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•8 views

Wrong deposit amount in Trading.addToPosition()

Lines of code Vulnerability details Impact Users should deposit a full amount of addMargin but it deducts fee now. As a result, users will pay less funds than they should. Proof of Concept In addToPosition, users deposits addMargin - fee after the fee calculation. File:...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•17 views

The owner can swap the proxy implementation with a malicious one

Lines of code Vulnerability details The owner of VRFNFTRandomDrawFactory.sol could swap the current implementation with a malicious one at any moment, without a waiting period. Impact The worse case scenario is one in which the private key of the contract owner gets stolen. In this case the owner...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•19 views

Winning NFT owner/admin can rug pull attack or DoS attack on winner by removing the winning NFT.

Lines of code Vulnerability details Impact Given the current logic, it is possible to call the redraw method even after recoverTimelock has passed. If the owner does so, the contract will select a new winner for the winning NFT. But it will be up to the owner to give as much time to the winner to...

6.5AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•12 views

Transfering GovNFT does not update mapping userDebt

Lines of code Vulnerability details Impact Because of not updating the mapping userDebt for receiver userDebtfor on the transfer of GovNFT token, the receiver may be harmed, because of not getting collected fees. Proof of Concept Function transfer... is not updated for userDebtfor, here. Tools Us...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•13 views

Compromised or malicious owner of GovNFT contract can call _bridgeMint function on Chain A to block a Governance NFT's holder from bridging such NFT from Chain B to Chain A

Lines of code Vulnerability details Impact After a Governance NFT is minted and transferred to a user on Chain A, this user can bridge it to Chain B. Afterwards, because this NFT is already burned on Chain A, the owner of the GovNFT contract, who can possibly become compromised or malicious, can...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•16 views

Governance NFT holder, whose NFT was minted before Trading._handleOpenFees function is called, can lose deserved rewards after Trading._handleOpenFees function is called

Lines of code Vulnerability details Impact Calling the following Trading.handleOpenFees function does not approve the GovNFT contract for spending any of the Trading contract's tigAsset balance, which is unlike calling the Trading.handleCloseFees function below that executes...

7.1AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•17 views

The raffle could be slightly unfair as the owner of NFT ID which is closer to drawingTokenStartId could have more chance to win

Lines of code Vulnerability details Impact The raffle could be slightly unfair as the owner of NFT ID which is closer to drawingTokenStartId could have more chance to win. Proof of Concept As written in , "We want to raffle away a single NFT token based off of another NFT collection or drawingTok...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•15 views

Use of resignOwnership can lead to stuck NFT in contract

Lines of code Vulnerability details Impact Contract OwnableUpgradeable has a resignOwnership function that, if called, can potentially cause the loss of the NFT after a draw has been started. Proof of Concept These are the steps/conditions that make this issue happen: When the owner calls...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•17 views

DoS after creating 100 raffles under one subscriptionID

Lines of code Vulnerability details Impact If a user adds new consumer, function VRFCoordinatorV2::addConsumer is called: function addConsumeruint64 subId, address consumer external override onlySubOwnersubId nonReentrant // Already maxed, cannot add any more consumers. if...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•14 views

Error in trade accumulated interest calculation

Lines of code Vulnerability details Impact The trade's accumulated interest may result smaller than expected when long open interest is zero. Proof of Concept function tradesuint id public view returns Trade memory ... int256 pendingFunding; if trade.direction && longOi...... 0 pendingFunding =...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•15 views

Extending period in Lock contract will block user funds

Lines of code Vulnerability details Impact Extending lock will block users' funds. Contract: Lock.sol Proof of Concept Locking tokens with function lock... will update mapping mapping totalLocked for given asset with value of amount, here: totalLockedasset += amount. However, when extending lock...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•19 views

[NAZ-H1] Reentrancy From Use of _safeMint()

Lines of code Vulnerability details Impact The mint function is used to mint a new position NFT and is only callable by minter. This function uses safeMint to mint these position NFTs which has been known in the past to have Reentrancy issues. Proof of Concept The dangers of surprising code by...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•10 views

The way the winner claiming NFT is vulnerable to flashloan attack.

Lines of code Vulnerability details Impact The way the winner claiming NFT is vulnerable to flashloan attack. Proof of Concept This kind of attack is similar to ApeCoin Airdrop attack. To determine who is winng the current drawing, there is a hashUserWon function: function hasUserWonaddress user...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•11 views

Bad actor can burn VRFCoordinatorV2 LINK's balance

Lines of code Vulnerability details Impact All VRFNFTRandomDraw instances share the same VRFCoordinatorV2 address, and LINK fees are deducted from this smart contract. There are a couple of issues that may be exploited by malicious actor to overinflate calls to VRF and in lead to griefing, e.g. B...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•17 views

ERC20 approvals may need to be set to 0 beforehand

Lines of code Vulnerability details Impact There are some instances where there is an ERC20 approval for a max uint256 amount. ERC20 tokens such as USDT require the address allowance to be set to 0 beforehand, so this would cause reverts for those tokens. Proof of Concept -Token such as USDT gets...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•20 views

LP Rewards can be increased infinitely by a malicious liquidity provider

Lines of code Vulnerability details Impact LP Rewards can be increased infinitely by a malicious liquidity provider Proof of Concept A Bond NFT holder can claim pending rewards from a bond using the function Lock.claim. function claim uint256 id public returns address claimGovFees; uint amount,...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•16 views

Wrong update of stoploss in TradingExtension._limitClose()

Lines of code Vulnerability details Impact TradingExtension.limitClose returns a wrong stoploss which is favorable for users and it would be a significant loss for the protocol. Proof of Concept TradingExtension.limitClose is used to set takeprofit/stoploss prices for the pending order and execut...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•14 views

Unable to release funds deposited through Lock-extendLock

Lines of code Vulnerability details Impact Users depositing tig assets to the bondNFT through the Lock contract could find themselves unable to release their funds. The only explanation the user would receive is an "Arithmetic over/underflow" error. This issue greatly deteriorates the user...

6.8AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•17 views

reentrancy

Lines of code Vulnerability details Impact If an attacker were able to successfully exploit a reentrancy vulnerability in this contract, they could potentially cause the contract to enter an infinite loop, consuming all available gas and rendering it unusable. This could result in financial losse...

6.7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/12/16 12:00 a.m.•11 views

User can abuse tight stop losses and high leverage to make risk free trades

Lines of code Vulnerability details Impact User can abuse how stop losses are priced to open high leverage trades with huge upside and very little downside Proof of Concept function limitClose uint id, bool tp, PriceData calldata priceData, bytes calldata signature external checkDelayid, false;...

6.6AI score
SaveExploits0
Total number of security vulnerabilities10190