fix!: defensive ghost row constraints in bc_hashing pil#19481
Merged
dbanks12 merged 1 commit intomerge-train/avmfrom Jan 12, 2026
Merged
fix!: defensive ghost row constraints in bc_hashing pil#19481dbanks12 merged 1 commit intomerge-train/avmfrom
dbanks12 merged 1 commit intomerge-train/avmfrom
Conversation
jeanmon
approved these changes
Jan 12, 2026
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 12, 2026
BEGIN_COMMIT_OVERRIDE feat(avm security): add static check for isolated/unused columns (#19489) feat(avm): use noop calldata hasher in fast sim (#19495) chore(avm): rename indirect -> addressing mode (#19491) chore(avm): small cursor optimizations chore(avm):! rename indirect -> addressing mode (PIL) (#19493) fix(avm): constraint when unwinding empty call stack (#19485) feat(avm): Fuzz debug log and refactor env getter (#19494) fix!: ecc add predicate completeness bug (#19471) chore(avm): callstackmetadatacollector clarifications (#19490) chore: sanity assert in execution for bytecode id (#19486) fix!: sstore allowed injection of malicious write rows (#19470) fix!: defensive ghost row constraints in bc_hashing pil (#19481) fix(avm): fix execution::mov for mac? (#19507) chore(avm)!: resolve execution TODOs (#19501) fix!: multiple traces had ghost row injection vulnerabilities (#19480) fix(avm): defensively copy MemoryValues (#19512) feat: align TS and BB log levels (#19518) END_COMMIT_OVERRIDE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds defensive constraints to
bc_hashing.pilto prevent ghost row injection attacks on the#[GET_PACKED_FIELD_1]and#[GET_PACKED_FIELD_2]permutations.The vulnerability pattern: When
sel=0(gadget inactive), the sub-selectorssel_not_padding_1andsel_not_padding_2were only boolean-constrained, not forced to 0. A malicious prover could set these to 1 on ghost rows to fire the permutations intobc_decomposition.The fix: Add constraints that force these selectors to 0 when
sel=0:Note: This is a defensive fix. The destination trace (bc_decomposition) already has sel_packed * (1 - sel) = 0 which would block ghost destination rows, making the attack non-exploitable in practice.
Test Plan