The function setPerpVault
uses tx.origin
to authenticate the caller instead of using msg.sender
.
Authentication Weakness: Using tx.origin
allows an attacker to trick the owner into initiating an unintended transaction through a malicious intermediary contract.
Single Call Limitation: Although the function is designed to be called only once, it still poses a risk if the call is initiated indirectly.
Unauthorized Access: An attacker could potentially set the perpetual vault address if the owner is tricked, compromising the contract.
Phishing Risks: It opens the door for phishing-style attacks that exploit the trust relationship of the owner.
Manual review
Replace tx.origin
with msg.sender
: Use require(msg.sender == owner(), "not owner");
to prevent potential phishing attacks.
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.