Docile Admiral Trout
High
Missing from
address verification in RLP decoding function allows potential transaction origin mismatch
The decodeTx
function in the Tx
library parses a raw transaction and recovers the from address using the transaction signature (v, r, s)
. However, it does not check if this recovered from
address matches the one provided in the RLP data, allowing for a potential mismatch. This can lead to unintended issues where the from address may be misinterpreted due to an accidental or incorrect value in the RLP data.
The vulnerability stems from the absence of a validation step to ensure that the from
address obtained from the transaction signature
matches the from
address specified in the RLP
data. Without this check, the transaction origin can appear incorrectly, either due to user error or unintended discrepancies or malicious actions.
No response
No response
- A user prepares a transaction with a specific
from
address in the RLP data, intending it to represent the sender. - However, if the signature's
from
address differs (due to an error or incorrect signing), the function will decode and present the from address derived from the signature, notfrom
the RLP data. - This discrepancy can lead to incorrect transaction interpretation or origin confusion, where the transaction's origin may appear inaccurately.
Mismatched from
addresses may lead to unclear or inaccurate records of transaction origin.
No response
Add a check to ensure the from
address derived from the signature matches the address in the RLP data:
require(info.from == values[8].toAddress(), "Mismatch between RLP 'from' and recovered 'from'");