CWE-1285 is a weakness class for poor validation of an index, position, or offset supplied in input. In practice, software trusts a number that should have been checked against the size or layout of a buffer, array, or structure. If the value is too large, negative, or otherwise invalid, the program may read or write memory outside the intended boundary.
This matters because boundary mistakes can lead to crashes, data corruption, or information disclosure, and in network-facing systems they are often reachable with a single crafted packet or request. Attackers look for parsers and protocol handlers that use attacker-controlled offsets without strict checks. Defenders reduce risk by validating input ranges, using safe parsing logic, fuzzing boundary conditions, and hardening exposed services. In OT and embedded environments, a CWE-1285 bug can turn a small parsing error into a denial of service event.


