The onlySelfRouter modifier in the UpliftOnlyExample.sol contract is not guarding against anything when applied to the onAfterRemoveLiquidity function as it's being passed the router address as an argument. This means that anyone can execute this function as long as they pass the UpliftOnlyExample address as the first argument.
Basic PoC, paste this at the end of the UpliftExample.t.sol file.
This test is supposed to fail with the CannotUseExternalRouter selector as an external account is executing the function. It doesn't due to the correct uplift router being passed as an argument.
NOTE: the router variable is not used inside the onAfterRemoveLiquidity function besides being passed to the onlySelfRouter modifier.
Lack of Authorization guard
Manual review + foundry tests
If this is supposed to guard against external use consider changing onlySelfRouter(router) to onlySelfRouter(msg.sender) in UpliftOnlyExample.sol#L440
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.