Lucene search
+L
Code423n4Recent

10190 matches found

Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•18 views

Potential uint underflow

Lines of code Vulnerability details Impact Potential underflow if shares is greater than totalSupply Proof of Concept Tools Used Manual review Recommended Mitigation Steps Before the following line, check if totalSupply is greater or equal to shares --- The text was updated successfully, but thes...

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

AutoPxGmx.compound function can be directly called with a fee input value that is not the configured Uniswap pool fee

Lines of code Vulnerability details Impact Calling the following AutoPxGmx.withdraw and AutoPxGmx.redeem functions would execute compoundpoolFee, 1, 0, true, which uses the configured Uniswap pool fee as the fee input of the AutoPxGmx.compound function below to further call the...

7.1AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•24 views

Functions like AutoPxGmx.withdraw and AutoPxGmx.redeem do not provide effective slippage control

Lines of code Vulnerability details Impact As shown below, calling the AutoPxGmx.withdraw and AutoPxGmx.redeem functions would execute compoundpoolFee, 1, 0, true, which uses the hardcoded 1 as the amountOutMinimum input of the AutoPxGmx.compound function to further call the...

7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•15 views

´userAccrue` rewards manipulation

Lines of code Vulnerability details Impact A flashloan can be used to set a huge last balance which later will accrue a huge reward. Proof of Concept Buy lots of a rewards-producing token, possibly by means of a flashloan. Call PirexRewards.userAccrue which sets u.lastBalance to this now very hig...

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

The _recipient address has no limits to the amount of tokenID (NFTs) it can own

Lines of code Vulnerability details Impact Since the recipient address has no limit to the number of tokenIds it can hold, this makes it possible for an attacker to call the register function many times with different addresses and send many tokenIds to the same recipient, which could cause a...

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

Solmate saftransfer and safetransferfrom does not check the codesize of the token address, which may lead to fund loss

Lines of code Vulnerability details In PirexGmx.sol and ERC4626Vault.sol, the contract uses the solmate library which does not check the existence of code at the token address. This is a known issue when using solmate's libraries. Reference: Impact Possible loss of funds and miscalculation. Proof...

7.2AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•13 views

CallEVM does not validate the existence of the address being called

Lines of code Vulnerability details Impact Evm.go's CallEVM function performs a EVM call to a given address with an input amount. However, the existence of the address is not validated. If the call is made with an amount to a contract, where it might be deleted or non-existed, the funds will be...

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

user fund lose in deposit() of PirexERC4626 contract because A MALICIOUS EARLY USER/ATTACKER CAN MANIPULATE THE VAULT’S PRICEPERSHARE TO TAKE AN UNFAIR SHARE OF FUTURE USERS’ DEPOSITS

Lines of code Vulnerability details Impact This is a well-known attack vector for new contracts that utilize pricePerShare for accounting. Attacker can cause totalAssets / totalSupply ratio to go as high as he wants and then because of rounding error in convertToShares lower amount of share would...

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

Not checking if tokenId exist on distributeFees

Lines of code Vulnerability details Impact Not checking if tokenId exist on distributeFees can set the msg.value to uncreated tokenId Proof of Concept For example an Owner mistakenly call distributeFee with a tokenId which doesn't exist, then the function will success, but unfortunately any user...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•34 views

User can continuosly accrue rewards they are not due

Lines of code Vulnerability details Impact It is possible that block.timestamp can be manipulted by a user, thus allowing a malicious user to continuously acrue rewards they are not due, as long as the value is not 0 then rewards will be accrued function userAccrueERC20 producerToken, address use...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•39 views

fee loss in AutoPxGmx and AutoPxGlp and reward loss in AutoPxGlp by calling PirexRewards.claim(pxGmx/pxGpl, AutoPx*) directly which transfers rewards to AutoPx* pool without compound logic get executed and fee calculation logic and pxGmx wouldn't be executed for those rewards

Lines of code Vulnerability details Impact Function compound in AutoPxGmx and AutoPxGlp contracts is for compounding pxGLP and additionally pxGMX rewards. it works by calling PirexGmx.claimpx, this to collect the rewards of the vault and then swap the received amount to calculate the reward,...

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

Uniswap V3 swaps are vulnerable to a sandwich attack

Lines of code Vulnerability details Impact As the amountOutMinimum is always hardcoded with 1 in the AutoPxGmx, then the Uniswap V3 swap is vulnerable to a frontrun / sandwich attack. Proof of Concept Even though the amountOutMinimum may never be 0 because it is prevented against it: if...

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

lack of unregiestered function existen

Lines of code Vulnerability details there is no function to let a smart contract to unregester from a tokenid , since a smart contract can only be regestered once its highly recommended to give it an ability to unregister from a tokenid and register again bob calls register bob has two...

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

First depositer can break Vault share distributions

Lines of code Vulnerability details The calculation of exchange rate for shares in PirexERC4626 Vault is done by dividing the total supply of shares by the totalAssets of the vault. The first depositor can mint a very small number of shares, then donate to the vault to manipulate the share price...

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

Code is vulnerable to ERC4626 first depositor shares manipulation exploit

Lines of code Vulnerability details Proof of Concept The normal ERC4626 implementation which is not changed in the repository has a vulnerability which can result in the first depositor stealing every subsequent depositor’s funds. It works like this: 1. Vault is just deployed and Bob deposits jus...

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

DoS on claiming rewards in PirexRewards is possible

Lines of code Vulnerability details Proof of Concept The claim method in PirexRewards iterates over the rewardTokens array for a producerToken. Now this array is completely managed by the contract’s owner who can call addRewardToken which pushes a new value in that array, as many times as he...

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

The First Turnile Mint Token ID starts with 0.

Lines of code Vulnerability details Impact The First Turnile Mint Token ID starts with 0. Proof of Concept After deployment, the first Turnile token ID to be minted when a user calls the register function, is 0. At this point, the currentTokenId becomes 1 but the token doesn’t exist until the...

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

Incentive fund loss when calling claim() in AutoPxGlp/PxGmxRewards because it calls this.compound(,,true) which would transfer incentive to contract itself and those funds won't be calculated as rewards or fee and won't be accessible to withdraw

Lines of code Vulnerability details Impact Function claim in PxGmxReward contract is used for claiming available pxGMX rewards of a user. but this function calls IAutoPxGlpaddressthis.compound1, 1, true; to harvest new rewards and stake them to compound rewards. but this call is external call and...

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

compound could be used by uniswap stakers to maximize fees for AutoPxGmx users

Lines of code Vulnerability details Impact Anyone can call AutoPxGmx::compound. Hence a staker in the 10000 1% fee uniswap pool can call compound with that pool and take a larger fee from AutoPxGmx users maximizing their gains and griefing users. Proof of Concept fee chooses which uniswap pool to...

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

The existence of the tokenID is not validated in distributeFees()

Lines of code Vulnerability details Impact Turnstile contract has distributeFees function which the Canto team/smart contract utilizes to distribute the fees to the tokenID's for the smart contract that is registered through register function. The existence of the tokenID's are checked both in...

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

Lack of input validation to check whether the tokenId of the NFT exists or not - this lead to misallocation of fee earned

Lines of code Vulnerability details Impact In the distributeFees function, there is no input validation to check whether the tokenId of the NFT exists or not. If a caller inputs tokenId that does not exist, the fee earned will be added to the balance of tokenId that does not exist. Although this...

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

distributeFees did not check if tokenId exist can lead to loss of asset

Lines of code Vulnerability details Impact distributeFees did not check if tokenId existed, can lead to loss of asset Proof of Concept inside Turnstile.sol file, the distributeFees function did not check if the tokenId exist or not. 148: function distributeFeesuint256 tokenId public onlyOwner...

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

PirexERC4626 and PirexGmx doesn't support erc20 tokens with fee on transfer

Lines of code Vulnerability details PirexERC4626 and PirexGmx doesn't support erc20 tokens with fee on transfer Vulnerability details There are ERC20 tokens that charge fee for every transfer / transferFrom. Different functions assumes assumes that the received amount is the same as the transfer...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•22 views

NameWrapper: Cannot prevent transfer while upgrade even with CANNOT_TRANSFER fuse regardless of the upgraded NameWrapper's implementation

Lines of code Vulnerability details Impact Upon upgrade to a new NameWrapper contract, owner of the node will be set to the given wrappedOwner. Since the node will be burned before calling the upgraded NameWrapper, the upgraded NameWrapper cannot check the old owner. Therefore, no matter the...

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

Existing tokens can be given to other contracts when assign function is called

Lines of code Vulnerability details Impact In the Turnstile contract when the assign function is called any unregistered contract can register himself as the feeRecipient for any given token id, but in reality only the token owner should be able to assign a new smart contract as feeRecipient for...

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

Fuses rollover with renew

Lines of code Vulnerability details Impact User will not be able to change fuses even after actual expiry Proof of Concept 1. User A wraps his .eth domain test.eth using the wrapETH2LD function with fuse CANNOTBURNFUSES 2. This internally calls wrapETH2LD function with User A provided fuses 3. Th...

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

Slippage protection on AutoPxGmx::compound calls is insufficient and can result in MEV

Lines of code Vulnerability details Proof of Concept The compound method has the amountOutMinimum parameter, which basically serves as the slippage tolerance parameter. The problem is that everywhere in the code where compound is called, the value of amountOutMinimum is just 1 wei, which basicall...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•19 views

Unlimited minting of pxGmx in PirexGmx.sol which may break protocol

Lines of code Vulnerability details Impact Unlimited minting of pxGmx which may break protocol. Proof of Concept A user can call depositGmx on PirexGmx.sol and mint some pxGmx after staking some Gmx via gmxRewardRouterV2.stakeGmxamount and transferring GMX into the contract. // Transfer the...

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

A malicious user might call AutoPxGmx.compound() with a higher fee than poolFee.

Lines of code Vulnerability details Impact A malicious user might call AutoPxGmx.compound with a higher fee than poolFee. As a result, there would be a fund loss for the users because they paid more than expected for the swap router. Proof of Concept As we can see here, Uniswap V3 introduces...

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

Incorrect rounding while withdrawing assets from AutoPxGmx and AutoPxGlp contracts

Lines of code Vulnerability details The function previewWithdraw is overridden in the AutoPxGmx and AutoPxGlp contracts to account for penalty fees while exiting the vaults. This happens in line 212 of the AutoPxGmx contract and similarly in line 190 of the AutoPxGlp contract: return totalSupply ...

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

Price manipulation can lead to users lossing funds

Lines of code Vulnerability details H Price manipulation can lead to users lossing funds Impact Early malicious user will profit from future users' deposits while future users' will loose funds/value. Proof of Concept An early user can call the deposit function of any of the ERC4626 vaults with...

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

The recipient address check during handling register events will confuse users and block the users contracts registering

Lines of code Vulnerability details Impact The check about if the receiver account exists in the evm store doesn't make sense and will cause users to encounter a confusing exception. And the RegisterEvent function will not throw an exception to revert the tx, the source contract will be wrote in...

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

Potential mismanaging of the access and roles

Lines of code Vulnerability details Impact In initiateMigration method we are setting migratedTo to an address of the potential migration contract Later on, if completeMigration is called, it basically checks if the provided oldContract is equal to migratedTo when we enter the migrateReward metho...

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

isContract might return false for the contracts

Lines of code Vulnerability details Impact The Turnstile contract's register function assumes the msg.sender is a smart contract. The validation of this is carried out in eventhandler.go's ValidateContract function. ValidateContract checks whether the address has an emptyCodeHash which is zero...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•21 views

Allowance underflow

Lines of code Vulnerability details Impact I think the following check is unnecessary but furthermore, there should be a comparison if the allowance amount allowed is equal or greater than shares amount. Otherwise, we would end up with underflow of the uint value Proof of Concept Tools Used Manua...

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

Use Of block.timestamp Can Result In Attacker Manipulating His/Her Rewards In Their Favour

Lines of code Vulnerability details Impact If an attacker manipulates the block.timestamp in their favor then they can get higher rewards as uint256 rewards = u.rewards + u.lastBalance block.timestamp - u.lastUpdate in this equation lets say the attacker called this just now , and on the next...

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

platform should be approved again after it's changed by the admin.

Lines of code Vulnerability details Impact In AutoPxGmx.sol and AudotPxGlp.sol, it doesn't approve properly when platform is changed. As a result, PirexGmx contract can't transfer gmx or gmxBaseReward from these contracts and the main logic won't work as expected. Proof of Concept As we can see...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•20 views

NameWrapper: expired names behave unwrapped

Lines of code Vulnerability details Impact expired Names are supposed to be unregistered, but it behaves like unwrapped parent with CANNOTCREATESUBDOMAIN fuse can "create" again an expired name parent can ENS.setSubdomainOwner before burning CANNOTCREATESUBDOMAIN to be able to use the subdomain...

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

The compound() function is used with a fixed amountOutMinimum value

Lines of code Vulnerability details Impact The compound function helps to swap the gmxBaseReward ether for GMX tokens then the GMX tokens are deposited for pxGMX. In the swap function the amountOutMinimum helps to put the minimum value that is expected for the swap. The fixed amountOutMInimum...

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

incorrect commend and/or rounding issues in AutoPxGmx and AutoPxGlp

Lines of code Vulnerability details Impact The comments on the affected lines state previewWithdraw will round up. However, the implementation, an inner call to convertToShares is made, which actually calls mulDivDown. From further inspection, this pair of functions withdraw, previewWithdraw as...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•19 views

PostTxProcessing can revert user transactions not interacting with Turnstile

Lines of code Vulnerability details Impact Any transaction, even those that don't interact with the Turnstile contract, can be reverted by the PostTxProcessing hook if there was a CSR specific error. Thus, the CSR module can impair the behavior of smart contracts not related to the module. Proof ...

7AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•31 views

Unbounded loop can block claim

Lines of code Vulnerability details Unbounded loop can block claim Impact There are no bounds on the number of rewardTokens in the loop, this can run out of gas due to cost of the operations. Proof Of Concept function claimERC20 producerToken, address user external ... uint256 rLen =...

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

Add reward token existence check in order to avoid user reward lost.

Lines of code Vulnerability details Impact The user can lost his rewards if the reward token is removed from the producerTokensproducerToken.rewardTokens list. If the reward token is removed, the rewardToken length is going to be zero, the user rewards going to be zero and the for statement will...

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

Steal deposit fund in ERC4626 vault by exchange rate manipulation

Lines of code Vulnerability details Impact Although the PirexERC4626 and AutoPxGlp contract check for 0 shares, the rounding down error can still be used to steal new user deposit. Part of the new deposit could be stolen. The attacker may monitor the pool activities to catch the steal...

6.6AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•17 views

previewWithdraw() in AutoPxGlp and AutoPxGmx doesn't rounds up when calculating corresponding shares for assets, even so they are overrides previewWithdraw() in PirexERC4626 which rounds up and withdraw() in all 3 contract assumes and depends on previewWithdraw() to rounds up

Lines of code Vulnerability details Impact Contracts AutoPxGlp and AutoPxGmx extends PirexERC4626 and function withdraw and previewWithdraw has been overridden in those contracts. withdraw uses function previewWithdraw to calculate number of shares need to burn for corresponding amount of assets...

6.9AI score
SaveExploits0
Code423n4
Code423n4
•added 2022/11/28 12:00 a.m.•32 views

MINTING OF NFT AT WILL

Lines of code Vulnerability details Impact register is an unrestricted public function where any new msg.sender is going to get through the modifier onlyUnregistered. With a non-zero recipient argument passed into the function, a new NFT is going to be minted to the recipient. Consequently, an...

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

There is no re-register o re-assign function

Lines of code Vulnerability details Impact There is no re-register or re-assign option for the smart contracts. Let's assume a smart contract is registered either through the register function with a new NFT minted or the assign function to an existing NFT. However, if somehow, the NFT is burned ...

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

Deposits and compounds will be frozen after a PirexGmx migration

Lines of code Vulnerability details Impact After a migration of the platform PirexGmx contract, the approval of the AutoPxGlp from the new PirexGmx contract will be zero. The same issue is here for the AutoPxGmx contract. Proof of Concept Even though the approval of gmxBaseReward formerly WETH fo...

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

Uint underflow issue

Lines of code Vulnerability details Impact Potential underflow if shares is greater than totalSupply Proof of Concept Tools Used Manual review Recommended Mitigation Steps Before the following line, check if totalSupply is greater or equal to shares --- The text was updated successfully, but thes...

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

Reentrancy potential

Lines of code Vulnerability details Impact A reentrancy attack could be performed and can result in exploit and losing funds Proof of Concept Tools Used Manual review Recommended Mitigation Steps Use nonReentrant modifier imported from solmate/utils/ReentrancyGuard.sol --- The text was updated...

6.9AI score
SaveExploits0
Total number of security vulnerabilities10190