Submitted by immeas, also found by KIntern_NA, carrotsmuggler, and GalloDaSballo
When transferring TapToken there is an extra check done in BaseTapiocaOmnichainEngine::transferFrom:
Here theres if the spender is not allowed, the allowance is checked in Pearlmit. The issue is that, Pearlmit checks the allowance against msg.sender which in this case will be the TapToken contract. Hence, any user with an allowance to the TapToken contract in Pearlmit can have their TAP stolen.
If a user has allowed TapToken to transfer TapToken through Pearlmit, they can have all they have approved stolen. Since TapToken does a lot of token handling in composed messages, this is likely to happen.
Test in tap-token/test/TapToken.t.sol:
Consider not doing the fallback to Pearlmit in transferFrom.
Access Control
cryptotechmaker (Tapioca) commented:
0xRektora (Tapioca) confirmed and commented:
