Skip to content

audit F7 [robustness]: SignedMessage uses Vec<u8> not [u8;32]/[u8;64] #517

@intendednull

Description

@intendednull

File: crates/identity/src/lib.rs:380-387
Severity: robustness — availability
Obvious? no

SignedMessage declares public_key: Vec<u8> and signature: Vec<u8> rather than [u8; 32] / [u8; 64].

Attacker crafts a SignedMessage where these fields consume the bulk of MAX_DESER_SIZE (256 KB) — bincode allocates the Vecs before any signature verification. Length is checked via try_into::<[u8;32]> only after the Vecs are allocated.

Fix: schema → fixed-size arrays. bincode rejects mismatched lengths before allocation.


Filed by /general-audit @ b901575 (2026-05-02). master: #513.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions