REDHAT-BUG-2489122: Buffer Overflow

Published Jun 16, 2026
·
Updated

A stack-based buffer overflow vulnerability was found in oFono's AT modem USSD handling. The function cusdparse() in drivers/atmodem/ussd.c uses a bounds check (strlen > sizeof(msg) 2, i.e., strlen > 320) that is designed for the hex decode paths where 2 input hex characters produce 1 output byte. However, when the GSM 7-bit character set is used (ATUTILCHARSETGSM + SMSCHARSET7BIT), pack7bitownbuf() is called which packs each input character into 7/8 bytes of output. This means 320 input characters produce 280 bytes of output, overflowing the 160-byte stack buffer msg[160] by up to 120 bytes.

The correct limit for the GSM 7-bit pack path is 182 characters (182 7/8 = 159 bytes). Both the UTF-8 path (ussdencode) and UCS2 path (ucs2gsmtopacked) correctly check for this limit, but the GSM path is missing the check.

A compromised modem baseband can trigger this by sending an unsolicited +CUSD notification with a long payload (e.g., 300 characters) after the modem reports GSM charset via AT+CSCS?. The overflow corrupts the stack frame including saved registers and the return address, leading to a crash or potentially arbitrary code execution. Since ofonod runs as root with no sandbox, successful exploitation grants root-level code execution. No user interaction is required — the +CUSD notification is unsolicited and processed automatically.

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:03 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