10190 matches found
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...
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...
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...
## 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...
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...
LineLib.sendOutTokenOrETH() may not be compatible with contract receiver because of use of transfer()
Lines of code Vulnerability details Impact LineLib.sendOutTokenOrETH may revert when its receiver is a contract, preventing it from receiving ETH, and thus from much of the functionality of the protocol. Proof of Concept LineLib.sendOutTokenOrETH is as follows. / @notice - Send ETH or ERC20 token...
State varaible marketplace has never been initialized in LooksRareProxy.sol
Lines of code Vulnerability details Impact Detailed description of the impact of this finding. State varaible marketplace has never been initialized in LooksRareProxy.sol. Although it has been initialized in the constructor, it won't count since functions such as execute will only be called via...
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...
Unlimited length of LineOfCredit.ids: out of gas
Lines of code Vulnerability details Impact There are no restrictions for ids length But there are many loops through ids. So if length will be bigger then some max value, loops may fail because of consuming all gas Proof of Concept Functions LineOfCredit.updateOutstandingDebt and...
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...
Borrower can manipulate the repayment queue, avoid paying back the initial lender
Lines of code Vulnerability details Impact In contract LineOfCredit, the repayment queue protects lenders and assured that they have to get paid back. Without a queue, a borrower could constantly refinance to lower rates and avoid paying back the initial lender from sponsors. Every time, borrower...
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...
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...
Oracleβs price is not checked for staleness
Lines of code Vulnerability details Proof of Concept The code makes use of Chainlinkβs latestRoundData method but it does no validations on the input from it. The protocol has handling for price that is negative or zero in the methods that call getLatestAnswer but it is missing a check for...
No Allowlist For Bridgeable ERC-20 Tokens
Lines of code Vulnerability details Vulnerability Details We noticed that the deposit function of the L1ERC20Bridge contract code snippet 1 permits a user to bridge any ERC-20 tokens including deflationary and rebase tokens from the L1 to the L2 network. We considered that permitting non-standard...
L1ERC20Bridge does not have an emergency stop mechanism to pause the bridge in case of any problems found.
Lines of code Vulnerability details Impact Right now, L1ERC20Bridge implements nonReentrant and access control mechanism to improve security. However, there is not any emergency stop mechanism that can be triggered by an authorized account to pause the bridge in case of some problems. It is highl...
Unsafe Initializations Of Bridge Contracts
Lines of code Vulnerability details Vulnerability Details During the zkSync initialization process, several complicated tasks would be required to execute. Incorrect configurations in some tasks could lead to unexpected vulnerabilities. One task of the zkSync initialization process is deploying a...
uint16 type for the facet position and selector position
Lines of code Vulnerability details Description In the Diamond library there is uint16 type used for the facet position and selector position in the FacetToSelectors and SelectorToFacet structs. That creates a restriction that the number of facets is limited by 2^16. In case when the number of...
_safeMint should be used to work with smart contract address
Lines of code Vulnerability details Fix safeMint should be used if you are sending the minted token to a Contract that is capable to manage NFTs or not. This is to prevent tokens to be lost. Recommended Mitigation Steps Replace mint with safeMint. Tools Used Manual review --- The text was updated...
Uninitializing Bridge Contracts' State Variables
Lines of code Vulnerability details Vulnerability Details The L1ERC20Bridge and L1EthBridge are implementation contracts that would be delegatecalled by their corresponding proxy contracts. In other words, all state variables and assets would be stored in the proxy contracts. In contrast, the...
L2 deposits might be reverted
Lines of code Vulnerability details Impact L1ERC20Bridge and L1EthBridge contracts have claimFailedDeposit function to withdraw funds from the initiated deposit, which failed when finalizing on L2. However, if the caller is allowed in senderCanCallFunction modifier, this function can be used to...
No sanity check on _l1Token can lead into a bad deployment on the bridge
Lines of code Vulnerability details No checks on l1Token can lead into a bad deployment on the bridge Impact deployL2Token calls bridgeInitialize which is only callable one time for token as it uses initializer modifier. There are no checks for 0 address which can be assigned by error as it is a...
Potential DoS in unbounded for loop
Lines of code Vulnerability details Proof of Concept The function facets in Getters.sol iterates over the DiamondStorage facets array. In Diamond.sol we can see that by calling diamondCut in a way that saveFacetIfNew gets called, the diamond owner can add an indefinite amount of entries. If this ...
No Checks On Withdraw Function For _amount
Lines of code Vulnerability details Impact If bridgeburn function is a faulty function or a contract that uses older version of solidity the variable the balance may overflow due to lack of checks. Proof of Concept In the function there should be a check balanceOfmsg.sender=amount to mitigate...
WHEN EVER CALLING bridgeMint OR bridgeBurn FUNCTIONS NEED TO CHECK THE STATUS OF THE TRANSACTIONS
Lines of code Vulnerability details Impact If not checking the status of the bridgeMint and bridgeBurn functions we don't know the the transactions are success or not. If function breaks any of the reasons we don't what happened and what is the status of the transactions. there is no solutions...
Mssing Crucial Checks When Unlocking funds for Withdraw Requests from L2
Lines of code Vulnerability details Impact Atomicity literally does not exist when users from L2 initiate a withdrawal by burning funds on the contract and sending the message to L1. This is giving malicious attackers plenty of time to stealthily launch a series of small and yet sizable forgery o...
1) THERE IS CONFLICT IN REQUIRE STATMENT. IN finalizeDeposit FUNCTION CHECKS require (msg.sender == l1Bridge, "mq"). IN bridgeMint FUNCTION IMPLEMENTATIONS onlyBridge Modifier CHECKS require(msg.sender == l2Bridge).
Lines of code Vulnerability details 1. Impact Let assume if we calling bridgeMint from finalizeDeposit function the msg.sender is l1bridge . if the msg.sender is not l1bridge can't run the finalizeDeposit but as per bridgeMint the msg.sender should be l2bridge. So it will cause the conflict . the...
Validator can revert block at no cost.
Lines of code Vulnerability details Impact Validator can revert block at no cost. Proof of Concept the validator should only call this function on Executor.sol to revert the unexecuted blocks if the block is not really not executable. /// @notice Reverts unexecuted blocks /// @param newLastBlock...
ERC20 and ETH might be returned back to the wrong originator
Lines of code Vulnerability details Impact Detailed description of the impact of this finding. Assume the address of erc20EnabledLooksRareAggregator was maliciously changed to fakeerc20EnabledLooksRareAggregator during an execution of LooksRareAggregator.execute then, the malicious user might for...
No commitment to data passed as input to the init contract during the execution of the diamond cut proposal
Lines of code Vulnerability details Description There is a function executeDiamondCutProposal in the DiamondCutFacet contract. It checks that proposal data passed as input to this call is equal to the data that is declared when the creation of this proposal using the following logic: require...
Governor ownership can be lost because of not sanity check
Lines of code Vulnerability details Governor ownership can be lost because of no checks Impact Sanity checks are important to not affect reputation / flows and users of the protocol when a mistake is done. 0 address should be checked for important address assignments in this case, only done in th...
Not possible to DiamondCut in frozen status
Lines of code Vulnerability details Impact DiamondCut's executeDiamondCutProposal executes the proposed diamondCut calldata in the Diamond is unfrozen condition. However, if there are any possible situations that require restriction implementation in which the upgrade should be executed in a froz...
BLOCK_PERIOD is incorrect
Lines of code Vulnerability details The BLOCKPERIOD is set to 13 seconds in Config.sol. uint256 constant BLOCKPERIOD = 13 seconds; Since moving to Proof-of-Stake PoS after the Merge, block times on ethereum are fixed at 12 seconds per block slots. . Impact This results in incorrect calculation of...
Multi Step upgrades introduce security risk
Lines of code Vulnerability details Impact If Governor upgrades the system using executeDiamondCutProposal function then freezing is removed. This could be a problem where Governor was still not ready to make freezable facet available as shown in POC Proof of Concept 1. Governor discovers a...
Bidder can abuse the bidIndices[] in finalize()
Lines of code Vulnerability details Impact finalize could be called by anyone, and the input array bidIndices is not sanity checked. Some malicious bidder can trick the bidIndices to always get the reserveQuotePerBase price. The seller would incur some loss. The other bidders are grieved, wasting...
Solmate safetransfer and safetransferfrom doesnot check the codesize of the token address, which may lead to fund loss
Lines of code Vulnerability details Impact In bid function, the safetransferfrom function doesn't check the existence of code at the token address. This is a known issue while using solmate's libraries. Hence this may lead to miscalculation of funds and may lead to loss of funds , because if...
Low level call returns true if the address doesnβt exist
Lines of code Vulnerability details Impact the low-level functions call, delegatecall and staticcall return true as their first return value if the account called is non-existent, as part of the design of the EVM. Account existence must be checked prior to calling if needed. Proof of Concept...
Filling all auction slots to win the auction
Lines of code Vulnerability details Vulnerability details Description The number of bids for one auction is limited to 1000. It means that someone may make all 1000 bids and thus invalidate all other bids. Therefore, a malicious user can win the auction with the minimum possible bid. It may seem...
Any use of fee-on-transfer tokens as quote tokens in auctions will result in freeze or loss of funds for users.
Lines of code Vulnerability details Description SIZE auctions do not support fee-on-transfer tokens. The platform rejects taxed baseToken during createAuction: // Passes https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.solL9 // Transfer base tokens to auction contrac...
Rebasing tokens as Base tokens for the auction could be stuck in the contract or mean loss of funds for the las person to withdraw
Lines of code Vulnerability details Impact Use of rebasing tokens is not checked and could result it stuck funds, inability to cancel an Auction or withdraw due amounts of base token for the last one to call withdraw Proof of Concept If a rebasing token is used for the base token the balance held...
Attacker can steal any funds in the contract by state confusion (no preconditions)
Lines of code Vulnerability details HIGH: Attacker can steal any funds in the contract by state confusion no preconditions LOC: Description Auctions in SIZE can be in one of several states, as checked in the atState modifier: modifier atStateAuction storage a, States state if block.timestamp...
[PNM-001] finalize with malicious input may allow multiple calls leading to fund draining
Lines of code Vulnerability details Description The finalize function of the contract SizeSealed is used to finalize an auction, allowing the auctioner or seller to be paid quote tokens and also eventually allowing successful bidders to withdraw base tokens. Once the finalize function is called,...
Some bidders can withdraw would claim moreof the baseToken when auction CliffPercent value is 1
Lines of code Vulnerability details Impact If an auction is created with a.timings.cliffPercent set to 1 , then during withdrawal of baseTokens after auction ends, the some bidders to withdraw would claim more tokens than others of the baseToken amounts. Proof of Concept 1. Auction A is created...
Quotetoken can be address(0) or any EOA and still allow auctions and bids to be created
Lines of code Vulnerability details Impact createAuction in SizeSealed.sol performs no validation of the auction parameters AuctionParameters sent to it and will allow a Seller to create an auction with an ERC20 quoteToken of address0 putting at risk the baseToken that has real value. In addition...
Refinalization with theft of funds from other auctions
Lines of code Vulnerability details Vulnerability details Description There is a finalize function in the SizeSealed smart contract. The function traverses the array of the bids sorted by price descending. There is a prevention of the refinalization by the modifier atStateidToAuctionauctionId,...
Unsafe cast blocks withdraw of tokens
Lines of code Vulnerability details Unsafe cast blocks withdraw of tokens Impact tokensAvailableAtTime is a internal function used by tokensAvailableForWithdrawal and this one being used internally also externally as it is public by withdraw method. cliffAmount is a uint256, being able to have mu...
Cancel auction does not get deleted leading to loss of quoteTokens
Lines of code Vulnerability details Impact A malicious seller can cancel the auction just after it has ended, receive their baseToken back and then call reveal to make bidders lose their tokens which is sent to address0. Since a.data.lowestQuote == typeuint128.max just before reveal call is made,...
Some cases maybe cause the bids unable to get their funds back.
Lines of code Vulnerability details Impact All of the following there cases maybe cause the bids unable to get their funds back. Details case1: If sellerwho is a bad man does not reveal in the reveal period, then all the bids will be unable to get their funds back. case2: If sellerwho is a bad ma...