Lucene search
+L
Code423n4Recent

10190 matches found

Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•7 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•5 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•8 views

Underlying assets stealing in AutoPxGmx and AutoPxGlp via share price manipulation

Lines of code Vulnerability details Impact pxGMX and pxGLP tokens can be stolen from depositors in AutoPxGmx and AutoPxGlp vaults by manipulating the price of a share. Proof of Concept ERC4626 vaults are subject to a share price manipulation attack that allows an attacker to steal underlying toke...

6.7AI score
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•9 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•8 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•8 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•9 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•11 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•6 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•15 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•9 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•12 views

First depositor can inflate share price

Lines of code Vulnerability details Impact A well-known vulnerability for ERC4626 vaults is the inflation of the share price on the first deposit. Because AutoPxGlp and AutoPxGmx use the balance of the underlying asset for totalAssets and do not have an initial minimum deposit amount, they are al...

6.8AI score
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•13 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•6 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•14 views

Wrong comparison

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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•11 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•9 views

Deposit can be front-runned

Lines of code Vulnerability details Impact The depositor who got frontrun by the attacker will lose all their funds. And all the future depositors. An attacker can front run the first user's deposit and transfer tokens to the vault directly causing all future depositors to lose all their funds...

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

Ownership NFT Can be Minted by Anyone

Lines of code Vulnerability details Impact In Turnstile.sol, register is a public function callable by anyone. Any msg.sender calling this function the first time is going to bypass the modifier onlyUnregistered. As long as a non-zero recipient has been inputted, a new NFT is going to be minted t...

6.9AI score
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•6 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•12 views

A registered contract won't earn fees if _recipient is a fresh address

Lines of code Vulnerability details Impact Users might fall victims of a false positive: if they use a fresh account as an NFT recipient during contract registration, the transaction won't revert, but the registered contract will never earn fees for the token holder. And since a contract can be...

6.8AI score
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•7 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•14 views

fee distribution is only for the msg.to contract, instead of the to address of the call traces, which is not reasonable for the gas economic system.

Lines of code Vulnerability details Impact The target contract of the fee distribution is got by contract := msg.To in the evmhooks.go . So the fee distribution is only for the msg.to contract, instead of the to address of the call traces. It means that any one use a contract wallet or setup a...

6.7AI score
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•9 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•9 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•6 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•6 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•8 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•9 views

First depositor who is a whale account can deny later depositors who are smaller accounts from using AutoPxGmx contract, such as for depositing GMX for apxGMX

Lines of code Vulnerability details Impact A whale account that owns a lot of GMX can call the following PirexGmx.depositGmx function to deposit much GMX for pxGMX. As the first depositor for the AutoPxGmx contract, this account can then call the AutoPxGmx.depositGmx function to deposit 1 wei GMX...

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

Compounding is vulnerable to sandwich attack

Lines of code Vulnerability details Impact Function compound is called in every deposit/withdraw in AutoPxGmx contract. It claim rewards in form of gmxBaseReward and swap them to gmx token. They used amountOutMinimum from input params gmxAmountOut = SWAPROUTER.exactInputSingle...

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

gmxBaseReward must not be the same as asset

Lines of code Vulnerability details Impact Compounding will attempt to swap/deposit all assets instead of just the rewards, which reverts because of integer overflow, which causes withdrawals to revert. Proof of Concept In AutoPxGmx.compound: PirexRewardsrewardsModule.claimasset, addressthis; //...

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

tokenID that is not minted will be stored into the feeRecipient storage

Lines of code Vulnerability details Impact In the original code, tokenID is incremented just after mint function is executed. Afterwards, tokenID is stored into the feeRecipient storage. As a result, tokenID that is not minted will be stored into the feeRecipient storage. Proof of Concept In the...

6.9AI score
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•12 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•17 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•7 views

[M2] It is possible to accidentally send ETH to an invalid token Id

Lines of code Vulnerability details Impact ​ ETH can be either loss or stolen PoC The function distributeFees is not checking if the tokenId is valid. That means that ETH can be sent to non-minted token. In case tokenId is a big number this ETH will be lost. If the id is not so big someone can mi...

6.8AI score
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•14 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•9 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•21 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•14 views

NameWrapper: Wrapped to Unregistered to ignore PARENT_CANNOT_CONTROL

Lines of code Vulnerability details Impact owner of a wrapped node without CANNOTUNWRAP fuse can unwrap and set the ens.ownernode to zero to be an unregistered state if it happens, even if the node has PARENTCANNOTCONTROL fuse, the parent of the node can change the NameWrappwer.owner of the node...

7AI score
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•8 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•12 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•8 views

AutoPxGlp and AutoPxGmx are not compliant with ERC4626 standard

Lines of code Vulnerability details Proof of Concept In both contracts, the previewWithdraw function has the same body // Calculate shares based on the specified assets' proportion of the pool uint256 shares = convertToSharesassets; // Save 1 SLOAD uint256 totalSupply = totalSupply; // Factor in...

6.9AI score
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•10 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•10 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•13 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•8 views

Lack Of Proper Access Control Might Lead To User Getting Lesser Rewards

Lines of code Vulnerability details Impact We can call the function userAccrue for some other user and make their rewards lesser then they expect. In the function it calculates the rewards for a user that are being accrued over a period of time. The math to calculate how much reward a user has...

6.8AI score
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•10 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
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•15 views

NameWrapper: one can renew to DoS a Name

Lines of code Vulnerability details Impact Anyone with enough eth can make a name impossible to be used anymore Proof of Concept Below is a snippet of the proof of concept. The whole code can be found in this gist. And how to run test is in the comment in the gist. This proof of concept...

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

Rewards calculation does not consider GMX reward rate fluctuation

Lines of code Vulnerability details Impact The current time based px rewards calculation system is not accurate, and not fair for users. Due to GMX protocol reward rate fluctuation, px users stake and claim at different time could get less or more rewards they deserve. Some users could abuse the...

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

Assign Function Allows for any Other Unknown Contract Address to Assign existing token.

Lines of code Vulnerability details Impact Assign Function Allows for any Other Unknown Contract Address to Assign existing token. Proof of Concept There is no check at all to confirm that the previous token owner allows for the assignment of his tokenId. The assign function only checks the...

6.8AI score
Exploits0
Code423n4
Code423n4
•added 2022/11/28 12:0 a.m.•11 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
Exploits0
Total number of security vulnerabilities10190