Swift Crypto: X-Wing HPKE Decapsulation Accepts Malformed Ciphertext Length
The X-Wing decapsulation path accepts attacker-controlled encapsulated ciphertext bytes without enforcing the required fixed ciphertext length. The decapsulation call is forwarded into a C API, which expects a compile-time fixed-size ciphertext buffer of 1120 bytes. This creates an FFI memory-safety boundary issue when a shorter Data value is passed in, because the C code may read beyond the Swift buffer. The issue is reachable through initialization of an HPKE.Recipient, which …