code-423n4 / 2024-07-traitforge-findings

2 stars 1 forks source link

A chain re-org would make a forger forge the wrong NFT and could even lose funds due to this #1090

Closed howlbot-integration[bot] closed 2 months ago

howlbot-integration[bot] commented 2 months ago

Lines of code

https://github.com/code-423n4/2024-07-traitforge/blob/279b2887e3d38bc219a05d332cbcb0655b2dc644/contracts/EntityForging/EntityForging.sol#L102

Vulnerability details

Proof of Concept

Protocol is to deploy on Base network

Protocol allows forging via Forging.sol#L102

When forging there is a need to get the listed NFT's by their Ids.

This then means that this scenario is possible.

Impact

A chain re-org would make a forger forge the wrong NFT and could even lose funds due to this, since they pay too much for forging and end up forging the wrong NFT.

Recommended Mitigation Steps

When forging the listed tokens consider the forger to indicate the fees of the NFTs they would like to forge, so in our case here even if the re-org happens the tx would revert since the fees wouldn't match.

Assessed type

Timing

c4-judge commented 2 months ago

koolexcrypto marked the issue as satisfactory