Skip to content

fix: reject duplicate private function selectors#24712

Draft
AztecBot wants to merge 1 commit into
nextfrom
cb/kernels-audit-remediation-912-private-selector-collisions
Draft

fix: reject duplicate private function selectors#24712
AztecBot wants to merge 1 commit into
nextfrom
cb/kernels-audit-remediation-912-private-selector-collisions

Conversation

@AztecBot

Copy link
Copy Markdown
Collaborator

Summary

Private AuthWit action hashes bind a private function by selector, while private function membership is committed as (selector, vkHash). This change rejects duplicate private selectors during artifact-to-class construction and private function tree construction so a class cannot commit two private functions that share the AuthWit selector identity.

Fix

  • Add a duplicate-selector check for private functions before building the private function tree/root.
  • Reuse that check in getContractClassFromArtifact and include colliding artifact function names in the error.
  • Add regressions for the known colliding selector pair and for direct private-function root construction.

Testing

  • git diff --check
  • awk 'length($0)>120 { print FILENAME ":" FNR ":" length($0) ":" $0 }' yarn-project/stdlib/src/contract/contract_class.ts yarn-project/stdlib/src/contract/contract_class.test.ts yarn-project/stdlib/src/contract/private_function.ts yarn-project/stdlib/src/contract/private_function.test.ts
  • yarn workspace @aztec/stdlib test src/contract/contract_class.test.ts src/contract/private_function.test.ts (blocked before tests: missing node_modules state)
  • yarn install --immutable (blocked: @aztec/noir-acvm_js@portal:../noir/packages/acvm_js manifest not found)

Issues

  • Closes AztecProtocol/aztec-claude#912 — private AuthWit action hash aliases duplicate private selectors

Created by claudebox · group: kernels-audit-remediation

@AztecBot AztecBot added ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR. labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant