Skip to content
Platform
android
MASVS v1 MSTG-CODE-8
MASVS v2 MASVS-CODE-4
Last updated: May 08, 2023

Memory Corruption Bugs

Overview

Static Analysis

There are various items to look for:

  • Are there native code parts? If so: check for the given issues in the general memory corruption section. Native code can easily be spotted given JNI-wrappers, .CPP/.H/.C files, NDK or other native frameworks.
  • Is there Java code or Kotlin code? Look for Serialization/deserialization issues, such as described in A brief history of Android deserialization vulnerabilities.

Note that there can be Memory leaks in Java/Kotlin code as well. Look for various items, such as: BroadcastReceivers which are not unregistered, static references to Activity or View classes, Singleton classes that have references to Context, Inner Class references, Anonymous Class references, AsyncTask references, Handler references, Threading done wrong, TimerTask references. For more details, please check:

Dynamic Analysis

There are various steps to take:

Resources