Skip to content
Crypto Audit finding Advanced

Breaking asset surjection proof assumptions

The report claims that the number of transaction inputs is not validated before calling a proof verification function that assumes a maximum of 256 inputs. An attacker could potentially bypass or break the aggregated asset surjection proof by submitting a transaction with more than 256 inputs.

Blockian Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#41027 [BC-Insight] Breaking asset surjection proof assumptions

Submitted on Mar 9th 2025 at 17:58:59 UTC by @Blockian for IOP | Zano

Description

Note:
I'm relying on two checks in you code base:

  • static const size_t N_max = 256; (src/crypto/one_out_of_many_proofs.cpp:23)
  • static_assert(CURRENCY_TX_MAX_ALLOWED_INPUTS <= N_max, "CURRENCY_TX_MAX_ALLOWED_INPUTS is inconsistent with one-out-of-many proof limits"); (src/crypto/one_out_of_many_proofs.cpp:26)
  • CHECK_AND_FAIL_WITH_ERROR_IF_FALSE(N <= N_max, 3); (src/crypto/one_out_of_many_proofs.cpp:79)
    They state that the aggregated surjection proof can only work up to 256 inputs.

I don't know if by having more inputs than that the proof can be bypassed, or if it only breaks it so that it won't work at all

Impact

The impact is that one out of many verify_BGE_proof (used for aggregated asset surjection) can be called with a ring size that is larger than 256 which is the maximum that is consistent with the one-out-of-many proof (as per this comment: src/crypto/one_out_of_many_proofs.cpp:23)

Root Cause

The root cause is that the number of inputs isn't validated anywhere.

Deep Dive

  • Can search vin.size() and CURRENCY_TX_MAX_ALLOWED_INPUTS accross the codebase to validate

Suggested Fix

Validate tx.vin.size()

Severity

As stated, I don't know.
If this does nothing to the proof and the comment is wrong, than it's only an insight.
If this breaks the proof, than it's dependent on what breaks. A critical if the checks can be completely bypassed in some instances, less otherwise.
I'm not sure I have enough time to dive into this aggregation proof as I'm trying to cover as much code as possible.

Proof of Concept

Proof of Concept

Any transaction with more than 256 inputs.

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

Impact

The impact is uncertain: it could either break the proof so it fails, or allow bypassing the proof, depending on how the verification handles larger input counts.

What the attacker needed

Ability to submit a transaction

The fix

The number of transaction inputs should be validated to ensure it does not exceed the maximum allowed.

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.

This report is about a cryptocurrency system that uses cryptographic proofs to ensure transactions are valid. The researcher found that a limit on the number of inputs (256) is not enforced, so someone could try to send a transaction with more inputs and possibly trick the system into accepting an invalid proof.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More by Blockian

View all

34 more disclosed reports, best first.

More from Zano

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.