GmxProxy contract is the use of tx.origin for access control, specifically in the setPerpVault function:Using tx.origin for authentication exposes the contract to phishing and proxy contract attacks. Unlike msg.sender, which reflects the immediate caller, tx.origin represents the original externally owned account (EOA) that initiated the transaction. This means that if an owner interacts with a malicious contract that forwards the call to GmxProxy, the tx.origin == owner() check will still pass—even if the immediate caller (msg.sender) is an attacker-controlled contract.
The legitimate owner() is tricked into interacting with a malicious contract.
The malicious contract forwards a call to GmxProxy.setPerpVault(...), passing a manipulated _perpVault address.
Since tx.origin remains the original owner’s address, the access control check require(tx.origin == owner(), "not owner"); erroneously approves the request.
The attacker successfully sets perpVault to their own controlled address, allowing them to manipulate or hijack future transactions involving perpVault, potentially leading to stolen funds or other security breaches.
Lightchaser: Medium-5
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.