Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmartAccount and VerifyingSingletonPaymaster signature validation are not conforming to the latest EIP-4337 EntryPoint specification #212

Closed
code423n4 opened this issue Jan 8, 2023 · 4 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate-498 satisfactory satisfies C4 submission criteria; eligible for awards sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L511

Vulnerability details

Impact

The most recent canonical EntryPoint contract states that:

    /**
     * for simulation purposes, validateUserOp (and validatePaymasterUserOp) must return this value
     * in case of signature failure, instead of revert.
     */
    uint256 public constant SIG_VALIDATION_FAILED = 1;

This requirement is also described on the latest BaseAccount NatSpec, that should be inherited by SmartAccount.sol. The same goes for VerifyingPaymaster that is the sample code for VerifyingSingletonPaymaster.sol.

Proof of Concept

EntryPoint.simulateHandleOp expects SIG_VALIDATION_FAILED instead of a revert.

Tools Used

Manual review

Recommended Mitigation Steps

Update the codebase to use the latest AA source code from the repository eth-infinitism/account-abstraction repository. In addition, keep close attention to protocol changes through the developers' social media.

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Jan 8, 2023
code423n4 added a commit that referenced this issue Jan 8, 2023
@c4-judge
Copy link
Contributor

gzeon-c4 marked the issue as duplicate of #318

@c4-sponsor
Copy link

livingrockrises marked the issue as sponsor confirmed

@c4-sponsor c4-sponsor added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Jan 26, 2023
@c4-judge
Copy link
Contributor

gzeon-c4 marked the issue as satisfactory

@c4-judge c4-judge added satisfactory satisfies C4 submission criteria; eligible for awards duplicate-498 and removed duplicate-318 labels Feb 10, 2023
@c4-judge
Copy link
Contributor

gzeon-c4 marked the issue as duplicate of #498

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate-498 satisfactory satisfies C4 submission criteria; eligible for awards sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

3 participants