10190 matches found
Initialization function can be front-run
Lines of code Vulnerability details Detailed description of the impact of this finding: Exchange.sol has initialization function that can be front-run, allowing an attacker to incorrectly initialize the contract. Due to the use of the delegatecall proxy pattern, Exchange.sol cannot be initialized...
OwnableTwoStep delay not set
Lines of code Vulnerability details Impact Contract TokenRescuer inherits the contract OwnableTwoSteps but does not set any delay. There should be a constructor in TokenRescuer responsible for setting the delay as described in the comments of the OwnableTwoSteps contract. Without any delay,...
_returnETHIfAny() can silently fail, leading to an originator not getting the expected refund
Lines of code Vulnerability details The execute function refunds the unused ETH back to the originator through returnETHIfAny. This internal function uses a low-level call to transfer the ETH. The issue is that the return value of the call is not checked. As per the Solidity documentation...
Unsafe ERC20 operations due to lack of contract length check
Lines of code Vulnerability details Impact Functions executeERC20DirectTransfer and executeERC20TransferFrom replicates solmate libraries methods. The problem with this is that these functions does not check existence of code at the token address. If executeERC20DirectTransferand...
Address(0) owner is dangerous
Lines of code Vulnerability details Impact If the current owner confirms the renouncement, the new owner will have address zero. In this case no new owner can be assigned and the functions with onlyOwner modifier will be un-callable forever. Proof of Concept This mechanism is dangerous, because i...
calling execute() may lead to stealing funds if some ETH is stuck on the contract
Lines of code Vulnerability details Impact if some Ether is sent erroneously or not to the contract, anyone that calls correctly LooksRareAggregator.execute will be able to steal those coins. to execute the function using ethers as payment, these conditions must be true: there is at least a trade...
Public to all funds escape
Lines of code Vulnerability details Description The LooksRareAggregator smart contract implements a bunch of functions to escape funds by the contract owner see rescueETH, rescueERC20, rescueERC721, and rescueERC1155. In this way, any funds that were accidentally sent to the contract or were lock...
It is possible for ETH to be trapped inside LooksRareAggregattor contract
Lines of code Vulnerability details Impact If a user purchases NFTs with ETH or ETH and ERC20 tokens but with limited gas fees, it is possible that all purchase transactions are successful and have some ETH or ETH and ERC20 tokens left. The left ETH may be trapped inside the contract and the user...
Contract LooksRareAggregator does not verify the proxy has code when delegatecall() is called on the proxy
Lines of code Vulnerability details Impact Delegatecall will return ‘True’ for the status value if it is called on an address that is not a contract and so has no code. This can cause bugs if code expects delegatecall functions to return False when they have to perform special logic. If, for some...
Seaport proxy is missing ERC20 approval, so it can't buy any order that is listed using an ERC20
Lines of code Vulnerability details Impact Seaport proxy is missing ERC20 approval, so it can't buy any order that is listed using an ERC20. Proof of Concept function execute BasicOrder calldata orders, bytes calldata ordersExtraData, bytes calldata extraData, address recipient, bool isAtomic,...
User can drain all ether from LooksRareAggregator contract
Lines of code Vulnerability details Impact Anyone could drain all ether from this contract. Proof of Concept function execute TokenTransfer calldata tokenTransfers, TradeData calldata tradeData, address originator, address recipient, bool isAtomic external payable nonReentrant if recipient ==...
Overpayment of ETH is not refunded to the buyer
Lines of code Vulnerability details Impact Overpayment of ETH is not refunded to the buyer Proof of Concept ' function executeFundsTransfer address seller, address buyer, address paymentToken, Fee calldata fees, uint256 price internal if msg.sender == buyer && paymentToken == address0...
Upgraded Q -> M from #107 [1668211909800]
Judge has assessed an item in Issue 107 as M risk. The relevant finding follows: L-01 WardenPledge inherits Ownable instead of Owner The contract imports Owner.sol but inherits Ownable - should both import and inherit Owner --- The text was updated successfully, but these errors were encountered:...
Replay attack for authorized orders
Lines of code Vulnerability details Impact Detailed description of the impact of this finding. Nonce is used by sellers and buyers to avoid replay attack for their orders. However, since sellHash and buyHash only contain the order info and the nonce, it is still possible to have a replay attack...
The bulkExecute function does not bypass failed executions.
Lines of code Vulnerability details Impact Detailed description of the impact of this finding. According to the documentation, "Add bulk execute function; attempted executions that fail should be bypassed". However, the implementation of bulkExecute does not conform to this spec. Fail executions...
Loss of user funds
Lines of code Vulnerability details Impact The LooksRareAggregator contract can receive ether but cannot return it unless through the returnERC20TokensIfAny or returnETHIfAny function. This means that there is a scenario where a user can accidentally transfer funds to this contract and those fund...
Upgraded Q -> M from #272 [1668215320788]
Judge has assessed an item in Issue 272 as M risk. The relevant finding follows: Inaccurate comment can be misleading. The following retrievePledgeRewards function is for retrieving the non-distributed rewards from an expired pledge, not just a closed pledge. Calling this function for a pledge th...
Re-Entrancy when invoking ERC20EnabledLooksRareAggregator.execute() function
Lines of code Vulnerability details Impact We didn't check the address of currency . We don't know if the currency is ERC20 or not, and then just invoke currency.call. For these functions, we don't have any Re-Entrancy check. It will definitely lead to an Re-Entrancy issue on the currency side...
Upgraded Q -> M from #43 [1668210521611]
Judge has assessed an item in Issue 43 as M risk. The relevant finding follows: Q-02 - Huge trust assumption in recoverErc20 Reward tokens are transferred into this contract when a pledge is created. The comment notes " Recovers ERC2O tokens sent by mistake to the contract", but this function can...
Upgraded Q -> M from #20 [1668209885833]
Judge has assessed an item in Issue 20 as M risk. The relevant finding follows: 2. Ownable and Pausable The contract WardenPledge is Ownable and Pausable, so the owner could resign while the contract is paused, causing a Denial of Service. Owner resignation while the contract is paused should be...
Unsafe usage of ERC20 transfer and transferFrom
Lines of code Vulnerability details Impact Some ERC20 tokens functions don’t return a boolean, for example, USDT, BNB, OMG. So the LowLevelERC20Transfer contract simply won’t work with tokens like that as the token. Proof of Concept USDT’s transfer and transferFrom functions don't return a bool,...
Potential DoS when closing a credit nominated in ETH in the LineOfCredit contract
Lines of code Vulnerability details When closing a credit that was issued in ETH, the LineOfCredit contract will send the lender his deposit and any accrued interests using the address.transferamount function, which may fail and revert the whole function, leading to an eventual DoS. Impact The...
Using keccak256(abi.encoded()) can result in collisions
Lines of code Vulnerability details Proof of Concept The code in mutualConsent makes use of keccak256abi.encodePacked but this can result in a collision when the arguments of abi.encodePacked are aligned in a way that gives the same result. Impact Having hash collisions in mutualConsent...
Missing ReEntrancy Guard to sendOutTokenOrETH function
Lines of code Vulnerability details Proof of Concept There is no re-entry risk on true ERC-20 tokens that work according to the spec i.e. audited, etc.. However you can write a malicious ERC-20 with custom transferFrom or approve that have re-entrancy hooks to attack a target. Furthermore ERC-777...
Functions addCredit(...) and increaseCredit(...) can lock lender’s ETH forever
Lines of code Vulnerability details Impact In LineOfCredit contract, both functions addCredit... and increaseCredit... require mutual consent between lender and borrower. If lender is tricked by borrower, or by mistake, lender ETH will be locked in the contract forever. function addCredit uint128...
Logic in LineLib does not work correctly with fee-on-transfer tokens
Lines of code Vulnerability details Proof of Concept Some tokens take a transfer fee e.g. STA, PAXG, some do not currently charge a fee but may do so in the future e.g. USDT, USDC. The code currently receives ERC20 tokens but does not account for the potential fees paid in the transfer. If such a...
Logic in SpigotLib will not work with rebasing tokens
Lines of code Vulnerability details Proof of Concept Some tokens may make arbitrary balance modifications outside of transfers e.g. Ampleforth style rebasing tokens, Compound style airdrops of governance tokens, mintable / burnable tokens. The code in the claimEscrow function uses a previously...
Chainlink USD price feeds can have more than 8 decimals
Lines of code Vulnerability details Impact Collateral value is overestimated by orders of magnitude if asset that has a chainlink oracle USD price feed with more than 8 decimals is added. A borrower can borrow much more than allowed in an EscrowedLine Proof of Concept In Oracle.sol the USD price...
ETH can be accidentally sent with ERC20 in sendOutTokenOrETH function
Lines of code Vulnerability details Impact ETH can be accidentally sent with ERC20 in sendOutTokenOrETH function User who wants to send ERC20 due to payable function can write a value in the value field Proof of Concept contracts/utils/LineLib.sol: 33 / 34: function sendOutTokenOrETH 35: address...
LineLib.receiveTokenOrETH() can accept more ETH than it accounts for
Lines of code Vulnerability details Impact LineLib.receiveTokenOrETH can receive ETH and accounts for an amount to receive but it is possible to send more ETH than amount, meaning that any extra ETH sent will be lost to the contract. Proof of Concept LineLib.receiveTokenOrETH is as follows...
When lender consents before borrower in ETH credit token, all the lent funds are permanently lost.
Lines of code Vulnerability details Description The addCredit function transfers money from lender to a LineOfCredit contract, and opens a credit account. increaseCredit transfers additional funds to an existing credit account contract. Both functions are payable and guarded by mutualConsent, whi...
Closing an unexisting credit can overflow the credit count variable in the LineOfCredit contract
Lines of code Vulnerability details The LineOfCredit contract doesn't verify if a credit exists and is properly initialized when closing it, and will update its state anyway, leading to an inconsistent count. Impact The close function in the LineOfCredit contract doesn't check if the given credit...
Arbitrary call order to handle mutual consent can lead to unrecoverable native ETH
Lines of code Vulnerability details Creating new credits and increasing the credit deposit requires both parties, the lender and the borrower, to agree. This is implemented by having both call the same function with the same call data. However, as it's possible to use native ETH as a credit token...
call() should be used instead of transfer() on address payable
Lines of code Vulnerability details Proof of Concept The use of the deprecated transfer function for an address will inevitably make the transaction fail when: 1. The claimer smart contract does not implement a payable function. 2. The claimer smart contract does implement a payable fallback whic...
Revenue stream split can be bypassed
Lines of code Vulnerability details The Spigot.claimRevenue function allows anyone to claim revenue tokens from the spigot push and pull payments and escrows them for the owner to withdraw later. The revenue is automatically split between the treasury and escrow according to the settings in...
Unlimited length of LineOfCredit.ids: storage collisions
Lines of code Vulnerability details Impact There are no restrictions for ids length So malicious borrower may create many credits and replace storage slot data at some position Proof of Concept 1. LineOfCredit.ids saves array size in slot Oracle data feed is insufficiently validated in Oracle.sol...
Not checking amount of received ERC20 tokens
Lines of code Vulnerability details Description There are ERC20 tokens, which apply intenal fee on transfers such as USDT, so that amount of received tokens could differ from requested amount. There is a line where contract receives facilityFee as an amount of tokens. The same variable is used on...
Repaying a line of credit with a higher than necessary claimed revenue amount will force the borrower into liquidation
Lines of code Vulnerability details A borrower can repay parts of a credit line with the SpigotedLine.useAndRepay function. This function will use amount of unusedTokenscredit.token as a repayment. However, if amount exceeds the principal and the accrued interest, credit.principal will underflow...
Borrower can put their address when submiting addCredit() which can make the lender not be able to withdraw tokens
Lines of code Vulnerability details Impact when calling addCredit by borrower, they can choose to put in their address as the lender instead of the actuall lender. this can bring problems later on when the lender is trying to withdraw funds from the contract. they wont be able to withdraw the fun...
revenueContract that uses AccessControl instead of Ownable can’t work with SpigotLib's removeSpigot()
Lines of code Vulnerability details Proof of Concept The code in removeSpigot is the following bool success, = revenueContract.call abi.encodeWithSelector self.settingsrevenueContract.transferOwnerFunction, self.operator // assume function only takes one param that is new owner address ; So...
Wrong marketplace address in SeaportProxy.sol
Lines of code Vulnerability details Impact Detailed description of the impact of this finding. The marketplace variable in SeaportProxy was initialized in the constructor, however since SeaportProxy will only be used in a delegatecall, such initialization in the constructor will be useless as it...
Having nonzero allowance to the exchange will prevent any future trades
Lines of code Vulnerability details Impact A borrower can prevent other lenders to call claimAndRepay, in other words the lenders can not use the revenue streams in the spigotedLine. Proof of Concept Suppose a borrower has a stream of revenue token, and also borrowed some tokens already. Then the...
Line of credit status can be set to REPAID even if having credits with debt
Lines of code Vulnerability details A malicious borrower can close non-existing credits to alter the status of the credit to LineLib.STATUS.REPAID, even if having open credit with debt. Impact The close function in the LineOfCredit contract can be used to close non-existing credits, which will...
Borrower can craft a borrow that cannot be liquidated, even by arbiter.
Lines of code Vulnerability details Description LineOfCredit manages an array of open credit line identifiers called ids. Many interactions with the Line operate on ids0, which is presumed to be the oldest borrow which has non zero principal. For example, borrowers must first deposit and repay to...
## Potential for loops hitting the block gas limit
Lines of code Vulnerability details Proof of Concept A malicious/compromised LineOfCredit arbiter can add a huge amount of collaterals to the Escrow by calling enableCollateral. This method pushes each collateral token to an array that is then iterated over in getCollateralValue. If the array siz...
Borrower's principal can be enormous due to underflow
Lines of code Vulnerability details Impact The lender and the borrower can repay borrower's debt using unusedTokens in SpigotedLine.useAndRepay function. The repay amount can be as much as unusedTokenscredit.token in SpigotedLine.useAndRepay143. The actual repay is handled in CreditLib.repay, and...
When borrower repays, it can overflow and make them owe 2^256 tokens to lender.
Lines of code Vulnerability details Description CreditLib's repay function is the actual accounting of repayments in a LineOfCredit: function repay ILineOfCredit.Credit memory credit, bytes32 id, uint256 amount external returns ILineOfCredit.Credit memory unchecked if amount =...
SpigotedLineLib::trade won’t work with tokens with approval race protection (USDT)
Lines of code Vulnerability details Proof of Concept Some tokens e.g. USDT, KNC do not allow approving an amount M 0 when an existing amount N 0 is already approved. This is to protect from an ERC20 attack vector described here. The problem is the code in trade is the following...
Legitimate token / USD pairs with more than 8 decimals are not handled correctly
Lines of code Vulnerability details Impact The decimals returned by the Chainlink oracles are assumed to be 8 throughout this protocol. However, there are legitimate token / USD pairs that have the corresponding Chainlink oracles to return more than 8 decimals; for example, the AMPL / USD pair's...
Borrower can close non-existent credit line positions to effectively force the overall status to REPAID
Lines of code Vulnerability details The LineOfCredit.close function is used to close a credit line position. Both the lender of a specific credit position and the borrower can call this function. However, the function does not check if the given id belongs to a credit line position in the credits...