A memory exhaustion vulnerability has been identified in Instagram for Android (versions ≤ 370.1.0.43.96), which leads to application termination due to improper handling of malformed drawable resources in end-to-end encrypted (E2EE) group chats. When a user attempts to 'like' a message referencing a non-existent or corrupted drawable resource, the application enters an infinite retry allocation state, ultimately causing an OutOfMemoryError (OOM) and resulting in a forced crash.
Denial-of-Service (DoS) via Heap Exhaustion triggered by improper drawable resource handling.
Instagram's Android application fails to properly handle corrupted or missing drawable resources, leading to repeated allocation attempts that rapidly exhaust heap memory.
- Malformed drawable resource is referenced (e.g., ID:
0x7f0802d7). - Android attempts repeated allocations, unable to locate the resource.
- Garbage collection cycles fail to free sufficient heap space.
- App crashes due to
java.lang.OutOfMemoryError. - User interface thread stalls, triggering an ANR (Application Not Responding).
- Instagram is forcibly terminated by the OS after ~10 seconds.
- Create an E2EE Group Chat
- Start a group chat on Instagram with end-to-end encryption enabled.
- Exchange Messages
- Participants send text and voice messages in the chat.
- Trigger the Exploit
- A participant attempts to 'like' a message or tries to type extensively and or interact with other senders message
- Observe the Impact
- Instagram crashes on all devices that render the affected message.
- Instagram for Android ≤ 370.1.0.43.96.
- Device running Android OS.
- E2EE-enabled group chat.
- Severity: High (Denial-of-Service for all affected group participants).
- Scope: Any user who views or interacts with the malformed message experiences repeated app crashes.
The application (com.instagram.android) crashes due to an OutOfMemoryError:
java.lang.OutOfMemoryError: Failed to allocate a 83070912 byte allocation with 2719552 free bytes and 2655KB until OOM, target footprint 536870912, growth limit 536870912
Crash Occurrence:
03-10 15:49:18.549 PID:7226 Thread:SWPool3_t1of1
The failure occurs due to excessive memory allocation within Instagram’s internal class structures:
at java.util.Arrays.copyOf(Arrays.java:3553)
at java.util.ArrayList.grow(ArrayList.java:244)
at java.util.ArrayList.add(ArrayList.java:461)
at X.057T.<init>(:13)
at X.0NrL.E4V(:8)
at X.0Jqg.run(:8)
Using adb_memory_monitor.py, the following memory pattern was observed before the crash:
| Timestamp | Java Heap (MB) | Native Heap (MB) | Total PSS (MB) |
|---|---|---|---|
| 15:48:06 | 26.38 | 31.16 | 189.52 |
| 15:48:10 | 23.69 | 30.79 | 188.17 |
| 15:48:16 | 49.21 | 74.66 | 307.69 |
| 15:48:25 | 55.42 | 133.26 | 543.30 |
| 15:48:34 | 87.61 | 107.73 | 576.12 |
| 15:48:37 | 313.38 | 114.01 | 831.76 |
| 15:48:45 | 510.41 | 170.91 | 1118.22 |
| 15:48:49 | 527.47 | 160.32 | 1133.10 |
| 15:49:13 | 527.22 | 95.01 | 1077.53 |
| 15:49:19 | 527.23 | 96.95 | 1079.59 |
| 15:49:25 | Crash Occurs | Application Terminates |
Instagram.Eating.Heap.proof.2.mp4
Resources$NotFoundExceptionoccurs multiple times for missing drawable assets (instagram_arrow_left_outline_24,tab_direct_drawable,instagram_heart_outline_24, etc.).- ANR Incidents observed for Instagram's
ModalActivityand input method failures (com.samsung.android.honeyboard).
-
Video Proof of Concept: (Memory exhaustion and forced app crash)
- (Impact on Galaxy A52 group participant 1)
Screen_Recording_20250310_141504_Instagram.mp4
- (Impact on S22U 12Gb ram, group participant 2)
Screen_Recording_20250310_150848_Instagram.mp4
- (Impact on group participant 3 Infinix Note 40 Pro+ 12gb ram.)
Participants.Crash.Proof.mp4
- Robust Resource Validation: Ensure drawable resources are verified and available before rendering.
- Graceful Exception Handling: Catch and handle
ResourceNotFoundExceptionerrors without triggering repeated allocation attempts. - Isolated Execution Environment: Process drawable inflation in sandboxed threads with strict memory limits.
- Heap Protection: Implement memory allocation caps to prevent excessive memory consumption when handling missing resources.