solmate ERC20 permit does not check s for mallebiltiy, which means it allows anyone to modify the signature of an existing signature in a specific way without access to the private key and replay the transaction with a new valid signature.
Proof of Concept
the following code will create a new valid signature:
Lines of code
https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/sfrxETH.sol#L59 https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/sfrxETH.sol#L75
Vulnerability details
Impact
solmate ERC20 permit does not check s for mallebiltiy, which means it allows anyone to modify the signature of an existing signature in a specific way without access to the private key and replay the transaction with a new valid signature.
Proof of Concept
the following code will create a new valid signature:
Tools Used
Recommended Mitigation Steps
Need to add the following checks before calling asset.permit