Golom contest - Ch_301's results

An NFT marketplace that offers the lowest industry fee, a publicly available order-book along with analytical tools.

General Information

Platform: Code4rena

Start Date: 26/07/2022

Pot Size: $75,000 USDC

Total HM: 29

Participants: 179

Period: 6 days

Judge: LSDan

Total Solo HM: 6

Id: 148

League: ETH

Golom

Findings Distribution

Researcher Performance

Rank: 127/179

Findings: 2

Award: $35.32

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-07-golom/blob/7bbb55fca61e6bae29e57133c1e45806cbb17aa4/contracts/core/GolomTrader.sol#L236

Vulnerability details

Proof of Concept

The transferFrom() method is used instead of safeTransferFrom(), presumably to save gas. I however argue that this isn’t recommended because:

OpenZeppelin’s documentation discourages the use of transferFrom(), use safeTransferFrom() whenever possible

Finding

File: contracts/core/GolomTrader.sol 236: ERC721(o.collection).transferFrom(o.signer, receiver, o.tokenId); 301: nftcontract.transferFrom(msg.sender, o.signer, o.tokenId) 363: nftcontract.transferFrom(msg.sender, o.signer, tokenId);

used safeTransferFrom(),

#0 - KenzoAgada

2022-08-03T15:05:06Z

Duplicate of #342

Missing checks for address(0x0)

validateOrder() doesn't check if signaturesigner and o.signer are not a 0x0 address

Finding

File: contracts/core/GolomTrader.sol address signaturesigner = ecrecover(hash, o.v, o.r, o.s); require(signaturesigner == o.signer, 'invalid signature');

https://github.com/code-423n4/2022-07-golom/blob/7bbb55fca61e6bae29e57133c1e45806cbb17aa4/contracts/core/GolomTrader.sol#L164-L194

Recommended Mitigation Steps

Add a require()

address signaturesigner = ecrecover(hash, o.v, o.r, o.s); require(signaturesigner == o.signer, 'invalid signature'); require(signaturesigner != address(0), "ECDSA: invalid signature");

no check for amount = 0

A griefer is able to bypass all the checks fillAsk()

Finding

File: contracts/core/GolomTrader.sol require(msg.value >= o.totalAmt * amount + p.paymentAmt, 'mgmtm');

https://github.com/code-423n4/2022-07-golom/blob/7bbb55fca61e6bae29e57133c1e45806cbb17aa4/contracts/core/GolomTrader.sol#L203-L271

if() statement will never enter

The if() check here is always false because the require() before it do the same check so if signaturesigner == o.signer is false the faction will faile

Finding

File: contracts/core/GolomTrader.sol if (signaturesigner != o.signer) { return (0, hashStruct, 0); }

https://github.com/code-423n4/2022-07-golom/blob/7bbb55fca61e6bae29e57133c1e45806cbb17aa4/contracts/core/GolomTrader.sol#L178-L180

use block.chainid rather than chainId := chainid()

the variable block.chainid is available on Solidity https://github.com/ethereum/solidity/pull/10557

Finding

File: contracts/core/GolomTrader.sol assembly { chainId := chainid() }

https://github.com/code-423n4/2022-07-golom/blob/7bbb55fca61e6bae29e57133c1e45806cbb17aa4/contracts/core/GolomTrader.sol#L96-L99

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