Lucene search
K
Code423n4Recent

10190 matches found

Code423n4
Code423n4
added 2022/11/08 12:0 a.m.7 views

Seller can game the bidIndices[] in finalize()

Lines of code Vulnerability details Impact High bidders will be taken advantage of by malicious seller. It is likely that the high bidders will place bids above the market price, then the seller can effectively steal the price difference from them. And the other bidders are grieved, wasting time...

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

baseToken AND quoteToken CAN BE THE SAME ERC20 TOKENS, RESULTING IN TRICKING BIDDERS TO LOSE THEIR TOKENS

Lines of code Vulnerability details Impact createAuction can be called by anyone to create auctions. One of the input parameter that this function requires is auctionParams. Since the createAuction function doesn't check that baseToken AND quoteToken are same or not, an Adversary can create an...

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

Arbitrage Opportunity for Non-Sellers

Lines of code Vulnerability details Impact Non-sellers can flood the system with arbitrage auctions. Proof of Concept The seller can wait until 1 instant minute? before the end of the auction. Now the seller places a bid a couple percent above the current market price, enough to cover the seller'...

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

Use of abi.encodePacked on SizeSealed.computeMessage can cause auctions to never finalize

Lines of code Vulnerability details Impact The usage of abi.encodePacked on the SizeSealed.computeMessage function might cause an incorrect packing of baseAmount and the random salt for some specific combinations of bid/salt, which will cause SizeSealed.finalize to always revert with...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2022/11/08 12:0 a.m.13 views

Reentrancy in createAuction() function

Lines of code Vulnerability details Impact Some ERC20 tokens missing return values and don't fail in case of an unsuccessful transfer. Also, ERC777 tokens could call the tokens receivers during the transfer. If baseToken would be such a token that combines both properties - this could lead to a...

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

Front-running of bid calls

Lines of code Vulnerability details Description There is bid function in the SizeSealed contract. The function accepts the auctionId, which does not contain any information about the auction itself. As a result, transactions of users can be front-runned to enforce them bid for the auction with th...

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

Denial of service when baseAmount is equal to zero

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. On each iteration, it calculates the quotePerBase. When this variable is calculated, the...

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

Attacker can take all the winnings and fill up the bids and cause loss of funds or dos

Lines of code Vulnerability details Impact Attacker can fill up all the bids and steal and be the winner and cause a dos and then withdraw/refund the funds since when doing a refund the bid isn't taken off the array an attacker can make 1000 bids and cause dos and have 100 percent chance of winni...

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

quoteToken could be fee-on-transfer token

Lines of code Vulnerability details Impact Some ERC20 tokens could have fees for each transfer, they are known as "fee-on-transfer" tokens. While there is a check inside createAuction function that prevents these tokens from being baseToken, FoT tokens still allowed to be quoteToken which could...

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

SizeSealed.withdraw will revert on mulDivDown if a.data.lowest is the value zero, which can prevent withdraws for an auction

Lines of code Vulnerability details Proof of Concept The call to mulDivDown on L377 will revert if the third argument denominador is the value zero. See Solmate implementation. It's possible for a.data.lowestBase to receive the value zero, which will prevent the transfers from L381 and L384. Impa...

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

VARIABLE BALANCE TOKEN ASSOCIATED WITH LOSS AND LOCKING OF FUNDS

Lines of code Vulnerability details Impact ERC20 tokens that are either deflationary or re-basing down could have their respective balance change. The balance could become insufficient at the time of withdraw, refund or cancel to the bidders whose funds will be locked due to DOS. The way to take...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2022/11/08 12:0 a.m.12 views

Protocol won’t 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. If such a token as used, since in the protocol we cache t...

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

Casting to uint128 when valiue can exceed uint128.max

Lines of code Vulnerability details Impact In CommonTokenMath.tokensAvailableAtTime the result is cast to uint128 on line 62. Given that baseAmount close or at it's uint128.max, and cliffPercent is close or at it's max of 1e18 dictated on line 72 in SizeSealed.sol, cliffAmount can reach uint128.m...

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

msg.sender token balance is not checked before calling safeTransferFrom function

Lines of code Vulnerability details Impact createAuction FUNCTION and bid FUNCTION: Without checking the msg.sender token balance the transfer function may be failed to transfer token from msg.sender to contract address . this may cause a transactions failures. Same instance in 2 times PROOF OF...

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

Solmate's safeTransfer function does not check the existence of the contract

Lines of code Vulnerability details Impact Miscalculation of transferred funds and finally, loss of funds Proof of Concept Solmate's safeTransfer and safeTransferFrom functions do not check the ext code size of the address of the recipient and so, it may lead to a miscalculation of funds as it...

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

A bidder can buy baseToken with low price by exploiting the DOS prevention measure

Lines of code Vulnerability details Impact In order to prevent DOS attacks, the smart contract introduces a measure that limits the number of bids on an auction SizeSealed.solL157-L159. However, an attacker/bidder can exploit this measure to block others to place bids so that the attacker can buy...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2022/11/08 12:0 a.m.5 views

Providing the same address for the "base" and the "quote" tokens creates a risk of fund loss for the seller.

Lines of code Vulnerability details Impact The "createAuction" function requires the seller to input the address of a base and a quote token. However, there is no statement that checks whether or not these two provided addresses are the same. As a result, the seller could accidentally fill in an...

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

Denial of service from malicious bidder by filling up the bid index up until 1000

Lines of code Vulnerability details Impact Denial of service from malicious bidder by filling up the bid index up until 1000 Proof of Concept Initially inside bid function there is a check condition if bidIndex = 1000 then it will revert, so this will limit the size of bid created by bidder to...

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

Can't cancel bid when in the reveal period.

Lines of code Vulnerability details Impact Expected: Only allow bid cancellations while not finalized or in the reveal period. Actual: Can't cancel bid when in the reveal period. Recommended Mitigation Steps Change the code in to if a.data.lowestQuote != typeuint128.max || block.timestamp...

7.1AI score
Exploits0
Code423n4
Code423n4
added 2022/11/08 12:0 a.m.9 views

Return value of ecMul() not checked in encryptMessage()

Lines of code Vulnerability details Impact ecMul returns 1,1 if failed or with invalid parameters. But encryptMessage does not check for the return value of ecMul. If there is mistake of the private key or public key, the encrypted message will be useless and potentially fail the auction. Proof o...

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

Lack of notice period for critical operations

Lines of code Vulnerability details Impact All user assets can be locked or stolen. Proof of Concept All user assets can be locked or stolen if the L1ERC20Bridge or L1EthBridge is upgraded to a malicious contract. All user assets can be locked or stolen if governor is lost and...

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

Funds can be stolen

Lines of code Vulnerability details Impact For L2, any deposit finalization should come from L1 bridge address. Now the MailBox contract is currently helping to simulate such calls to be coming from L1. The problem is if within zkSync ecosystem, a contract is deployed with address same as L1 brid...

7.1AI score
Exploits0
Code423n4
Code423n4
added 2022/11/08 12:0 a.m.5 views

Bidder can steal all the base token by repeatedly calling finalize()

Lines of code Vulnerability details Impact All the base token will be stolen by malicious bidder, even worse the bidder might pay nothing at the end. Proof of Concept Anyone can call finalize, and it can be called multiple times. FinalizeData memory data is local, which means in each call, data i...

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

Seller can steal all the bid fund by repeatedly calling finalize()

Lines of code Vulnerability details Impact Bidders' fund will be stolen by malicious seller, they can not get refund. Proof of Concept In finalize, FinalizeData memory data is local, which means in each call, data is re-initialized. By calling finalize multiple times, a malicious seller can get t...

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

A total of 3 risks: one with imperfect concurrency judgment logic, one with unrobust business logic, and one with unreasonable timestamp settings

Lines of code Vulnerability details RISK 1: When creating an auction, if the exact same token is transferred to the contract in a very short period of time, it will cause one of the auctions to fail to be created. is caused by the following statement: if balanceAfterTransfer - balanceBeforeTransf...

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

Attacker can drain the SizeSealed.sol contract.

Lines of code Vulnerability details Impact An attacker can drain the SizeSealed.sol contract buy creating fake auction and manipulating some contract logic. POC Assuming that the SizeSealed.sol initially contains 10000 DAI tokens, I’ll demonstrate how an attacker can steal these tokens. The bug i...

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

Contracts will not working correctly after February 2106. Vesting will be locked forever if withdrawn after February 2106.

Lines of code Vulnerability details Impact Contracts will not working correctly after February 2106. Migration takes costs and is risky. You shouldn't pass on this work to future programmers. You should fix it in the first place. In case anything went wrong during migration, a big fund loss will...

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

Draining baseToken from contract by calling finalize function multiple times

Lines of code Vulnerability details Impact Draining baseToken from SizeSealed contract by calling finalize function multiple times Proof of Concept The finalize function can be called multiple times by providing clearingQuote to typeuint128.max. Currently inside finalize function there is no chec...

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

Auction can be DoS-ed with too many bids

Lines of code Vulnerability details Proof of Concept The bid functionality pushes every new bid to the a.bids array. On finalize this array is looped over. Now, if there are too many bids in it, the for loop gas consumption will go over the block gas limit, which is 30M gas units currently. The...

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

[PNM-002] finalize with malicious input may lock bidder funds in the contract

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,...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2022/11/08 12:0 a.m.14 views

Solmate's SafeTransferLib won't check if token has code, which can affect transfers in SizeSealed

Lines of code Vulnerability details Impact Not checking for token existence is a know issue for Solmate. This can cause unexpected contract functionality for transfers implemented in SizeSealed. Note that this might not be a problem for baseToken due to the check implemented in L103. However, thi...

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

Malicious seller can finalize his/her auction without changing data.lowestQuote , then auction's state will not be updated to States.finalized and this seller can repeat finalize or cancel auction to steal tokens from contract

Lines of code Vulnerability details Vulnerable details In contract, an auction's state will beStates.Finalized if data.lowestQuote of this auction is different from typeuint128.max. L33-34 data.lowestQuote is assigned to equal clearingQuote when seller finalize auction. L238 This value will be...

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

Wrong bidIndex calculation

Lines of code Vulnerability details Impact Return wrong bidIndex Proof of Concept SizeSealed.sol Tools Used Manual Recommended Mitigation Steps uint256 bidIndex = a.bids.length - 1 ; --- The text was updated successfully, but these errors were encountered: 👎 1 trust1995 reacted with thumbs down...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2022/11/08 12:0 a.m.12 views

seller can change lowestBaseand lowestQuote and the seller can make it diffrent values causing a dos or loss of funds

Lines of code Vulnerability details Impact When I a seller finalizes the auction they change the lowestQuote and lowestBase.When users withdraw from the auction after the auction is finalized. QuoteBought is calculated with the new amounts which can cause dos or refund their leftover quote amount...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2022/11/08 12:0 a.m.13 views

Bid can be cancelled after being finalized

Lines of code Vulnerability details Impact The SizeSealed contract's cancelBid function can be called after auction has been finalized, thereby allowing the bidder to withdraw their quoteToken after bid is finalized This is possible by bypassing the if a.data.lowestQuote != typeuint128.max ||...

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

Seller can stole users assets by create and then cancel the auction

Lines of code Vulnerability details Impact Seller can stole users assets by create and cancel auction Proof of Concept Seller can create an auction, then wait for people to participate in auction bidding, finally the seller cancel the auction and get the users assets. This scenario can happen wit...

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

[PNM-003] finalize can be called by bidders, allows them to cancelBid

Lines of code Vulnerability details Description The finalize function is used to finalize the auction, locking all bids, and paying the seller. However, any user, including bidders can call finalize, as it is a public function, and there are no user checks. This may allow bidders to input malicio...

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

Malicious seller can steal from bidders.

Lines of code Vulnerability details Impact A seller can cancel the auction after finalize and thus can steal money from the bidders and get their original baseToken back. POC When an auction is started the value of a.data.lowestQuote is set as typeuint128.max here . In the atState function this...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2022/11/07 12:0 a.m.55 views

Bridge should not allow ERC20 tokens with double-entry point

Lines of code Vulnerability details Impact If a token with double-entry point is escrowed in L1 bridge, the user could withdraw their token through the other entry point, thus rugpulling the bridge. And when they actually withdraw from L2, they will take other users' funds from the bridge. Proof ...

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

[Tomo-H1] All funds can drain if some conditions matched

Lines of code Vulnerability details function finalizeWithdrawal uint256 l2BlockNumber, uint256 l2MessageIndex, uint16 l2TxNumberInBlock, bytes calldata message, bytes32 calldata merkleProof external nonReentrant senderCanCallFunctionallowList...

7.3AI score
Exploits0
Code423n4
Code423n4
added 2022/11/07 12:0 a.m.8 views

Asymmetric level of transaction validation between L1 side and L2.

Lines of code Vulnerability details Impact May have double counting of deposits? Proof of Concept On L1 side, there are validations that ensure funds don't get lost nor double counted. For example, finalizeWithdrawal may be called multiple times by allowed callers in case previous calls fail...

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

Cross-chain replay attacks are possible with create2()

Lines of code Vulnerability details Impact Mistakes made on one chain can be re-applied to a new chain There is no chain.id in the create2 function data If a user does create2 using the wrong network, an attacker can replay the action on the correct chain, and steal the funds a-la the wintermute...

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

Same function

Lines of code Vulnerability details Both functions do the same thing, while logically one of the functions should be for layer one and the other function should be in layer two to perform the same operation. --- The text was updated successfully, but these errors were encountered: All reactions...

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

Upgraded Q -> H from 486 [1667781140997]

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

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

Upgraded Q -> M from 16 [1667781797574]

Judge has assessed an item in Issue 16 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/11/07 12:0 a.m.9 views

Upgraded Q -> M from 133 [1667781432368]

Judge has assessed an item in Issue 133 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/11/07 12:0 a.m.8 views

ergs price problem

Lines of code Vulnerability details No mechanism has been defined for " l2TransactionBaseCost" function. On the other hand, any Oracle is not used in the whole project to get the price of gas, so this whole project will suffer in coordinating between the price of “ergs” in ZK layer and the real a...

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

L2ETHBridge.l2TokenAddress returns CONVENTIONAL_ETH_ADDRESS instead of ETH_TOKEN_SYSTEM_CONTRACT_ADDRESS

Lines of code Vulnerability details Impact In the L2ETHBridge contract, both the withdraw and l2TokenAddress functions use CONVENTIONALETHADDRESS as the address of the L2ETH. However, L2ETH is actually an L2StandardToken contract at the ETHTOKENSYSTEMCONTRACTADDRESS address. If the user wants to...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2022/11/07 12:0 a.m.16 views

Hacker can front-run the L2 ERC20 token deployment.

Lines of code Vulnerability details Impact hacker can front-run the L2 ERC20 token deployment to block L2 ERC20 token finalizeDeposit Proof of Concept I intend to prove this piece of code is front-runnable by hacker: /// @notice Finalize the deposit and mint funds /// @param l1Sender The account...

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

Add chainId to address creation.

Lines of code Vulnerability details Impact Although it may not be in the plan to deploy multiple zkSync rollups, it makes sense to include chainid in computeCreate2Address from the very start. It would be more EIP-155 compliant, and will prevent future replay attacks, where a tx of first zkSync...

6.8AI score
Exploits0
Total number of security vulnerabilities10190