reNFT - Hajime's results

Collateral-free, permissionless, and highly customizable EVM NFT rentals.

General Information

Platform: Code4rena

Start Date: 08/01/2024

Pot Size: $83,600 USDC

Total HM: 23

Participants: 116

Period: 10 days

Judge: 0xean

Total Solo HM: 1

Id: 317

League: ETH

reNFT

Findings Distribution

Researcher Performance

Rank: 115/116

Findings: 1

Award: $1.80

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

1.8029 USDC - $1.80

Labels

bug
2 (Med Risk)
satisfactory
duplicate-239

External Links

Lines of code

https://github.com/re-nft/smart-contracts/blob/3ddd32455a849c3c6dc3c3aad7a33a6c9b44c291/src/packages/Signer.sol#L107-L116

Vulnerability details

Impact

The calculation of the digest done in does not follow the EIP-712 specification. Not following the EIP specification will end up in unexpected integration failures with EIP712-compliant wallets or tooling that perform the encoding in the appropriate way.

Proof of Concept

In _recoverSignerFromPayload(), the digest is calculated as follows:

bytes32 digest = _DOMAIN_SEPARATOR.toTypedDataHash(payloadHash);

Comment on the calculation: "Derive original EIP-712 digest using domain separator and order hash."

toTypedDataHash() is not respected as per OpenZeppelin's ECDSA

toTypedDataHash() used in _hashTypedDataV4() to calculate digest in the implementation of EIP712 OpenZeppelin.

Tools Used

Manual

_hashTypedDataV4() is the correct option to calculate digest. Use implementation OpenZeppelin's EIP712

Assessed type

Other

#0 - c4-pre-sort

2024-01-21T17:51:12Z

141345 marked the issue as duplicate of #239

#1 - c4-judge

2024-01-28T21:05:55Z

0xean marked the issue as satisfactory

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter