Platform: Code4rena
Start Date: 21/11/2022
Pot Size: $90,500 USDC
Total HM: 18
Participants: 101
Period: 7 days
Judge: Picodes
Total Solo HM: 4
Id: 183
League: ETH
Rank: 41/101
Findings: 2
Award: $98.18
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: cccz
Also found by: Englave, Jeiwan, aphak5010, hansfriese, immeas, rbserver, xiaoming90
82.2514 USDC - $82.25
Judge has assessed an item in Issue #38 as M risk. The relevant finding follows:
L2. Pool selection for the compound is not restricted Compound function of AutoPxGmx contract is public and available for everyone. An attacker can create a custom pool with a higher fee value (currently, on tests it uses 0.3%, but it's possible to create a pool with a max of 1% fee) on Uniswap and manually execute compound function to drain gmxBaseReward from higher fees. The issue is minor while Uniswap limits pool fees to 1%, but in the future, in case it will be changed - the issue could become more critical.
Path: ./external/vaults/AutoPxGmx.sol : compound() Recommendation: Do not allow it to pass a custom fee value (use fee from state variable).
#0 - c4-judge
2022-12-05T10:00:47Z
Picodes marked the issue as duplicate of #391
#1 - c4-judge
2022-12-05T10:00:53Z
Picodes marked the issue as partial-50
#2 - Picodes
2022-12-05T10:01:19Z
Partial credit as the warden only discuss the fee implication and not the pool price or potential MEV
#3 - c4-judge
2022-12-05T10:30:15Z
Picodes marked the issue as full credit
#4 - c4-judge
2022-12-05T10:32:05Z
Picodes marked the issue as duplicate of #91
#5 - c4-judge
2023-01-01T11:02:03Z
Picodes marked the issue as satisfactory
#6 - c4-judge
2023-01-01T11:02:23Z
Picodes marked the issue as partial-50
🌟 Selected for report: deliriusz
Also found by: 0x52, 0xLad, 0xbepresent, Englave, R2, Ruhum, cccz, gzeon, hihen, keccak123, ladboy233, pashov, pedroais, perseverancesuccess, rbserver, rvierdiiev, simon135, unforgiven, wagmi, xiaoming90
15.9293 USDC - $15.93
https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGmx.sol#L275 https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGlp.sol#L243
Existing contracts during interaction with Uniswap don’t specify meaningful “minAmountOut”, which leads to “Sandwtich attack”.
During compound
function execution, in case of a reasonable attack amount of tokens swap, an attacker can pay more Gas to execute their transaction first, and affect the token price by buying/selling in Uniswap, so the existing contract will perform the transaction with the reduced token price.
This type of attack will drain a small percentage of tokens from each compound
operation.
This is a pretty popular type of issue, so providing nothing as PoC here.
Manual testing
Specify slippage percentage to limit losses on swap operations.
#0 - c4-judge
2022-12-04T13:40:30Z
Picodes marked the issue as duplicate of #185
#1 - c4-judge
2023-01-01T11:07:09Z
Picodes marked the issue as satisfactory
#2 - C4-Staff
2023-01-10T22:10:37Z
JeeberC4 marked the issue as duplicate of #137