Skip to content

Validate entrypoint account bounds - #170

Merged
edo-chan merged 1 commit into
mainfrom
codex/swi-entry-account-bounds
Jun 11, 2026
Merged

Validate entrypoint account bounds#170
edo-chan merged 1 commit into
mainfrom
codex/swi-entry-account-bounds

Conversation

@edo-chan

@edo-chan edo-chan commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reject top-level instructions with more than MAX_ACCOUNTS accounts before filling fixed account/classification arrays
  • validate each fixed-array write slot in the entrypoint account loop
  • reject duplicate account references that point to the current or a future account slot before reading from initialized account storage
  • add focused unit coverage for account-count, slot, and duplicate-index validation

Security note

This addresses the program-entry side of oversized account-list handling. It is separate from #165, which fixes compact-instruction InstructionHolder account metadata ownership.

Tests

  • rustup run nightly rustfmt --edition 2021 program/src/lib.rs
  • cargo test -p swig validate_ --lib
  • cargo test -p swig duplicate_account --lib
  • cargo +stable clippy -p swig --lib --tests

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@edo-chan
edo-chan merged commit b8de8e1 into main Jun 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants