Skip to content
Misconfiguration Audit finding Intermediate

Amino legacy signing method broken because of name mismatch

Several Amino type names registered in Go code did not match the amino.name options in the protobuf definitions, so the legacy Amino codec could not find the interface and would fail to encode or decode those messages. This could break legacy signing and transaction handling for the affected message types.

Franfran Follow

Originally disclosed on Code4rena

Submitted by Franfran

The LegacyAmino codec is used for legacy reasons. Even if this codec is in the process of being deprecated for gogoprotobuf, it’s still relevant and if not implemented correctly, it won’t work correctly. Here is the implementation of the RegisterConcrete method to register the amino methods:

// This function should be used to register concrete types that will appear in
// interface fields/elements to be encoded/decoded by go-amino.
// Usage:
// `amino.RegisterConcrete(MyStruct1{}, "com.tendermint/MyStruct1", nil)`
func (cdc *Codec) RegisterConcrete(o interface{}, name string, copts *ConcreteOptions) {

As explained in the docs comment, it should be used to register concrete types for the interface. The name should match the amino.name options in the protobuf messages or it won’t be able to find the interface and won’t be able to encode/decode messages. Here are the places where the name is mismatched.

The RegisterAminoMsg can also be called which adds a check on the length of the input. However, it has not been found that any name exceeds this length of 39 characters. As a recommendation, the RegisterAminoMsg is preferred.

MiniEVM

MiniWASM

Initia

Recommended mitigation steps

Make sure that the amino names are matching.

hoon (Initia) confirmed and commented:

Fixed in the commits Initia, MiniWasm and MiniEVM.

Initia mitigated:

Fixed amino.

Status: Mitigation confirmed. Full details in reports from berndartmueller, 0xAlix2 and Franfran.


The original report as published on Code4rena, by Franfran. 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

The Amino registration names in the Go codec files did not match the amino.name values declared in the protobuf files.

Impact

Legacy Amino encoding and decoding of the affected messages would fail, which could break legacy signing and transaction processing for those types.

What the attacker needed

Legacy Amino codec in use; affected message types

The fix

The amino names were made to match, and the project confirmed the issue was fixed in the referenced commits.

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.

Amino is an older way of turning structured data into bytes and back. Each message type must be registered under exactly the same name in two places; if the names differ, the system cannot recognise the message and encoding or decoding fails. Here several names were spelled differently in the two places.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by Franfran

View all

14 more disclosed reports, best first.

More from Initia Cosmos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.