Description:Description\
Root cause : not checking if signer.codlength > 0 when caling IERC1271.isValidSignature, instead validating with signature.length.
Likelihood : All protcols check isValidSignature based on signer's code length, instead of the supplied signature's length, so the regular AA wallets cannot do SavingsXDai.permit
According to EIP1271, the signature length should be == 65, and if not the call on IERC1271.isValidSignature of contract to validate the sig will revert due to the strict check of signature length check == 65 there also. So smart wallets cannot do permit by sig, because in order to do it, the sig length should be > 0 on line 54 below. But the isValidSignature function implemeted on contarct/wallet is strictly checking if sig length == 65. And it is doing it according to reference implementation section of eip-1271. And all wallet providers follow this check.
From, reference implementation section of eip-1271
A user with contract/smart wallet is doing SavingsXDai.permit and he calls with signature.length == 65, and it will go into the if flow on line 54 below and try to ecrecover the signer. But all the Account abstracted wallets implement isValidSignature with signature arametervalidated as length == 65 on the first line itself. That is according to the reference implementation section of eip-1271
Yeah, this has no impact on Seer.
Per competition rules, are excluded:
Issues in third party contracts (those in the interaction folder + Kleros + Curate + DAI) which do not lead to issues with Seer (if you find those, we'll help you report them to their respective projects).
I don't have a particular dev contact for sDAI, but you can report it to the maker team.
Github username: -- Twitter username: -- Submission hash (on-chain): 0xfcb06a10abcef38d141af4d0dabf5881aa4ff7cc4eee906dc7170dc41c7fa42e Severity: low
Description: Description\ Root cause : not checking if signer.codlength > 0 when caling
IERC1271.isValidSignature
, instead validating withsignature.length
. Likelihood : All protcols checkisValidSignature
based on signer's code length, instead of the supplied signature's length, so the regular AA wallets cannot doSavingsXDai.permit
According to EIP1271, the signature length should be == 65, and if not the call on
IERC1271.isValidSignature
of contract to validate the sig will revert due to the strict check of signature length check == 65 there also. So smart wallets cannot do permit by sig, because in order to do it, the sig length should be > 0 on line 54 below. But theisValidSignature
function implemeted on contarct/wallet is strictly checking if sig length == 65. And it is doing it according to reference implementation section of eip-1271. And all wallet providers follow this check.From, reference implementation section of eip-1271
Attack Scenario\
A user with contract/smart wallet is doing
SavingsXDai.permit
and he calls withsignature.length == 65
, and it will go into the if flow on line 54 below and try to ecrecover the signer. But all the Account abstracted wallets implementisValidSignature
with signature arametervalidated as length == 65 on the first line itself. That is according to the reference implementation section of eip-1271Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)