GTL contract is vulnerable to an inflation attack
The GTL contract inherits an ERC4626 vault implementation but does not enable any of the library's built-in inflation-attack protections. An attacker could manipulate the share price so that a later depositor receives no shares, losing their funds.
IzuMan Follow with insecuremary, lostOpcode and 1 other
Originally disclosed on Code4rena
Submitted by IzuMan, also found by insecuremary, lostOpcode, and menace
perps/GTL.sol #L292-L294
GTL contract is vulnerable to an inflation attack. As a result, a user can deposit the asset in the GTL contract and receive no shares. This will cause a loss of funds for users.
The GTL contract inherits the ERC4626 contract from the solady library, but does not implement any of the provided protection methods leaving a newly deployed GTL contract vulnerable to an inflation attack.
Here is an explanation of an inflation attack if the reader is unfamiliar: https://mixbytes.io/blog/overview-of-the-inflation-attack#rec558238760
Recommended mitigation steps
Use one of the provide methods inside the solady ERC4626 contract:
- Decimal offset
- Virtual shares
- Fixed initial conversion rate when minting shares
View detailed Proof of Concept
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the contract inherits a vault library that offers inflation-attack protections but never configures any of them, leaving the initial share price manipulable.
Impact
A depositor could receive no shares for their deposit, losing the funds they put in.
What the attacker needed
Newly deployed GTL contract; attacker deposits before victim
The fix
The contract should enable one of the library's protections, such as a decimal offset, virtual shares, or a fixed initial conversion rate.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A vault contract lets people deposit an asset and get shares in return, like buying into a fund. An inflation attack is when someone manipulates the share price early on so that the next person's deposit is rounded down to zero shares, meaning they get nothing for their money. The report says this vault did not switch on the library's built-in defences against that trick.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.