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.
- 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
- Report ID: #41027
- Report Type: Blockchain/DLT
- Report severity: Insight
- Target: https://github.com/immunefi-team/zano-iop/tree/main/src/currency\\_core/currency\\_format\\_utils.cpp
- Impacts:
- Cryptographic inconsistency
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()andCURRENCY_TX_MAX_ALLOWED_INPUTSaccross 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.
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.