Bid Beasts

First Flight #49
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Valid

Burn event logs caller instead of actual owner, breaking off-chain provenance

Root + Impact

Description

  • Normal behavior:

    For burns, ERC-721 already emits Transfer(owner, address(0), tokenId). If a custom burn event is used, its from field should reflect the token’s owner at the moment of burn (or the approved operator if your schema requires it) so indexers, analytics, and monitoring systems capture accurate provenance.


  • Specific issue:

    BidBeastsBurn emits msg.sender as from, not the actual owner. When an approved operator (or in the current code, any caller) burns a token, the event falsely attributes the burn to the caller, corrupting off-chain history, dashboards, and forensic pipelines.


function burn(uint256 _tokenId) public {
_burn(_tokenId); //@audit emits incorrect 'from'
@> emit BidBeastsBurn(msg.sender, _tokenId); // @> Wrong: should be the token owner, not caller
}

Risk

Likelihood:

  • Any burn execution will produce a misleading from in BidBeastsBurn because the code always uses msg.sender.

  • This happens regardless of who initiates the burn (owner, approved operator, or arbitrary caller under the current unrestricted burn).\

Impact:

  • Off-chain indexers and explorers attributing burns to the caller will record incorrect provenance, harming investigations, analytics, royalty/accounting systems, or alerting.

  • Wallets and monitoring tools relying on the custom event may display wrong actors, causing user disputes and reputational damage.


Proof of Concept

// Setup: Alice owns tokenId = 7. She has approved Bob as operator.
// Bob (approved operator) executes the burn:
BidBeasts(bidBeasts).burn(7);
// Events observed:
// - Standard ERC721: Transfer(Alice, address(0), 7) ✅ correct
// - Custom event: BidBeastsBurn(Bob, 7) ❌ incorrect (should reflect Alice)

Recommended Mitigation

  1. Emit the actual owner (pre-burn) instead of msg.sender, or simply rely on the ERC-721 Transfer event and remove the custom burn event.

function burn(uint256 tokenId) public {
+ require(_isApprovedOrOwner(_msgSender(), tokenId), "Not owner nor approved");
+ address owner_ = ownerOf(tokenId); // capture true owner before state change
_burn(tokenId);
+ emit BidBeastsBurn(owner_, tokenId); // now accurate
}
Updates

Lead Judging Commences

cryptoghost Lead Judge 2 months ago
Submission Judgement Published
Validated
Assigned finding tags:

BidBeasts Marketplace: Incorrect Event Emission

placeBid emits AuctionSettled even though the auction hasn’t ended, causing misleading event logs.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!