Skip to content
Crypto Audit finding Advanced

`operand_to_check` is not constrained to be a valid word in `eval_ecall`

The `FieldWordRangeChecker` assumes its argument is a valid word, but `eval_ecall` does not constrain `operand_to_check` to be a valid word. A malicious prover can supply invalid limbs that satisfy the range checker's conditions, violating the range check and breaking soundness.

1AutumnLeaf777 Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-08-pico-judging/issues/221

This issue has been acknowledged by the team but won't be fixed at this time.

Found by

1AutumnLeaf777

Summary

The FieldWordRangeChecker assumes that the argument to check will be a valid word, however there is nothing constraining operand_to_check to abide by this inside eval_ecall. A malicious prover can thus provide invalid limbs as the witness to the range checker which allows a prover to violate the range check.

Root Cause

https://github.com/sherlock-audit/2025-08-pico/blob/main/pico/vm/src/chips/chips/riscv_cpu/ecall/constraints.rs#L103-L110 as we can see there are no constraints that the operand_to_check is a valid word, however this is a requirement for the FieldWordRangeChecker, as there are no constraints that the word passed in is actually valid. Every other chip that invokes the word range check also invokes the ALU via the lookup argument, which thus implicitly constrains the argument as the ALU range checks its operands. However no call is present for operand_to_check.

Internal Pre-conditions

None

External Pre-conditions

None

Attack Path

  1. The prover provides an invalid word for the operand_to_check as long as the top limb is an actual byte equal to cols.most_sig_byte_decomp and that the sum of each limb is equal to zero. This lets invalid words be passed in for any ecall invocation that isn't halt or commit.

Impact

Ecalls do not have to take in valid words, which can arbitrarily effect their behavior especially if host programs use ecall to call SP1 precompiles. This breaks soundness guarantees.

PoC

No response

Mitigation

Ensure that each of the limbs in operand_to_check is a valid u8

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

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, the `eval_ecall` constraints do not enforce that `operand_to_check` is a valid word, unlike other chips that implicitly constrain it via ALU lookups.

Impact

Ecalls may accept invalid words, which could arbitrarily affect their behavior, especially if host programs use ecall to call SP1 precompiles, breaking soundness guarantees.

What the attacker needed

Malicious prover

The fix

Ensure that each limb in `operand_to_check` is constrained to be a valid `u8`.

How it was found

  1. The prover provides an invalid word for `operand_to_check`.
  2. The top limb is an actual byte equal to `cols.most_sig_byte_decomp`.
  3. The sum of each limb is equal to zero.
  4. This allows invalid words to be passed for any ecall invocation that isn't halt or commit.

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.

In zero-knowledge proofs, a prover tries to convince a verifier that a computation was done correctly without revealing the inputs. A range check ensures a number falls within allowed bounds. Here, the prover can cheat by giving a malformed number that passes the check, undermining trust in the proof.

What is Crypto?

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

More by 1AutumnLeaf777

View all

5 more disclosed reports, best first.

More from Brevis Pico ZKVM

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.