REDHAT-BUG-2489133: Buffer Overflow

Published Jun 16, 2026
·
Updated

A heap-based buffer overflow vulnerability was found in oFono's HDLC (High-Level Data Link Control) decoder. The newbytes() function in gatchat/gathdlc.c writes incoming serial data bytes into a heap-allocated decodebuffer of 4096 bytes (BUFFERSIZE = 2 2048) using a decodeoffset counter that is only reset to 0 when a HDLC flag byte (0x7E) is received. There is no bounds check comparing decodeoffset against BUFFERSIZE before writing to decodebuffer[decodeoffset++] at lines 288 and 309.

If a compromised modem sends more than 4096 bytes without a HDLC flag byte, decodeoffset increments past BUFFERSIZE and subsequent writes corrupt heap memory beyond the allocated buffer. This is a particularly powerful exploitation primitive because the attacker controls: (1) the write offset — determined by how many bytes are sent without a flag, which can be arbitrarily large, (2) the written value — each byte is the raw byte from the serial link or byte XOR 0x20 for escaped bytes, (3) the write granularity — byte-by-byte for precise heap corruption, and (4) the state persists across multiple newbytes() callback invocations.

The HDLC layer is used in two contexts: PPP data connections (when an AT modem establishes a data call via ATD99# or AT+CGDATA) and GSM 07.10 Advanced MUX mode. In both cases, a compromised baseband modem has direct control over the raw bytes on the serial link. Since ofonod runs as root with no sandbox, successful exploitation of the heap corruption could lead to arbitrary code execution with root privileges.

The vulnerability was tested on oFono version 2.19 on Ubuntu 25.04.

Affected Software

1 affected component
oFono oFono=2.19

Event History

Jun 16, 2026
Data Sourced
via Red Hat·10:15 AM
DescriptionSeverityAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203