OpenZeppelin Contracts's ERC2771Context with custom forwarder may lead to zero-valued _msgSender
openzeppelin-contracts
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| @openzeppelin/contracts npm |
|
|
| @openzeppelin/contracts-upgradeable npm |
|
|
openzeppelin-contracts
| Product | Affected | Fixed in |
|---|---|---|
| @openzeppelin/contracts npm |
|
|
| @openzeppelin/contracts-upgradeable npm |
|
|
OpenZeppelin Contracts is a library for secure smart contract development. Starting in version 4.0.0 and prior to version 4.9.3, contracts using `ERC2771Context` along with a custom trusted forwarder may see `_msgSender` return `address(0)` in calls that originate from the forwarder with calldata shorter than 20 bytes. This combination of circumstances does not appear to be common, in particular it is not the case for `MinimalForwarder` from OpenZeppelin Contracts, or any deployed forwarder the team is aware of, given that the signer address is appended to all calls that originate from these forwarders. The problem has been patched in v4.9.3.
From the CVE record · GitHub_M
Contracts using ERC2771Context with a custom trusted forwarder may return address(0) from _msgSender when a call from that forwarder has calldata shorter than 20 bytes. An attacker able to make such a call could trigger incorrect sender identification; the input does not specify an authentication requirement or user interaction. This does not affect OpenZeppelin's MinimalForwarder under the described conditions.
Engineers using npm @openzeppelin/contracts or @openzeppelin/contracts-upgradeable versions >=4.0.0 and <4.9.3 should check contracts that combine ERC2771Context with a custom trusted forwarder.