LibTractor._user() always returns publisher address once the address have been set.
TokenFaucet uses LibTractor._user() to determine the context of the msg.sender.
The issue is that when a publisher is set the function always returns the address of the publisher instead of the current msg.sender.
https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/main/protocol/contracts/libraries/LibTractor.sol#L116C4-L121C6
The consequence is that when a users calls any functions that depends on LibTractor._user() this would return the address of the publisher.
https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/main/protocol/contracts/beanstalk/farm/TokenFacet.sol#L67
in the above case if the user passes the address of the publisher as sender it would bypass the check(sender != LibTractor._user()) and the spendAllowance would not be invoked.
Multiple functions which depends on LibTractor._user() would be affected once a publisher is set.
Tokens own by a publisher can be drained
Manual Review
Explictly check that the caller is the publisher within LibTractor._user()
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.