Skip to content
Smart contracts Audit finding Intermediate

LSP8 and LSP9’s ERC-165 interface ID differs from their specification

The ERC-165 interface IDs hardcoded for LSP7 and LSP8 token contracts did not match the values published in the LIP specifications. Protocols that check compatibility using the specification values would get incorrect answers from supportsInterface().

MiloTruck Follow with codegpt

Originally disclosed on Code4rena

Submitted by MiloTruck, also found by codegpt

According to LSP7’s specification, the ERC-165 interface ID for LSP7 token contracts should be 0x5fcaac27:

ERC165 interface id: 0x5fcaac27

However, _INTERFACEID_LSP7 has a different value in the code:

LSP7Constants.sol#L4-L5

// --- ERC165 interface ids
bytes4 constant _INTERFACEID_LSP7 = 0xda1f85e4;

Similarly, LSP8’s interface ID should be 0x49399145 according to LSP8’s specification:

ERC165 interface id: 0x49399145

However, _INTERFACEID_LSP8 has a different value in the code:

LSP8Constants.sol#L4-L5

// --- ERC165 interface ids
bytes4 constant _INTERFACEID_LSP8 = 0x622e7a01;

These constants are used in supportsInterface() for the LSP7DigitalAsset and LSP8IdentifiableDigitalAsset contracts.

Impact

Protocols that check for LSP7/LSP8 compatibility using the ERC-165 interface IDs declared in the specification will receive incorrect return values when calling supportsInterface().

Recommended Mitigation

Ensure that the interface ID declared in the code matches their respective ones in their specifications.

Assessed type

Error

CJ42 (LUKSO) disputed and commented via duplicate issue #101:

The bytes4 interface ID is correct according to the specs.

CJ42 (LUKSO) responded via private discord communication in regards to their previous comment above:

The interface IDs for LSP7 + LSP8 are correct in terms of they represent correctly the XOR of all the function selectors of ILSP7 and ILSP8. So they are correct according to the Solidity code. It’s in the LIP specs that there was an error (had not been updated and forgotten in a previous PR). We fixed it in the LIP specs document. Reference this PR.


The original report as published on Code4rena, by MiloTruck. 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 a mismatch between the interface ID constants in the contracts and the values published in the LIP specifications, which the project says was an error in the specification document rather than the code.

Impact

Any protocol relying on the specification's interface IDs to detect LSP7/LSP8 compatibility would receive incorrect results from supportsInterface(), though the project disputes that the contracts are at fault.

What the attacker needed

Contracts implementing LSP7 or LSP8; caller relies on spec interface IDs

The fix

The project stated it corrected the interface IDs in the LIP specification document rather than changing the contracts.

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.

Smart contracts can advertise which features they support by answering a yes/no question with a short code called an interface ID. Here the code answered with a different code than the one written in the public specification, so other contracts following the spec would think these tokens did not support the expected features. The project later said the code was right and the specification document was the part that was wrong.

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 MiloTruck

View all

35 more disclosed reports, best first.

More from LUKSO

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.