This vulnerability occurs when software processes data from another system without considering byte order (endianness), such as big-endian or little-endian. This mismatch can cause the program to misinterpret numbers or values, leading to incorrect calculations, crashes, or security flaws.
At its core, this issue is a data representation mismatch. Different computer architectures store multi-byte data (like integers or memory addresses) in opposite orders. Big-endian stores the most significant byte first, while little-endian stores it last. When software assumes one format but receives data in the other, it reads values backwards, turning a harmless number into a potentially dangerous or logic-breaking one. To prevent this, developers must explicitly define and validate the byte order for any data crossing trust boundaries, such as in network protocols, file parsers, or inter-process communication. Always use standardized conversion functions (like `ntohl()` or `htons()`) for network data, and consider employing structured data formats with built-in serialization that handles these details automatically.
Impact: Unexpected State