tx.origin is a global variable in Solidity that returns the address of the account that sent the transaction but it is discouraged due to previous attacks
tx.origin returns the original external account that initiated the transaction, even if the transaction passes through multiple contracts. This can be exploited in phishing attacks where a user is tricked into initiating a transaction through a malicious contract that then calls your contract.
Using tx.origin deviates from best practices in Solidity development, which recommend using msg.sender for access control.
The function is designed to set perpVault only once. If tx.origin is exploited to set an incorrect address, it cannot be changed, potentially locking the contract into an incorrect state.
Manual Review
Replace tx.origin with msg.sender to ensure that only the direct caller of the function is considered for access control
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.