SWC-122

Title

Relationships

Description

Many smart contract systems allow users to sign off-chain messages instead of directly requesting users to do an on-chain transaction. These systems usually assume that the message will be signed by the same address that owns the assets. However, one can hold assets directly in the regular account (controlled by a private key) or in a smart contract that acts as a wallet (e.g. a multisig contract). The current design of many smart contracts prevent contract based accounts from interacting with them, since contracts do not possess private keys and therefore can not directly sign messages. In order to solve the problem implementations that assume the validity of a signed message based on other methods that do not have that barrier. An example of such a method is to use msg.sender and assume if the message originated from the address then it is valid. This can lead to vulnerabilities especially in scenarios where proxies can be used to relay transactions.

Remediation

It is not recommended to use alternate verification schemes that do require proper signature verification through ecrecover().