The setPerpVault function in GmxProxy.sol uses tx.origin for access control, which is a dangerous practice that could allow phishing attacks to bypass owner verification.
The vulnerability exists because:
tx.origin refers to the original externally owned account (EOA) that initiated the transaction
Using tx.origin for authentication makes the contract vulnerable to phishing attacks
An attacker can trick the owner into interacting with a malicious contract that calls setPerpVault
Severity: Medium
Likelihood: Medium (requires social engineering)
Impact: Medium (only affects initial setup)
Attack Scenario:
Attacker deploys malicious contract
Owner interacts with malicious contract
Malicious contract calls setPerpVault with attacker's parameters
Check passes because tx.origin is owner's address
Attacker gains control of vault configuration
Manual code review
Solidity visual developer
Replace tx.origin with msg.sender and use OpenZeppelin's onlyOwner modifier:
Additional recommendations:
Add timelock for critical parameter changes
Implement two-step transfer pattern for ownership changes
Add emergency pause mechanism
Consider multi-signature requirements for critical functions
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.