You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current BaseOpenfortAccount::_validateSignature validation logic will consider all calls with invalid ECDSA payloads that produce a signer address of 0 to be correct.
function _validateSignature(bytes32_hash, bytesmemory_signature, uint256_to, bytescalldata_data)
internalreturns (bytes4magic)
{
magic = EIP1271_SUCCESS_RETURN_VALUE;
address signerAddress =_recoverECDSAsignature(_hash, _signature);
// Note, that we should abstain from using the require here in order to allow for fee estimation to workif (signerAddress !=owner() && signerAddress !=address(0)) {
// if not owner, try session key validationif (!isValidSessionKey(signerAddress, _to, _data)) {
magic ="";
}
}
}
Recommendation:
We advise the code to assign an EIP1271_SUCCESS_RETURN_VALUE to the magic variable solely when verification has been successful (i.e. if (signerAddress == owner() || isValidSessionKey(signerAddress, _to, _data)) magic = EIP1271_SUCCESS_RETURN_VALUE;).
The text was updated successfully, but these errors were encountered:
Description and Impact are incompatible: only invalid signatures with a hash that recovers to address(0) will be considered valid, NOT All invalid signatures.
The ecrecover precompile will yield the zero address on failure which can be trivially crafted:
BOA-05M: Incorrect Validation Logic
Description:
The current
BaseOpenfortAccount::_validateSignature
validation logic will consider all calls with invalid ECDSA payloads that produce a signer address of0
to be correct.Impact:
All invalid signatures will be considered correct by the current
BaseOpenfortAccount::_validateSignature
mechanism.Example:
Recommendation:
We advise the code to assign an
EIP1271_SUCCESS_RETURN_VALUE
to themagic
variable solely when verification has been successful (i.e.if (signerAddress == owner() || isValidSessionKey(signerAddress, _to, _data)) magic = EIP1271_SUCCESS_RETURN_VALUE;
).The text was updated successfully, but these errors were encountered: