Skip to content

Fix zeroed account discriminator detection#4645

Merged
jamie-osec merged 1 commit into
otter-sec:masterfrom
jamie-osec:fix-zeroed-byte-string-discriminators
Jun 11, 2026
Merged

Fix zeroed account discriminator detection#4645
jamie-osec merged 1 commit into
otter-sec:masterfrom
jamie-osec:fix-zeroed-byte-string-discriminators

Conversation

@jamie-osec

@jamie-osec jamie-osec commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Fixup for #4261

Summary

  • Reject all-zero account discriminator byte strings, including b"" and zero-filled byte strings.
  • Recurse through transparent expression forms and detect empty repeats like [1; 0], while leaving paths and calls unsupported.

Tests

  • cargo fmt --check
  • cargo test -p anchor-attribute-account
  • cargo clippy -p anchor-attribute-account --all-targets -- -D warnings

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

@jamie-osec is attempting to deploy a commit to the OtterSec Team on Vercel.

A member of the Team first needs to authorize it.

@jamie-osec jamie-osec marked this pull request as ready for review June 9, 2026 10:18
@jamie-osec jamie-osec requested a review from chen-robert as a code owner June 9, 2026 10:18
0x4ka5h
0x4ka5h previously approved these changes Jun 9, 2026

@0x4ka5h 0x4ka5h left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

swaroop-osec
swaroop-osec previously approved these changes Jun 11, 2026

@swaroop-osec swaroop-osec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a minor nit, non-blocking.

Comment thread lang/attribute/account/src/lib.rs Outdated
@clubby789 clubby789 dismissed stale reviews from swaroop-osec and 0x4ka5h via 52304d5 June 11, 2026 12:26
@clubby789 clubby789 force-pushed the fix-zeroed-byte-string-discriminators branch from 0e6f0e0 to 52304d5 Compare June 11, 2026 12:26
@jamie-osec jamie-osec merged commit e47eda0 into otter-sec:master Jun 11, 2026
169 of 173 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants