Off-by-One Error
A boundary mistake of one element that corrupts adjacent memory.
What it is
A bug where a loop or index is off by a single position, for example writing one byte past a buffer or omitting a terminating element. The single-element overshoot can still corrupt an adjacent pointer or length.
Why it matters
Off-by-one errors are subtle but exploitable, sometimes overwriting a single critical byte such as a metadata field or pointer's low byte. They are a reminder that even one-byte overflows are not safe to dismiss.
In practice
A loop iterates one too many times and writes a null byte over the least-significant byte of an adjacent saved pointer.
What to look for
- Loops using <= where < was meant.
- Buffers sized without room for a null terminator.
- Single byte overwrites next to sensitive data.
Common mistake
Dismissing one byte as harmless. A single byte can change a pointer or length.
Practice it nearby
CyberKit has no tool for this term itself. These are the closest places to practice it.
- Risk Scoring
Score a vulnerability with CVSS v3.1, or an incident across five dimensions, and see the reasoning behind each number.
- Map and Score
Map real procedures to ATT&CK techniques, then pick the CVSS v3.1 metrics for real vulnerabilities.
In the field
Well-known tools where this shows up on the job. They are listed to show the landscape, not as a recommendation.
-
Nessus Commercial
A vulnerability scanner that checks hosts for known flaws and missing patches.
-
Qualys VMDR Commercial
A cloud platform that scans assets and ranks vulnerabilities for patching.
-
OpenVAS Open source
An open source vulnerability scanner with a large set of checks.
-
Nuclei Open source
Runs community templates that test for specific, newly published flaws.
Read next
- Buffer Overflow: Writing past the end of a buffer to corrupt adjacent memory.
- Integer Overflow: Arithmetic that exceeds an integer's range and wraps to a wrong value.
- Out-of-Bounds Write: Writing to memory outside the bounds of an intended buffer.