Sponsorship Paymaster Specific Vectors
In this page, we cover vulnerabilities that may occur in sponsorship paymasters. The structure of sponsorship paymasters can vary depending on the service.
Gas fee coverage without proper validation
There are paymasters that cover users’ gas fees for promotions and other purposes. To sponsor for gas fees, the paymaster needs to check if it will cover the specific UserOperation. However, some paymasters rely on web2-level validation, believing it to be sufficient and assuming that other users won’t be able to use them.
Example Case:

This sponsorship paymaster is confident that only the users they have approved at the web2 level can use it. Because of this, the paymaster covers all incoming UserOperations without any extra checks.
However, a user discovered that validation only occurs at the web2 level. The user then skipped the web2 service linked to the paymaster and directly submitted a UserOperation to the Entrypoint, using the paymaster for free.
Mitgation : Use the signature of an approved signer to verify the UserOperation, or include additional checks such as restricting access to specific senders.
dApps can impact the reputation of the paymaster.
There is a singleton sponsorship paymaster that provides services to multiple dApps. Each dApp’s deposited funds are managed using a mapping variable, with each dApp’s address tracked as a paymasterId. Transactions using the paymaster are validated by a signer authorized by the paymaster contract and are checked in the validatePaymasterUserOp function.
Exmaple Case:
When the dApp administrator decides to stop the service, they withdraw all the funds they had deposited in the paymaster. However, UserOperations that had already passed the first validation and are waiting in the mempool may fail during the second validation because the dApp’s balance is now empty. This causes the singleton paymaster to lose reputation due to the failure during the bundler’s second validation.

Example Code
Mitigation : Set a delay in the withdrawal process
Lack of gas limit in a single transaction
Some paymasters cover users’ gas fees for promotions and other reasons. This paymaster tracks how many transactions each user makes, allowing them up to n free transactions. It trusts that users will use the free service fairly.
Example Case:
However, a clever but malicious user notices this and sets the maximum possible gas limit within a single transaction. Since the paymaster only checks the number of transactions, it approves the user’s request without any suspicion. The user continues to submit transactions with the maximum gas limit, eventually draining the paymaster.

Example Code
Mitigation : Assign a specific amount of gas to each user instead of a set number of transactions, OR set a maximum
gasLimitfor each transaction
Last updated