Lucene search
K
Code423n4Recent

10190 matches found

Code423n4
Code423n4
added 2023/03/20 12:0 a.m.7 views

Registering non-emoji domains doesn't work

Lines of code Vulnerability details Impact When registering a name containing a non-emoji tile, all the tiles are mapped to emoji tiles before registering a name, so the registered name is invalid. This ruins the protocol, the users can't use it to register the desired names unless they are purel...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/20 12:0 a.m.5 views

Implementation error in Namespace.fuse() leads to a wrong unicode representation

Lines of code Vulnerability details Impact The font class of a tile will be always considered as 0 emoji when a user registers a name. Proof of Concept To register a name, fuse is used taking as input the data of the characters. The name to register is a string created by converting the character...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/20 12:0 a.m.10 views

Missing totalFunds update in LiquidityPool's OpenShort(), causing LiquidityPool token holder to lose a portion of their token value

Lines of code Vulnerability details The function openShort in LiquidityPool.sol is missing an update to totalFunds, to increase LiquidityPool funds by the collected net fees. Impact As a result of the missing increment to totalFunds, the availableFunds in the LiquidityPool will be lower. This wil...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/20 12:0 a.m.6 views

Bio Protocol - Cross-Site Scripting via tokenURI SVG image

Lines of code Vulnerability details Impact It is possible to inject bio that is a valid javascript code into generated on-chain SVG image. Attacker might pass following payload as bio: alert1234 which will result in generation of SVG image with the code: text font-family: sans-serif; font-size:...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/20 12:0 a.m.4 views

Hedging during liquidation is incorrect

Lines of code Vulnerability details Impact Hedging will not work as expected, and LiquidityPool will lose funds without expectation. Proof of concept 1. When a short position is liquidated in contract Exchange, function liquidate will be triggered. It will burn the power perp tokens and reduce th...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/20 12:0 a.m.7 views

ProfilePicture subprotocol is immutably linked by subprotocolName to the CID protocol

Lines of code Vulnerability details Impact Besides having to re-register the protocol, it will also have to be redeployed. Proof of Concept A protocol is registered by name in the SubprotocolRegistry. Quoting the Canto Identity Protocol contest details: "In theory, someone can front-run a call to...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/20 12:0 a.m.10 views

Lack of token approval reverts the overall trade

Lines of code Vulnerability details Impact Since the user has not approved the params.collateralAmount, calling the safeTransferFrom function will result in a revert due to the lack of token approval. The Exchange contract not receive any collateralAmount. Proof of Concept...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/20 12:0 a.m.18 views

(Pseudo) Random Number Generator can be gamed, allowing a user to target desirable NFT traits

Lines of code Vulnerability details Impact Detailed description of the impact of this finding. The iteratePRNG function in the Utils.sol library is used in Tray.sol:drawing, which is used to determine the tile data that a user gets when they purchase an NFT in Tray.sol:buy. An attacker can exploi...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/20 12:0 a.m.5 views

If the underlying NFT is burned, getPFP may returns incorrect results

Lines of code Vulnerability details Impact ProfilePicture.getPFP will return information about the underlying NFT and when addressRegistry.getAddresscidNFTID ! = ERC721nftContract.ownerOfnftID, it will return 0. But if the underlying NFT is burned, getPFP may return incorrect information function...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2023/03/20 12:0 a.m.10 views

Exchange.sol#L87 : openTrade is returning incorrect totalCost value which has accounting issue when open or closing the trade.

Lines of code Vulnerability details Impact It returns the incorrect value. Any operation done based on this function,either at front end of at contract level , could end with incorrect output. Proof of Concept User can interact with Exchangle.sol to trade. He/she will call the openTrade. openTrad...

7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/20 12:0 a.m.10 views

Tray Owner Will Not be Able to Burn any Tray

Lines of code Vulnerability details Impact 1. There are two issues here, the check namespaceNFT != msg.sender && trayOwner != msg.sender && getApprovedid != msg.sender && !isApprovedForAlltrayOwner, msg.sender will only revert CallerNotAllowedToBurn if all of the conditions are true which is very...

7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/20 12:0 a.m.8 views

Hard coding ChainID is error prone

Lines of code Vulnerability details Impact Detailed description of the impact of this finding. Proof of Concept Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept. Tools Used Recommended Mitigation Steps --- The...

7.1AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.11 views

NonceHolder.setValueUnderNonce does not increase the minNonce when using sequential account nonce ordering

Lines of code Vulnerability details Impact The current available nonce can't be synchronized to the client and rpc resp in real time. As a result, the client can't use the correct nonce to signature transaction. Proof of Concept If the nonceOrdering type of the account is...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.12 views

[bootloader] A bytecode hash without the bytecode (preimage) can be marked as known, breaking the prover

Lines of code Vulnerability details This is a report of a finding in bootloader.yul. While the file is out of scope of the contest, the sponsor stated that they would still accept findings in the file and would judge them separately from the contest. Impact A bytecode hash for which the bytecode...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.22 views

[Medium - 1] Ecrecover precompile doesn't behave the same as the one from Ethereum

Lines of code Vulnerability details Impact According to the Ethereum yellow paper and in the specifications of the ecrecover precompile, it is stated that if the ecrecover doesn't return anything denoted by ∅, then the return should be 0 as well. If we take a look at the current ecrecover...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.6 views

Underflow if enough amount is sent to the contract

Lines of code Vulnerability details Impact In function withdraw function withdrawaddress l1Receiver external payable override uint256 amount = msg.value; // Silent burning of the ether unchecked balanceaddressthis -= amount; totalSupply -= amount; they are using unchecked to decrease balances. Th...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.7 views

Unsafe safeTransfer function

Lines of code Vulnerability details Impact The safeTransfer function of the SafeERC20.sol contract check that the target is actually a contract before calling it, this is to avoid calls to address with no code that will always return succes = true. For exemple if you use token.safeTransfer and...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.21 views

Division before multiply results in precision loss

Lines of code Vulnerability details Impact Precision loss occurs when division is carried out before multiplication, that can affect gas calculation in terms of publishing the data to L1. Proof of Concept Tools Used Manual Review Recommended Mitigation Steps Recommendation is made for avoiding...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.71 views

The call to MsgValueSimulator with non zero msg.value will call to sender itself which will bypass the onlySelf check

Lines of code Vulnerability details Impact First, I need to clarify, there may be more serious ways to exploit this issue. Due to the lack of time and documents, I cannot complete further exploit. The current exploit has only achieved the impact in the title. I will expand the possibility of...

7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.15 views

EVM Elliptic Curve Recovery Discrepancy

Lines of code Vulnerability details Impact The Ecrecover.yul file meant to simulate the ecrecover mechanism as executed by traditional ETH 1.0 consensus mechanisms is incorrect. In detail, it does not conform to the "Homestead" update which introduced an upper-bound check for s values of an r, s,...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.14 views

Contracts are susceptible for Head Overflow Bug in Calldata

Lines of code Vulnerability details Impact ABI-encoding a tuple with a statically-sized calldata array in the last component would corrupt 32 leading bytes of its first dynamically encoded component. Proof of Concept The functions are taking input arguments as calldata. Following contracts are...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.17 views

Wrong block number calculation

Lines of code Vulnerability details Impact Detailed description of the impact of this finding. The calculation for the block info is currentBlockNumber + 1 BLOCKINFOBLOCKNUMBERPART + newTimestamp. getBlockNumberAndTimestamp, getBlockTimestamp, getBlockNumber all incorrectly calculate the current...

7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.9 views

Incorrect argument passed to "Utils.characterToUnicodeBytes" in "Namespace.fuse"

Lines of code Vulnerability details Impact The function Namespace.fuse uses Utils.characterToUnicodeBytes to get the unicode bytevalue for a given Tile. The first argument of characterToUnicodeBytes is an uint8 value representing the font class. Instead of passing the font class in the tile data,...

7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.9 views

No check for checking the "to" address to not be zero address in _execute() function of DefaultAccount.sol

Lines of code Vulnerability details Impact The "to" address can be zero address while converting from uint256 to uint160. Proof of Concept // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; contract Test uint256 public to = 2160; function check external view assertaddressuint160to ==...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.14 views

The "totalRequiredBalance()" function in the TransactionHelper.sol library can compute address(uint160(_transaction.paymaster) as zero address even when _transaction.paymaster is non-zero

Lines of code Vulnerability details Impact A user may provide a non-zero entry for the "transaction.paymaster" field for a transaction to ensure they do not have to pay the gas fees. However, certain values of "transaction.paymaster" = 2^160 can result in addressuint160transaction.paymaster to be...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.9 views

Unchecked msg.value will lead to losing funs inside the contract

Lines of code Vulnerability details Impact While paying for the transaction, function payForTransaction bytes32, // txHash bytes32, // suggestedSignedHash Transaction calldata transaction external payable ignoreNonBootloader ignoreInDelegateCall //@audit-issue no checks that actulayy there is...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.7 views

L2EthToken.withdraw can be underflow with little cost

Lines of code Vulnerability details Impact calculating balanceaddressthis within unchecked will cause underflow. Say if balanceaddressthis == 1 and msg.value == 2, after calling withdraw, balanceaddressthis will be typeuint256.max Proof of Concept function underFlowuint a, uint b public pure...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.12 views

My Findings

Lines of code Vulnerability details Impact 1. Integer overflow: In the publishCompressedBytecode function, the check dictionary.length = 2 16 8 is intended to ensure that the dictionary does not become too large, but it is not sufficient to prevent an integer overflow. If dictionary.length exceed...

7.3AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.12 views

Unchecked return values in setValueForNextCall

Lines of code Vulnerability details Title: Description: When creating a contract, if there is value to be transferred the constructContract function of ContractDeployer will use the SystemContractsHelper.setValueForNextFarCall Method: However in constructContract function doesn't verify that the...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.16 views

Incorrect calculation of gasToPay due to dividing before multiplying, rounding error.

Lines of code Vulnerability details Impact In Solidity, it is an error to divide before multiplying because of lots of rounding errors that can come from that. In this case: uint256 pubdataLen; unchecked pubdataLen = message.length + 31 / 32 32 + 64; uint256 gasToPay = pubdataLen...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.13 views

Anyone can steal funds in the Contract Deployer

Lines of code Vulnerability details Impact If ContractDeployer.sol ever holds funds, it could potentially be drained via the chained creation of new contracts. Proof of Concept When creating a contract the create/create2 functions will be called inside the contract deployer here: , which after...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.6 views

Malicious or hacked admin can steal all ETH

Lines of code Vulnerability details Impact In L2EthToken.sol we have transferFromTo It is possible malicious or hacked admin to steal the ETH. Proof of Concept As can be seen from the code snippet below, nothing can stop malicious or hacked admin to steal all ETH. He can use address from and send...

7.3AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.16 views

Unsafe cast

Lines of code Vulnerability details Impact In AccountCodeStorage.sol we have function getCodeHash and getCodeSize Due to an insecure cast, it is possible to get an integer overflow. Solidity version 0.8.0 provide SafeMath, but casting operations are not safe and can overflow. Proof of Concept As...

7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.16 views

[Medium - 2] A force deployed contract may be stuck in the constructor forever

Lines of code Vulnerability details Impact The forceDeployOnAddress function in the ContractDeployer contract may be used to redeploy contracts at a specified address. Very useful in the case of precompiles or system contracts upgrades for instance. In the deployment parameters, multiple values c...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.13 views

bootloader doesn't add tighter gas limit to the IAccount.validateTransaction call

Lines of code Vulnerability details Impact As mentioned in the competition details: Important, while the bootloader is out of scope, we may reward an additional bounty for valid bugs found in it by our judgement! As mentioned in the dev document, , there are some limitations of the verification a...

7.1AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.10 views

DefaultAccount will add system call flag to any call with msg.value

Lines of code Vulnerability details Impact As mentioned in the repo's README.md documentation: isSystem flag. Whether the call intends a system contracts' function. While most of the system contracts' functions are relatively harmless, accessing some with calldata only may break the invariants of...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.14 views

Default accounts cannot pay transaction fees due to DefaultAccount not calling MsgValueSimulator

Lines of code Vulnerability details Impact Default accounts cannot pay the transaction fees to the bootloader. It's not clear whether the attempts to do so will silently succeed or revert because the behaviour of the CALL opcode in the zkSync Era virtual machine isn't explained in the description...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.10 views

User transactions can call system contracts directly

Lines of code Vulnerability details Impact User transaction can call system contracts directly, which shouldn't be allowed to not invoke potentially dangerous operations. Proof of Concept The DefaultAccount.executeTransaction executes a user transaction after it was validated. The function calls...

6.6AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.7 views

[H-01] User that fuse more tiles to Namespace NFT pay lesser fusing costs instead of greater

Lines of code Vulnerability details Impact User that fuses more tiles will pay lesser fusing costs to revenueAddress instead of higher cost as intended Proof of Concept Namespace.solL110-L114 /Namespace.sol 110: function fuseCharacterData calldata characterList external 111: uint256 numCharacters...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.13 views

NonceHolder.setValueUnderNonce lack of validation

Lines of code Vulnerability details Impact NonceHolder.setValueUnderNonce can set the nonce value for key has already being used. Proof of Concept Quoting to the document NonceHolder part: It provides a function validateNonceUsage which the bootloader uses to check whether the nonce has been used...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.18 views

User may lose ETH

Lines of code Vulnerability details Impact User may lose ETH Proof of Concept If a non-existent function is called , the protocol may enter MsgValueSimulator.fallback.Inside the fallback function ,the protocol will transfer ETH from one address to another. If user calls a function that doesn't...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.10 views

Loss of funds when msg.value > 2**128

Lines of code Vulnerability details Impact When a user try to transfer an amount of ether 2128 an invariant is broken where instead of reverting the transaction the affected code just return. Proof of Concept The following is the affected code where it returns instead of reverting. if value != 0...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.7 views

function _nonSystemDeployOnAddress() should try another nonces when getNewAddressCreate() result is in kernel space otherwise some logics would be broken

Lines of code Vulnerability details Impact Function createAccount Deploys a contract account with similar address derivation rules to the EVM's CREATE opcode. the deployed contract address is calculated based on sender deployed nonce. code uses nonSystemDeployOnAddress to deploy the contract to n...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.8 views

deploying contracts with forceDeployOnAddress will break contracts when callConstructor is false

Lines of code Vulnerability details Impact when function forceDeployOnAddress used for deploying contract and callConstructor is false, then contract's bytecodehash would stay in constructing state and calling the contract won't be possible. it can cause protocol and other contracts that are usin...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.12 views

Unchecked return value of call will allow to send messages marked as sent but will fail due to not enough gas

Lines of code Vulnerability details Impact On the sendTol1 function, they are sending the message via the SystemContractHelper: SystemContractHelper.toL1true, bytes32uint256uint160msg.sender, hash; the problem relies on the fact that they are not checking whether the message was actually sent...

6.8AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.8 views

Namespace tokenName has only emojis.

Lines of code Vulnerability details Impact The tokenName and image of Namespace should always be the same. The image is correct but the tokenName only consists of emojis. Duplicate names are checked on the tokenName and not on the image. Because of this a tile of font class 1 with character index...

6.7AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.16 views

NonceHolder.setValueUnderNonce does not check if the nonce has been used before

Lines of code Vulnerability details Impact Already used nonces or the nonces less than the specified minimal nonce can be used by the NonceHolder.setValueUnderNonce function. It can lead to some unique conflicts and even replay attacks on some of dapps which are based on the values under nonces...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.13 views

External calls can be manipulated

Lines of code Vulnerability details Impact By making external calls to untrusted contracts, the sender might manipulate the contract's state and cause unintended behavior. Proof of Concept In the tokenURI and mint functions, the contract makes external calls to ERC721nftContract.tokenURInftID and...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.9 views

Users pay excessive gas cost for sending bytecode hashes to L1

Lines of code Vulnerability details Impact When deploying new contracts, users are forced to pay more gas than is required to publish the bytecode hash to the L1. Proof of Concept When users deploy new smart contracts, the protocol marks the hashes of the bytecodes of the contracts as known and...

6.9AI score
Exploits0
Code423n4
Code423n4
added 2023/03/19 12:0 a.m.12 views

Here are some potential security vulnerabilities that I have identified in this particular contract (BytecodeCompressor.sol)

Lines of code Vulnerability details Impact 1. Integer overflow: In the publishCompressedBytecode function, the check dictionary.length = 2 16 8 is intended to ensure that the dictionary does not become too large, but it is not sufficient to prevent an integer overflow. If dictionary.length exceed...

7.3AI score
Exploits0
Total number of security vulnerabilities10190