CVE-2023-4233: Ofono: sms decoder stack-based buffer overflow remote code execution vulnerability within the sms_decode_address_field() function

Published Dec 20, 2023
·
Updated

A flaw was found in ofono, an Open Source Telephony on Linux. A stack overflow bug is triggered within the smsdecodeaddressfield() function during the SMS PDU decoding. It is assumed that the attack scenario is accessible from a compromised modem, a malicious base station, or just SMS.

Other sources

ofono is a Open Source Telephony on Linux stack overflow bug is triggered within the smsdecodeaddressfield() function during SMS PDU decoding here assumed that the attack scenario is accessible from a compromised modem or possibily accessible from a malicious base station or just SMS

partial code path is here - atcmtnotify() - ofonosmsdelivernotify() - smsdecode() - decodedeliver() - smsdecodeaddressfield()

~~~C++ gboolean smsdecodeaddressfield(const unsigned char pdu, int len, int offset, gboolean sc, struct smsaddress out) { unsigned char addrlen; unsigned char addrtype; int bytelen;

if (!nextoctet(pdu, len, offset, &addrlen)) return FALSE;

if (sc && addrlen == 0) { out->address[0] = '\0'; return TRUE; }

if (!nextoctet(pdu, len, offset, &addrtype)) return FALSE;

if (sc) bytelen = addrlen - 1; else bytelen = (addrlen + 1) / 2;

if ((len - offset) < bytelen) return FALSE;

out->numbertype = bitfield(addrtype, 4, 3); out->numberingplan = bitfield(addrtype, 0, 4);

if (out->numbertype != SMSNUMBERTYPEALPHANUMERIC) { extractbcdnumber(pdu + offset, bytelen, out->address); // overflow within extractbcdnumber(), addrlen is from SMS PDU offset += bytelen; } else { ... }

void extractbcdnumber(const unsigned char buf, int len, char out) { static const char digitlut[] = "0123456789#abc\0"; unsigned char oct; int i;

for (i = 0; i < len; i++) { oct = buf[i];

out[i 2] = digitlut[oct & 0x0f]; out[i 2 + 1] = digitlut[(oct & 0xf0) >> 4]; }

out[i 2] = '\0'; } ~~~

ASAN report ================================================================= ==116978==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd18b788ac at pc 0x556e7631ff99 bp 0x7ffd18b78450 sp 0x7ffd18b78440 WRITE of size 1 at 0x7ffd18b788ac thread T0 #0 0x556e7631ff98 in extractbcdnumber src/smsutil.c:86 #1 0x556e76322c72 in smsdecodeaddressfield src/smsutil.c:650 #2 0x556e763237c3 in decodedeliver src/smsutil.c:761 #3 0x556e76329456 in smsdecode src/smsutil.c:1567 #4 0x556e762c508d in main src/main.c:225 #5 0x7f635c42350f in libcstartcallmain ../sysdeps/nptl/libcstartcallmain.h:58 #6 0x7f635c4235c8 in libcstartmainimpl ../csu/libc-start.c:381 #7 0x556e76064274 in start (/root/ofono/src/ofonod+0x12b274)

Address 0x7ffd18b788ac is located in stack of thread T0 at offset 316 in frame #0 0x556e762c4edd in main src/main.c:205

This frame has 1 object(s): [48, 316) 'sms1' (line 212) <== Memory access at offset 316 overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork (longjmp and C++ exceptions are supported) SUMMARY: AddressSanitizer: stack-buffer-overflow src/smsutil.c:86 in extractbcdnumber Shadow bytes around the buggy address: 0x1000231670c0: 01 f2 04 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 0x1000231670d0: 00 00 00 00 00 00 f1 f1 f1 f1 04 f3 f3 f3 00 00 0x1000231670e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 0x1000231670f0: f1 f1 f1 f1 00 00 00 00 00 00 00 00 00 00 00 00 0x100023167100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x100023167110: 00 00 00 00 00[04]f3 f3 f3 f3 f3 f3 f3 f3 00 00 0x100023167120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100023167130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100023167140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100023167150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100023167160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==116978==ABORTING

Red Hat

Affected Software

6 affected componentsFixes available
debian/ofono<=1.31-3
2.12-1
redhat/ofono<2.1
2.1
Ofono Project Ofono<2.1
Fedoraproject Fedora=38
Fedoraproject Fedora=39
Fedoraproject Fedora=40

Event History

Apr 17, 2024
CVE Published
via MITRE·10:50 PM
Data Sourced
via MITRE·10:50 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 PM
Affected Software
Dec 10, 2024
Data Sourced
via Launchpad·01:10 AM
Description
Dec 14, 2024
Data Sourced
via Ubuntu·01:10 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2023-4233?

CVE-2023-4233 has been classified as a critical vulnerability due to the potential for remote code execution stemming from a stack overflow condition.

2

How do I fix CVE-2023-4233?

To remediate CVE-2023-4233, update to ofono version 2.1 or later for Red Hat systems, or version 2.12-1 or later for Debian systems.

3

What systems are affected by CVE-2023-4233?

CVE-2023-4233 affects users running ofono versions prior to 2.1 on Red Hat and versions up to 1.31-3 on Debian.

4

What types of attacks can exploit CVE-2023-4233?

CVE-2023-4233 can be exploited via a compromised modem or a malicious base station targeting the SMS PDU decoding process.

5

Is CVE-2023-4233 something to be concerned about?

Yes, CVE-2023-4233 poses significant risks as it allows remote code execution, making it imperative to address immediately.

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