Skip to content
Smart contracts Audit finding Beginner

Marketplace calls unimplemented function

The marketplace contract calls a transferFrom function on a safe token library that does not implement it, so the mint and mintWithUnderlying functions always revert. An attacker cannot exploit this to steal funds, but users cannot use those functions.

0x52 Follow

Originally disclosed on Code4rena

Submitted by 0x52

https://github.com/code-423n4/2022-06-illuminate/blob/3ca41a9f529980b17fdc67baf8cbee5a8035afab/marketplace/MarketPlace.sol#L203-L204

https://github.com/code-423n4/2022-06-illuminate/blob/3ca41a9f529980b17fdc67baf8cbee5a8035afab/marketplace/MarketPlace.sol#L220

Vulnerability details

While safe.sol isn’t explicitly listed in scope it is listed as a library for all in scope contracts so I believe it should be in scope

Impact

mint and mintWithUnderlying won’t function.

Proof of Concept

safe.sol never implements a transferFrom function meaning it will revert whenever a user calls either function.

Recommended Mitigation Steps

Create an implementation for transferFrom.

JTraversa (Illuminate) disagreed with severity and commented:

I don’t believe this should be considered high risk (an incorrectly copy/pasted safeTransfer lib) based on principal hah, but beyond that I don’t think it should be high risk because without the expected safeTransfer lib, the contracts would not properly compile / no value would be at risk.

gzeoneth (judge) decreased severity to Medium and commented:

Judging as Med Risk as no value at risk and function of the protocol would be impacted.


The original report as published on Code4rena, by 0x52. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the safe token library was copied or pasted without implementing the transferFrom function that the marketplace contract expects.

Impact

The mint and mintWithUnderlying functions will not work, but no funds are at risk.

What the attacker needed

None

The fix

The library should be fixed by adding an implementation for transferFrom.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract library is meant to provide safe token transfers, but it is missing a required function. When the marketplace tries to call that missing function, the transaction fails and the feature does not work. This is a bug that breaks functionality rather than letting someone steal money.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by 0x52

View all

211 more disclosed reports, best first.

More from Illuminate contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.