Submitted by dirk_y, also found by rvierdiiev and 0xStalin
M-02: Unintended or malicious use of prize winners hooks
https://github.com/GenerationSoftware/pt-v5-vault/blob/main/src/Vault.sol#L1397
https://github.com/GenerationSoftware/pt-v5-claimer/blob/main/src/Claimer.sol#L163
In the previous implementation, a malicious user could set arbitrary vault hooks for afterClaimPrize and beforeClaimPrize that could be used to gas grief the claimer; or cause other claims in the same call to fail by deliberately reverting.
The referenced PR does solve the original issue by capping the gas sent to external calls and safely catching reverts. I was slightly concerned that enough gas was being passed to the hooks for a single reentrant call to front-run a prize claim; however, this has been fixed by another change where previously claimed prizes safely return 0. However, this mitigation is unresolved by another change.
There was another change made to the repo where claiming logic was simplified and mainly moved out of the Vault contract. However, with this change any reverts are not being safely caught:
This is a problem because if the hook reverts, this is caught and then another revert is thrown:
As a result, a malicious user can still gas grief a claimer by deliberately reverting in a hook.
The reverts should be safely caught in the Claimer contract, similarly to the initial change (and linked PR) that fixed this issue originally.
Loop
asselstine (PoolTogether) commented:
