fix(aztec-nr): fix OOB index with nonzero offset#21613
Merged
nventuro merged 3 commits intomerge-train/fairiesfrom Mar 17, 2026
Merged
fix(aztec-nr): fix OOB index with nonzero offset#21613nventuro merged 3 commits intomerge-train/fairiesfrom
nventuro merged 3 commits intomerge-train/fairiesfrom
Conversation
…_selector with nonzero offset
mverzilli
reviewed
Mar 17, 2026
nventuro
reviewed
Mar 17, 2026
| unconstrained fn extract_property_value_full_field_is_identity() { | ||
| let packed = [12345 as Field]; | ||
| let selector = PropertySelector { index: 0, offset: 0, length: 32 }; | ||
| let result = super::extract_property_value_from_selector(packed, selector); |
Contributor
There was a problem hiding this comment.
Import the fn instead of using super:: in each test
nventuro
reviewed
Mar 17, 2026
nventuro
approved these changes
Mar 17, 2026
AztecBot
pushed a commit
that referenced
this pull request
Mar 17, 2026
I simply asked Claude to go through our code and find bugs, and it found this ## Summary - Fixes an out-of-bounds array access in `extract_property_value_from_selector` when `PropertySelector.offset > 0`. The formula `31 + offset - i` produces index >= 32 at `i = 0`; corrected to `31 - offset - i`. - Adds a regression test exercising a nonzero offset. ## Note The bug was dormant -- every `PropertySelector` in the codebase uses `offset: 0` (the macro hardcodes it). But anyone trying to use sub-field byte selection would hit a runtime panic.
Collaborator
|
✅ Successfully backported to backport-to-v4-next-staging #21654. |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 18, 2026
BEGIN_COMMIT_OVERRIDE fix(stdlib): accept null return_type for void Noir functions (#21647) feat!: make AES128 decrypt oracle return Option (#21696) fix(aztec-nr): fix OOB index with nonzero offset (#21613) feat!: include init_hash in private initialization nullifier to prevent privacy leak (#21427) 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.
I simply asked Claude to go through our code and find bugs, and it found this
Summary
extract_property_value_from_selectorwhenPropertySelector.offset > 0. The formula31 + offset - iproduces index >= 32 ati = 0; corrected to31 - offset - i.Note
The bug was dormant -- every
PropertySelectorin the codebase usesoffset: 0(the macro hardcodes it). But anyone trying to use sub-field byte selection would hit a runtime panic.