What testing doesn’t reach
Each of these bugs needs a particular kind of input before it shows itself. That is what makes testing an unreliable way to find them: a test only covers the inputs someone thought to supply, and each of the usual tools stops short in its own way. A proof does not have that limit.
The projects below show what that looks like in practice. Fuzzers find what they stumble into, and these bugs sit behind inputs that are hard to stumble into: a sysstat performance data file listing the same activity 44 times, or two well-formed telegrams from an M-Bus utility meter arriving in a particular order. Sanitizers only report on code a test actually runs, and cracklib’s password checker overflows its buffer only when an account carries a 512-character word in its gecos field and a password is checked against that same account.
A proof covers every input in scope, so none of these preconditions have to be guessed in advance. When the proof fails, what comes back is a compiling C program that reproduces the bug.
The findings
- sysstatOut-of-bounds write (CWE-787)Fixed
- libmbusDouble free (CWE-415), with a use-after-free read (CWE-416)Fixed
- dtc / libfdtOut-of-bounds write (CWE-787) and read (CWE-125)Fixed
- cracklibStack out-of-bounds write (CWE-787)Fixed
sysstat
Affected versions: 12.8.0, and master at time of reporting
sysstat is the Linux performance-monitoring suite: sadc collects system activity into binary data files and sar reports on them. It is very widely installed on servers, particularly RHEL-family systems, and its data files are routinely copied between machines for analysis after an incident. Aristotle found and fixed an out-of-bounds write reachable from the ordinary sar -f path. A crafted data file can write past a global array into the globals next to it in the reading process.
| Stage | Commit | Aristotle run |
|---|---|---|
| Bug present | 02167224 | Initial run |
| Patch accepted | ea7744be | Fix check |
| Function | Bug class | Status |
|---|---|---|
| check_ | Out-of-bounds write (CWE-787) | Fixed |
libmbus
Affected versions: 0.10.4 and earlier, and master at time of reporting
libmbus implements the Meter-Bus protocol (M-Bus, EN 13757) for reading utility meters over serial lines or TCP. It is standard within metering, used in smart-metering gateways and building automation. Aristotle found and fixed a double free, preceded by a use-after-free read, in the public function the shipped multi-reply tools call. A meter or TCP-to-M-Bus gateway can corrupt the heap of the application reading it.
| Stage | Commit | Aristotle run |
|---|---|---|
| Bug present | 057ab631 | Initial run |
| Patch accepted | 13a6f844 | Fix check |
| Function | Bug class | Status |
|---|---|---|
| mbus_ | Double free (CWE-415), with a use-after-free read (CWE-416) | Fixed |
dtc / libfdt
Affected versions: 1.7.1 through 1.8.1, and main at time of reporting
libfdt is the C library for reading and editing flattened device tree blobs, the hardware descriptions that ARM, RISC-V and PowerPC systems boot with. It is vendored into most boot and virtualisation stacks, including the Linux kernel, U-Boot, QEMU, Xen and OpenSBI. Aristotle found and fixed an out-of-bounds read and write when applying a device tree overlay. A crafted overlay gets a four-byte read-modify-write at an offset it chooses, and the overlay still passes libfdt’s own fdt_check_full() validation.
| Stage | Commit | Aristotle run |
|---|---|---|
| Bug present | ce51dcbd | Initial run |
| Patch accepted | 42980898 | Fix check |
| Function | Bug class | Status |
|---|---|---|
| overlay_ | Out-of-bounds write (CWE-787) and read (CWE-125) | Fixed |
| overlay_ | Out-of-bounds write (CWE-787) and read (CWE-125) | Fixed |
The accepted commit also adds a regression test, tests/overlay_bad_fixup_local_fixups_offset.dts.
cracklib
Affected versions: 2.10.0 through 2.10.3, and main at time of reporting
cracklib checks password strength against dictionaries of weak passwords and against the user’s own account details, such as their name and gecos field. It is a default dependency on RHEL and Fedora, reached through the PAM password-change stack behind tools like passwd and chpasswd. Aristotle found and fixed a stack buffer overflow in the word-mangling code, along with three further undefined-behaviour sites in the same functions. A long enough word in an account’s gecos field overflows a 1024-byte stack buffer whenever a password is checked for that account.
| Stage | Commit | Aristotle run |
|---|---|---|
| Bug present | 34a5d20b | Initial run |
| Patch accepted | #129, #130, #131, #132 | Fix check |
| Function | Bug class | Status |
|---|---|---|
| Mangle() | Stack out-of-bounds write (CWE-787) | Fixed |
| Reverse() | Out-of-bounds pointer arithmetic | Fixed |
| Pluralise() | Out-of-bounds read (string[-1], CWE-125) | Fixed |
| MatchClass(), Char2Int(), CRACK_ | Invalid argument to <ctype.h> function (negative char) | Fixed |
