Redacted Cartel contest - Englave's results

Boosted GMX assets from your favorite liquid token wrapper, Pirex - brought to you by Redacted Cartel.

General Information

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

Redacted Cartel

Findings Distribution

Researcher Performance

Rank: 41/101

Findings: 2

Award: $98.18

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: cccz

Also found by: Englave, Jeiwan, aphak5010, hansfriese, immeas, rbserver, xiaoming90

Labels

2 (Med Risk)
partial-50
duplicate-91

Awards

82.2514 USDC - $82.25

External Links

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

Awards

15.9293 USDC - $15.93

Labels

bug
2 (Med Risk)
satisfactory
duplicate-137

External Links

Lines of code

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

Vulnerability details

Impact

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.

Proof of Concept

This is a pretty popular type of issue, so providing nothing as PoC here.

Tools Used

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

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter