Scope:
The AToken, VariableDebtToken, StableDebtToken and DebtTokenBase all write a DOMAIN_SEPERATOR to storage when initialized, and then read it when used in the permit function. In the event of a hard fork post-deployment, the chainID is not updated and a valid signature for one chain could be replayed on the other.
To circumvent this issue, we can generate the DOMAIN_SEPERATOR at verification time with the current chainID. Through this change, the signature will only be valid on its intended domain (assuming chainID will differ between the chains).
Identified by: Trail of Bits
Scope: The
AToken
,VariableDebtToken
,StableDebtToken
andDebtTokenBase
all write aDOMAIN_SEPERATOR
to storage when initialized, and then read it when used in thepermit
function. In the event of a hard fork post-deployment, the chainID is not updated and a valid signature for one chain could be replayed on the other.To circumvent this issue, we can generate the
DOMAIN_SEPERATOR
at verification time with the current chainID. Through this change, the signature will only be valid on its intended domain (assuming chainID will differ between the chains).Issue pointed out by Trail of Bits.