BP Breakpoint
← All posts
Vulnerability Research CVE-2023-24033 Exynos Modem 5123 Reproduced

The Eleventh Slot: an IMS SDP heap overflow in Exynos modem firmware

Samsung's Shannon SDP parser allocates exactly enough room for ten media types, then never enforces that limit. We located the parser, rebuilt the faulting path inside a full-system emulator, and drove it from the IMS entry point until the eleventh slot wrote past its allocation.

SIP call flow: REGISTER, 401 Unauthorized, REGISTER with credentials, 200 OK, then an INVITE whose SDP list overflows the modem parser
Contents
  1. Abstract
  2. Why modems still matter
  3. IMS and SIP, in plain terms
  4. How memory bugs become compromises
  5. The target
  6. Acquiring the image
  7. Locating the parser
  8. The descriptor table
  9. Anatomy of the decoder
  10. The defect
  11. Reachability
  12. The session gate
  13. Reproduction
  14. Results
  15. Exploitability
  16. Impact, honestly
  17. Remediation
  18. References
Note on attribution

This article is an independent reproduction and analysis of CVE-2023-24033. The vulnerability was discovered and reported by others well before this work, and is documented in the March 2023 Android Security Bulletin. Nothing here is a new finding, and no new vulnerability is disclosed.

Credit for the discovery belongs entirely to its original reporters. The author claims none of it. The contribution here is narrower: locating the defect in one specific shipped image, reconstructing the path that reaches it, and reproducing it under emulation so the explanation can be checked rather than taken on trust.

How to read this

Addresses are hexadecimal, so 0x78 is decimal 120 and 0x42bfc0e4 is an offset inside the modem image. A register is a small named storage cell inside the processor; ARM32 has sixteen, and the first four carry a function's arguments. A breakpoint marks an address where the emulated CPU stops so we can read those registers and the surrounding memory.

None of that is needed to follow the argument. If you read only two sections, read the defect and the impact. The rest is the road between them.

Terms used in this article
Attribute
An a= line in SDP carrying a parameter. This article follows one whose value is a space-separated list.
Baseband / modem
The processor and firmware that run the cellular stack, separate from Android and the apps.
Block
A region of memory returned by malloc. Nothing inside it records where it ends.
Decoder
The function that parses one attribute's value.
Descriptor table
A firmware array mapping attribute names to decoder functions.
Dispatcher
The code that looks up a descriptor and calls its decoder.
Entry
One space-separated item inside an attribute value. One entry becomes one slot.
Heap
The memory pool that malloc hands blocks out of.
IMS
IP Multimedia Subsystem, the operator network that carries voice and video over IP.
Out-of-bounds write
A store past the end of the object the code meant to write to.
Primitive
A repeatable capability an exploit needs, such as writing to an address of the attacker's choosing.
Slot
One 12-byte cell in the array: a present flag, a pointer to the copy of the entry, and a length.

Abstract

CVE-2023-24033 is a memory corruption defect in the Session Description Protocol parser shipped in Samsung's Shannon baseband. The parser splits an SDP attribute value on spaces and stores each entry in a fixed array of ten twelve-byte slots, but the entry loop performs no bound check. A value containing eleven entries writes a slot entry past the end of a 120-byte heap allocation.

We recovered the affected firmware from a Pixel 6, identified the vulnerable decoder through the attribute descriptor table, and reconstructed the dispatch chain linking the IMS entry point to that decoder. The firmware was then executed under a full-system emulator, the affected session registered in the modem's own lookup structures, and the parse driven from the real entry function. The overflow was observed directly in heap memory.

This article documents the method and the evidence, and is explicit about the boundary: the work establishes corruption of allocator-adjacent memory. It does not establish control-flow hijack.

Identifier
CVE-2023-24033
Component
IMSPL SDP parser, Shannon baseband
Class
Heap buffer overflow, off-by-one slot
Vector
IMS signalling, network adjacent
Affected silicon
Exynos Modem 5123 / 5300 and related
Fixed
Android bulletin 2023-03-01
Figure 1How the message arrives, and what it reaches
1 — THE MESSAGE IS DELIVERED ROGUE BASE STATION attacker controls the signal path no app, no prompt, no SIM SIP SMARTPHONE APPLICATION PROCESSOR Android not in the path sees nothing no permission consulted BASEBAND Exynos 5123 parses the message because that is its job the target decoded inside the modem 2 — THE PARSER WALKS THE TEXT SIP message INVITE Content-Type: sdp arrives over IMS SDP attribute a=accept-types: x/y × 11 eleven entries dispatch name → index index 32 table 0x4013ab1c decoder loops over entries no bound check writes past 10 3 — THE WRITE LEAVES THE ALLOCATION record — 120 bytes — slots 0 … 9 slot 10 not owned by the allocation The parser owned the first 120 bytes. The eleventh entry writes 12 bytes beyond them. Those bytes belong to whatever sits next in the heap. We did not map that structure. Nothing is checked. Nothing faults. The modem keeps running.
Figure 1. The delivery path and the code path in one view. An attacker who can place signalling on the IMS path — by operating a rogue base station, or by controlling a peer in the IMS domain — sends a SIP request whose SDP carries an accept-types attribute with eleven entries. The application processor is not involved at any point: the message is decoded by the baseband and handed straight to the attribute decoder, which writes twelve bytes past its own allocation.

01Why modems still matter

A modern handset contains two independent computers. The application processor runs the operating system you interact with, with its sandboxing, permission prompts and verified boot. The baseband is a separate system-on-chip with its own processor, its own memory and its own real-time operating system. It owns the radio, terminates the cellular protocols, and on current devices also hosts the IMS stack that carries voice and messaging over IP.

Code executing in the baseband sits outside the application processor's isolation boundary. No app permission applies to it, no sandbox covers it, and the device's userspace cannot audit it. It also processes attacker-supplied bytes by design, because parsing network messages is what it is for.

Figure 2Two processors, one device
DEVICE APPLICATION PROCESSOR Android sandbox, permissions, verified boot the threat model you know isolated from the radio BASEBAND Shannon Exynos 5123 own CPU, own RTOS, own heap RF, NAS, RRC, IMS / SIP / SDP parses untrusted input by design IPC A message arriving over the radio is parsed inside the baseband. The application processor is not in the path and cannot observe it. No application permission is consulted. No user prompt is raised.
Figure 2. The baseband sits outside the application processor's isolation boundary, which is why a parser defect there is not mitigated by any Android control.

The baseband firmware stack is layered. Radio symbols are decoded at the bottom; frame, radio-resource and mobility protocols sit above; IP carries signalling; and at the top, IMS runs SIP with SDP inside it. Each layer strips its own framing and passes the remainder upward. Reaching the IMS parser therefore requires the message to traverse every lower layer successfully, which constrains the realistic attacker model to someone positioned on the signalling path.

Figure 3Protocol stack, defect at the top
PHY / RF radio symbols MAC / RLC framing, retransmission RRC / NAS connection, registration, mobility IP packets SIP signalling envelope, plain text IMS — SIP / SDP PARSER the SDP attribute decoder lives here Each layer removes its own header and hands the payload upward.
Figure 3. The defect sits at the top of the stack. An attacker must already be able to place a SIP message on the IMS path; this is not reachable from an arbitrary internet host.

02IMS and SIP, in plain terms

Everything in this article passes through two things with unhelpful names. SIP carries the messages. IMS is the operator network built to route them. If you have made a call on a phone released in the last decade, both were involved, whether or not the call touched the old circuit-switched network.

SIP is signalling, and it looks like HTTP

SIP is a text protocol. A request has a method, a URI, headers, a blank line, and an optional body. The methods that matter for a call are INVITE to start a session, ACK to confirm the final response, BYE to end it, and REGISTER to tell the network where you are. Replies are three-digit codes: 180 means the phone is ringing, 200 means yes.

No audio travels in SIP. A session is negotiated first. The caller sends an INVITE whose body describes what it can receive, the callee answers with its own description, and both sides then open a separate stream in a format they agreed on. That body is SDP, the Session Description Protocol, and it is where this article's defect lives.

IMS is the network that carries it

IMS, the IP Multimedia Subsystem, is the operator-side architecture that makes SIP work at telephone scale. It is neither a protocol nor a single server. The phone registers once with a serving node, and from then on its requests are routed through a small set of call-session control functions to an application server implementing whichever service is in use: telephony, messaging, or chat.

Figure 4Where a VoLTE call actually goes
Phone IMS stack in the modem Radio LTE or 5G Mobile core EPC or 5GC SIP core CSCF proxies Service MMTel, RCS the SDP parser sits here Signalling only. The audio travels separately as RTP between the two phones. Nothing is stored: a session exists only while it is being used.
Figure 4. The signalling chain for a call. Every hop is text handling; the defect discussed here is in the first box, before the network is even reached.

What this looks like on an ordinary day

A VoLTE call is SIP with an SDP body, and it is the default on most networks now. Wi-Fi calling is the same stack over a different access network. SMS over IMS replaces the old signalling-channel text message with a SIP MESSAGE. RCS uses the same registration and adds chat and file transfer. All of it sits in the baseband rather than in Android because the operator needs the phone reachable and authenticated even when the application processor is asleep.

Figure 5One SIP message, and the exchange around it
SIP MESSAGE INVITE sip:bob@example.net SIP/2.0 From: <sip:alice@example.net> To: <sip:bob@example.net> Content-Type: application/sdp SDP body v=0 m=audio 49170 RTP/AVP 97 a=accept-types: audio/amr audio/evs The parser is aimed at the a= line: a space-separated list with no stated maximum. Normal traffic carries a few entries. The protocol does not bound the count. caller callee INVITE + offer 180 Ringing 200 OK + answer ACK RTP audio BYE
Figure 5. The left side is one real message shape; the right side is the six exchanges that make a call. The defect lives in the body on the left, which is why an attacker only needs to reach the first message.

Why an SDP parser has a list in it at all

Codecs are negotiated by name, and the names live in a= lines. The accept-types attribute is a space-separated list of media types the sender is willing to accept. In normal traffic it is short, because a phone supports a handful of codecs. Nothing in the protocol says how long the list may be, and the receiver allocates for the number it expects before reading whatever arrives.

That sentence is the vulnerability in miniature. The next section is the general shape of it; the rest of the article is this particular instance.

03How memory bugs become compromises

Before the firmware, the mechanism. Almost every serious memory vulnerability follows the same four-step path, and most of them never get past the second step.

  1. The bug. A write lands at an address the program did not intend to touch. So far, nothing has happened beyond that write.
  2. Corruption. The bytes at that address belonged to something else: a neighbouring object, a length, a pointer, or the allocator's own bookkeeping.
  3. A primitive. The corruption is arranged so it can be repeated usefully, ideally becoming a read or write at an address the attacker chooses.
  4. Control. The primitive overwrites a function pointer, a return address or a dispatch entry, and execution goes where the attacker wants.

Most of the work sits between step two and step four. It is also why a heap-overflow headline and a working exploit can be months apart.

The processor does not know what an array is

A processor has registers and an address space. It does not know that ten twelve-byte structures live at some address and that an eleventh is illegal. It knows one instruction: store these bytes at this address. Every bound in a program is there because a person wrote a check.

malloc returns a pointer to a block and records how large it is. Nothing inside the block knows where it ends. So when a loop writes to base + index * 12 without comparing index against ten, the eleventh write is not an error the machine can detect. It is an ordinary store into memory that belongs to something else.

The allocator is a locker room

A heap allocator hands out blocks and keeps a ledger so it can take them back later. That ledger lives in the same writable memory as everything else. Free space between blocks is often filled with a known pattern so failures are easier to diagnose; in this firmware the byte is 0xAA.

That is why overflowing into the ledger matters. If the record of what is allocated and what is free can be altered, the allocator's next decision is compromised, and the allocator is a trusted internal component. A corrupted ledger can make the following allocation return an address the attacker chose.

Three shapes of the same class

ShapeWhat failsAttacker controls
Unbounded copya strcpy-style copy into a fixed bufferthe length
Undersized allocationinteger arithmetic yields a smaller size than the copythe arithmetic
Missing bound on a fixed arraythe capacity exists, but one loop never checks itthe count

This defect is the third shape: an out-of-bounds write (CWE-787) on the heap (CWE-122). That shape is the one that survives review, because the allocation is right, the arithmetic is right, and a bound check really does exist in the function — in a different loop. A reviewer finds the check and stops looking.

04The target

The original intent was a Pixel 7, whose Exynos 5300 modem was disassembled and fitted with a single-function harness. Full-system emulation was the requirement, and the public emulator does not model that part: its memory map is not a static table in the image, and the enable path points the MMU at an address no loadable section covers. Pacing that work honestly put it at weeks with a real chance of stalling.

The Pixel 6 carries the Exynos 5123, which is modelled, and which runs the same vendor IMS codebase with the same parser and the same defect. It is the target used for everything that follows.

AttributeValue
DeviceGoogle Pixel 6 (oriole)
SoCGoogle Tensor GS101
ModemSamsung Exynos Modem 5123 (Shannon)
CoreCortex-A, ARM32, Thumb, MMU
Firmware buildg5123b-90933-210902-B-7697269
Image size108,755,648 bytes (TOC container)
Code sectionMAIN at 0x40010000
DecoderIMSPL_SdpParser_DecodeAtrb_AcceptTypes @ 0x42765ee4

05Acquiring the image

Modem firmware is not distributed as a modem binary. It is nested inside the factory image: an archive containing a partition image in a vendor container, which holds a filesystem, which holds a compressed copy of the modem container. Each layer is a distinct format and each has to be parsed correctly before the next becomes visible.

The inner container begins with the ASCII magic TOC and is followed by a table of sections with their file offsets, load addresses and sizes. That table is the only reason any of the later address arithmetic is possible.

Container headertoc
00000000  54 4f 43 00 00 00 00 00 00 00 00 00 00 00 00   TOC.............
00000010  00 00 00 00 20 03 00 00 00 00 00 00 07 00 00 00   .... ...........
00000020  42 4f 4f 54 00 00 00 00 00 00 00 00 20 03 00 00   BOOT........ ...
00000030  00 00 00 00 b0 fe 00 00 48 3b 63 19 01 00 00 00   ........H;c.....

Resolving the table yields the layout below. The translation between a file offset and an address is linear within a section, and it is worth writing down once: every subsequent address in this article is an address, not an offset.

SectionFile offsetLoad addressSize
BOOT0x000003200x000000000x0000feb0
MAIN0x000101e00x400100000x06321c80
VSS0x06331e600x4f9000000x0047e620
APM0x067b04800x000100000x00007620

For MAIN the mapping is addr = 0x40010000 + (offset - 0x101e0).

06Locating the parser

Nobody reads 108 MB of machine code linearly. The productive approach is to start from a string and move outward, because vendor builds habitually retain source paths and log format strings. Searching the image for the ASCII sequence accept-types returns a single hit, and it lands inside a data structure rather than inside a message string. That is the luck: a message string would have told us nothing.

String searchoverview
$ grep -abo "accept-types" modem.bin
1290876:accept-types          # offset 0x13b27c -> address 0x4013b09c

$ grep -abo "SDPPARSER" modem.bin
14512995:SDPPARSER/Code/src/IMSPL_SdpParser_Attributes.c
14514274:SDPPARSER/Code/src/IMSPL_SdpParser_Entry.c
14514368:SDPPARSER/Code/src/IMSPL_SdpParser_Utility.c

Those source paths name the subsystem, IMSPL SdpParser, and they appear because the code passes them to its own logging macros. That gives a reliable runtime signal: when the firmware later prints IMSPL_SdpParser_Attributes.c, we are inside the code we set out to find, without having to infer it.

Method

Strings identify subsystems. Tables identify handlers. Function pointers inside those tables identify the code. Each step yields a concrete address that can be verified independently, which is what keeps the chain from drifting into guesswork.

07The descriptor table

The SDP parser is generic: it does not know what any particular attribute means. It carries a table with one row per attribute, and each row names the function responsible for that attribute. This is a dispatch table, and it is the standard way protocol implementations avoid a thousand-way branch.

Each row is 44 bytes. The first sixteen hold the attribute name inline, followed by a length, a small integer the code calls a class, and three function pointers: decode, encode, and free. Decode is the one that consumes network input.

Figure 6Row layout and the target entry
ONE ROW — 44 BYTES +0x00 name[16] +0x1e class +0x20 decode +0x24 encode +0x28 free TABLE AT 0x4013ab1c — STRIDE 0x2c [00] rtpmap 0x4276be21 [01] fmtp 0x4276878d … [30] path 0x4276b251 [31] setup 0x4276bfe5 [32] accept-types decode = 0x42765ee5 class 0x0c entry = 0x4013ab1c + (index × 0x2c) index 32 → 0x4013b09c → decode 0x42765ee5
Figure 6. The low bit of the decode pointer is set, which marks Thumb code. The actual entry point is 0x42765ee4.

Index 32 is accept-types, with class 0x0c and decode 0x42765ee5. Clearing the Thumb bit gives the function we need to read: IMSPL_SdpParser_DecodeAtrb_AcceptTypes at 0x42765ee4.

08Anatomy of the decoder

The decoder takes a value string, its length, and an output slot. Its first substantive act is a heap allocation of 0x78 bytes, which is 120. That number is not arbitrary: the routine intends to hold at most ten entries, and each entry occupies twelve bytes.

Each slot is three fields: a one-byte present flag, a four-byte pointer to a copy of the entry, and a four-byte length. The entry text itself is allocated separately, which is why a three-entry value produces four allocations rather than one.

The routine then splits the value on the space character and, for each piece, writes one slot. Because the block is only 120 bytes, ten entries consume the allocation exactly.

09The defect

The loop increments a slot index after every entry and stores at record + index × 12. There is no comparison between the index and ten anywhere on that path. The only branch at the bottom of the loop tests the result of the delimiter scan, so the loop terminates when the text is exhausted — not when the array is full.

A value containing eleven entries therefore performs an eleventh write: slot index 10, at record + 0x78, the first byte past the allocation. Twelve bytes of attacker-influenced data land outside the block the function owns.

Interactive — slot buffer overflow
past the allocation — record + 0x78

The code allocated for ten; that much is not in doubt. The failure is that the limit exists as an allocation size and as a later loop bound, but not as a check in the loop that actually writes.

Why this is easy to miss in review

A bounds check does exist in this function. It appears in a subsequent cleanup loop that walks the array to mark unused slots, and it reads cmp #9. A reviewer scanning for the guard finds one, concludes the function is defended, and moves on. The guard is real; it is in the wrong loop. Checks have to be evaluated by position, not by presence.

10Reachability

Demonstrating that a function is broken is not the same as demonstrating that input reaches it. The path from an SDP line to this decoder runs through six layers, each with a defined responsibility.

Figure 7Dispatch chain
IMSSH_SC_ProcessSdpReq_RCS 0x428690fc — IMS entry point SDP body parser 0x42d04e6c — walks v= o= m= a= a= line walker 0x42d05d80 — locates line end attribute dispatcher 0x4276558a — splits on colon name to index 0x4277183c — scans table DecodeAtrb_AcceptTypes 0x42765ee4 — the overflow session must resolve first sessid → appid → ctxid plain text, no binary decoding "a=" recognised at line start CRLF aware the attribute name selects the handler value is everything after the colon index 32 for accept-types 50 if no match eleventh entry writes past slot 9 lands on record + 0x78 The dispatcher is the pivot: a name becomes an index, an index becomes a function pointer.
Figure 7. Entering through the IMS function rather than calling the decoder directly is what turns "this function is broken" into "this function is reachable from signalling input".

This is confirmed at runtime by the firmware's own logging. During the reproduction the modem printed IMSPL_SdpParser_Attribute_Decoder, then findAtrbType 32, then DecodeAtrb_AcceptTypes. That is not our interpretation of the call graph; it is the vendor code reporting its own dispatch.

11The session gate

The IMS entry point does not parse SDP unconditionally. It first resolves the message's session identifier to an application identifier, and that application identifier to a context. Both lookups read global tables. If either fails, the function logs an error and returns without parsing.

Entering with an unregistered session produced exactly that refusal (NO Matching APPID Found, ContextId not found, Invalid ContextId Found), which was itself useful, because it confirmed the call was landing in the real entry point rather than a copy.

Figure 8Two global lookups
input sessid session table 0x487a3000 [sessid] → object index = sessid x4 object +0x02 = appid context list 0x487a37d4 +0x00 appid +0x02 ctxid +0x59c next context valid parse proceeds Both lookups must succeed, or parsing does not begin. Registering a session in these two structures is what opens the path. This is bookkeeping, not an access-control boundary — it maps message to context.
Figure 8. The gate is a lookup, not an authorisation check. It exists so the parser knows which session a message belongs to.

12Reproduction

Static reading establishes what the code can do; execution establishes what it does. The firmware was run under FirmWire, a full-system emulator for baseband images. Upstream supports Cortex-R parts only, so a fork adding Cortex-A support, MMU parsing and the peripheral set for this SoC was used. The firmware image itself is unmodified.

The intended invocation path — inject a task into the firmware's own scheduler and have it run — was built and does not work on this image: the task appears in the task list but accumulates zero executed basic blocks in coverage. The working approach is the technique a debugger's call command uses. Stop the CPU at a frequently executed function, write the payload and supporting structures into writable memory, set the argument registers, point the program counter at the target, and set the link register to a known return address so execution can be recovered afterwards.

Register state at the jumparm32
; stop at pal_RegItemWrite (0x42bfc0e4), then:
r0  = argument        ; descriptor or value pointer
r1  = length
r2  = out pointer     ; third argument where required
lr  = 0x40020acd      ; BXLR — return lands on a known instruction
pc  = target          ; real firmware function
cpsr.T = 1              ; Thumb state

The harness exposes five entry points, each proving one more link in the chain. The last one enters at the genuine IMS function with a session registered in the modem's own tables.

ModeEntryWhat it establishes
attr0x42765ee4the decoder alone overflows
body0x42d04e6creal SDP text is parsed and dispatched
sip0x428690fcreal IMS entry; rejects an unregistered session
sip20x4286915aparser path overflows once past the gate
sip30x428690fcreal entry with a valid session produces the overflow

What follows is the decode replaying. The console lines are the firmware's own, captured from a recorded run and replayed in order; the slot panel beside them is driven by the same event sequence. Watch the count.

Recorded run — sip3
slot buffer — 0x78 bytes
idle
There is no crash

The modem does not fault. We tested up to forty entries - a 480-byte write beginning inside a 120-byte allocation - and the firmware continued running, because the overflow lands in mapped heap space rather than unmapped memory. Nothing about the corruption announces itself. That is precisely what makes this class of defect dangerous: it must be detected by inspection, not by watching for a crash.

13Results

After the parse, the array begins at 0x50518a20. Nine in-bounds slots hold a present flag, a pointer to the entry copy and a length of three. Slot 10 begins exactly at record + 0x78.

Heap around the arrayhex
50518a10  00 00 00 00 00 01 00 00 10 00 00 00 aa aa aa aa
50518a20  01 00 00 00 20 82 51 50 03 00 00 00 01 00 00 00   slot 0
50518a30  60 82 51 50 03 00 00 00 01 00 00 00 a0 82 51 50
50518a40  03 00 00 00 01 00 00 00 e0 82 51 50 03 00 00 00
50518a50  01 00 00 00 20 83 51 50 03 00 00 00 01 00 00 00
50518a60  60 83 51 50 03 00 00 00 01 00 00 00 a0 83 51 50
50518a70  03 00 00 00 01 00 00 00 e0 83 51 50 03 00 00 00
50518a80  01 00 00 00 20 84 51 50 03 00 00 00 01 00 00 00
50518a90  60 84 51 50 03 00 00 00 01 aa aa aa a0 84 51 50 03 aa aa aa
50518aa0  03 aa aa aa aa aa aa aa
SlotAddressPresentPointerLength
00x50518a20010x5051822003
80x50518a80010x5051842003
90x50518a8c010x5051846003
100x50518a98010x505184a003

The aa bytes surrounding the slot-10 entry are the allocator's free-space fill, untouched until this write. Their presence inside the written entry — between the present flag and the pointer, and after the length — is direct evidence that the write entered memory the allocation never owned. The array address is stable across runs.

We did not reverse the allocator's chunk header. Sixteen bytes precede the block and the free-space fill follows it, but what those bytes encode is not established here. The finding does not depend on that knowledge — the write leaves the block the function owns — so mapping the header is left open rather than guessed at.

14Exploitability: from corruption to control

The write is proven. What follows is what an attacker would need to do with it, and why none of it was attempted here.

What the primitive actually is

Three stores per entry: a byte 01 for the present flag, a word pointing at the copy of the entry, and a word holding its length. The write starts at a fixed offset from the block and repeats every twelve bytes for as many entries as the message carries.

So the attacker controls what is written and how far it runs, but not where it starts, and not what sits beside it. That last part is the real constraint: the target of the corruption is chosen by the allocator, not by the attacker.

Figure 9Three routes, and what each would need
THE PRIMITIVE THE ROUTE, AND WHAT IT NEEDS WHAT IT WOULD BUY out-of-bounds write 12 bytes, per entry we stopped here Corrupt allocator metadata needs the exact header layout the next allocation returns a chosen address Corrupt the neighbouring object needs to know what sits there its length, pointer or dispatch entry bends Corrupt a size field needs a block whose size it can reach overlapping blocks: two handles on one block None of these was attempted. Each needs a heap layout we did not map, grooming that survives the parser's allocations, plus a target worth corrupting.
Figure 9. Three known routes from a heap write to execution, drawn as routes rather than results. The dashed box marks the boundary of this work: the write is observed, the chain is not.

Three ways an overflow like this becomes control

The ledger route has a classic form: a free-list unlink, where the allocator follows a corrupted next-pointer and performs the attacker's write while it thinks it is tidying up. Bending a neighbour is cheaper because it needs no allocator knowledge, but it depends on what the allocator happened to place after the array. Overlap is the strongest of the three, because two pointers into one block turn a narrow write into a second, independent handle on the same memory.

Why grooming comes first

None of those routes works by chance. The attacker needs a chosen object sitting immediately after the array, which means shaping the heap before the message arrives: allocating known sizes, freeing some, and letting the allocator's placement rules line the pieces up. That discipline is called heap grooming, and it is why heap bugs are described as probabilistic rather than deterministic.

What this firmware does, and does not, do about it

Stack canaries are present. Nearly every function we read loads a value from DAT_4458afcc on entry and compares it before returning, which defends stack overflows and does nothing here. Heap hardening we could not establish: no heap cookies or integrity checks on the allocation path, though we did not test for them exhaustively. The heap address was identical across emulation runs, which says nothing about a real device whose bootloader may or may not randomise.

The distance we did not cross

Everything above is mechanism, not result. A working chain needs the allocator's header layout, a grooming strategy that survives the parser's own allocations, a target object worth corrupting, and a way to survive the frees that follow. We have none of those and the article does not claim them. What is established is narrower and still serious: a legal network message causes a write outside a heap allocation inside the modem.

15Impact, honestly

The primitive is a write of one twelve-byte slot entry, starting at a fixed offset just past a 120-byte allocation, with partial control over three of those bytes: the pointer field can be made to reference an attacker-supplied copy of an entry, and the length field derives from that entry's length. It repeats once per additional entry, so the reach scales with the input. At forty entries the write extends roughly 360 bytes past the block. That is meaningfully more than a single-byte overwrite, but it does not by itself give control of execution.

Turning it into control requires influence over heap layout: placing a chosen object immediately after the array so that the overflow lands on something whose corruption is useful, then surviving the allocations and frees that follow. That is a separate body of work with its own failure modes, and it is not attempted here.

What this work establishes

The real, unmodified firmware boots under emulation; the real IMS entry point accepts a registered session; the real SDP parser dispatches to the real decoder; and that decoder writes past its own allocation. The reproduction is deterministic.

What it does not establish

No live SIP message traversed the network stack. The descriptor and SDP body are constructed in memory. No heap grooming was performed. No control-flow hijack was attempted. The target is the Exynos 5123, not the 5300. The session registration is experiment scaffolding and is not a firmware modification.

16Remediation

The defect was addressed by Samsung and distributed through the Android security bulletin dated 2023-03-01. Devices at or above that patch level are not affected; the build examined here predates it.

Three changes would each have prevented this, and none of them is exotic. Enforce the slot limit in the loop that writes, and derive both the allocation size and that bound from one constant. Reject the whole attribute when the entry count exceeds the maximum instead of truncating silently. Treat any count that appears in both an allocation and a loop as something to check at every write site, since the check in the cleanup loop is what made this look safe.

2021-09-02
Firmware build date for the image examined.
2023-03-01
Android security bulletin lists the modem RCE fix for CVE-2023-24033.
2026-08-12
Independent reproduction under full-system emulation, documented here.

17References

  1. Android Security Bulletin, March 2023. The public record for CVE-2023-24033. source.android.com/docs/security/bulletin/2023-03-01
  2. NVD entry for CVE-2023-24033, including the CNA description and both CVSS scores. nvd.nist.gov/vuln/detail/CVE-2023-24033
  3. Hernandez, Muench, Maier, Milburn, Park, Scharnowski, Tucker, Traynor and Butler. FirmWire: Transparent Dynamic Analysis for Cellular Baseband Firmware. NDSS 2022. github.com/FirmWire/FirmWire
  4. The Cortex-A fork of FirmWire used for this work, on the loris branch. github.com/SyNSec-den/FirmWire
  5. ShannonLoader, a Ghidra extension that parses the Shannon TOC container. github.com/grant-h/ShannonLoader
  6. ShannonFirmware, the public image collection the g5123b image came from. github.com/grant-h/ShannonFirmware
  7. RFC 4566, SDP: Session Description Protocol. rfc-editor.org/rfc/rfc4566
  8. RFC 4975, The Message Session Relay Protocol, which defines the accept-types attribute. rfc-editor.org/rfc/rfc4975
  9. 3GPP TS 24.229, IP multimedia call control protocol based on SIP and SDP. 3gpp.org/ftp/Specs/archive/24_series/24.229
  10. CWE-787: Out-of-bounds Write. cwe.mitre.org/data/definitions/787.html
  11. CWE-122: Heap-based Buffer Overflow. cwe.mitre.org/data/definitions/122.html

NVD and the CNA disagree on scope, and a reader will notice. NVD scores CVE-2023-24033 at 9.8 with confidentiality, integrity and availability all high, while the CNA description says the flaw can lead to denial of service and scores it 7.5 with availability only. This article takes no position between them: it establishes the write, and states plainly that it did not establish control of execution. The CWE labels used earlier are a technical description of the defect observed here; NVD records no specific CWE for the CVE, and CISA lists CWE-20.

Appendix: addresses used

SymbolAddressRole
accept-types (descriptor)0x4013b09ctable row, index 32
descriptor table base0x4013ab1cstride 0x2c
name → index0x4277183cscans up to 0x30 entries
attribute dispatcher0x4276558asplits on colon, calls decode
DecodeAtrb_AcceptTypes0x42765ee4the overflow
SDP body parser0x42d04e6cline walker
IMSSH_SC_ProcessSdpReq_RCS0x428690fcIMS entry point
session table0x487a3000sessid → object
context list head0x487a37d4appid → ctxid
All addresses were recovered from the firmware image g5123b-90933-210902-B-7697269. The firmware was not modified. Experiment logic — payload construction, structure placement, and the register-level invocation — lives entirely in an external driver script.