Skip to content
Audit finding Beginner

NatSpec of several functions in ethereum.move is wrong

The NatSpec comments for two functions in ethereum.move incorrectly state that they abort when an address is not EIP-55 compliant, but the functions only check length and hexadecimal format. This documentation error could mislead developers about the functions' validation behaviour.

avoloder Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#41899 [BC-Insight] NatSpec of several functions in `ethereum.move` is wrong

Submitted on Mar 19th 2025 at 09:07:07 UTC by @avoloder for Attackathon | Movement Labs

Description

Brief/Intro

NatSpec comments in several functions are wrong with regard when the functions should abort (aptos-move/framework/aptos-framework /sources/ethereum.move)

Vulnerability Details

Functions ethereum_address_no_eip55() and ethereum_address_20_bytes() contain comments that they are expected to abort if the address does not conform to EIP-55 standards, which is not true.

ethereum_address_no_eip55() calls assert_40_char_hex() which checks if the address is a nonzero 40-character hexadecimal string, but not if the address is compliant with EIP-55 standard.

ethereum_address_20_bytes() only checks if the vector's length is 20, but also does not check if the address is a valid EIP-55 address.

Impact Details

There is no security impact here, only documentation issue, which might cause confusion as to how the function should behave

References

https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/627b4f9e0b63c33746fa5dae6cd672cbee3d8631/aptos-move/framework/aptos-framework/sources/ethereum.move#L31-L39

https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/627b4f9e0b63c33746fa5dae6cd672cbee3d8631/aptos-move/framework/aptos-framework/sources/ethereum.move#L41-L49

Proof of Concept

Aligning NatSpec with the function's behavior prevents confusion about what the function is supposed to do, i.e., it clearly describes the function's expectations.

It is also a valuable enhancement for the following reasons:

  • In collaborative development, it might be unclear whether these functions should abort if they are/are not EIP-55 compliant.
  • It helps eliminate false assumptions that the function will abort if it’s not EIP-55 compliant, reducing the risk of errors elsewhere in the code

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

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

The NatSpec comments were not updated to match the actual validation logic, which only checks length and hexadecimal format, not EIP-55 compliance.

Impact

There is no security impact; it is only a documentation issue that might cause confusion about how the functions behave.

What the attacker needed

None

The fix

The NatSpec comments should be corrected to accurately describe the functions' actual validation behaviour.

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.

NatSpec comments are notes in the code that explain what a function does. Here, the notes said the function would stop with an error if an Ethereum address did not follow a specific formatting rule (EIP-55), but the function actually only checks the address length and that it uses hexadecimal characters. This mismatch could confuse developers who rely on the notes.

More by avoloder

View all

10 more disclosed reports, best first.

More from Movement Labs

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.