Sensitive Data in Device Logs

The app writes sensitive data such as tokens, credentials or personal information to the device's system log, where it can be read outside the app.

SeverityMedium
CVSS 3.14.6 CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N Open in the calculator
CVSS 4.05.1 CVSS:4.0/AV:P/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-532: Insertion of Sensitive Information into Log File
OWASP Top 10A09:2025 Security Logging and Alerting Failures
CategoryInformation Disclosure

Description

The application writes sensitive information, such as passwords, session tokens, API responses containing personal data, or cryptographic material, to the platform's logging facilities: Android's Log class and System.out, which appear in logcat, or iOS's NSLog and the unified logging system. Logging statements added during development are often left in release builds, and third-party libraries can log network traffic in detail when verbose logging is enabled.

Since Android 4.1, ordinary apps cannot read other apps' log entries, but logs remain readable over ADB and in bug reports, and on iOS through the Console app or a sysdiagnose from a connected device. Crash reporting and analytics services may also collect log output and send it to third parties. Anyone who can read the logs, such as a person with access to an unlocked device with USB debugging enabled, support staff collecting bug reports, or a third-party analytics service, can obtain the logged data: logged tokens and credentials allow the user's account to be taken over, and logged personal data creates a data protection exposure. The need for access to the device or to collected reports limits the likelihood.

Testing exercises the app's features, particularly login, payment and profile functions, while monitoring adb logcat or the macOS Console, and reviews the code for logging calls that include sensitive variables.

Remediation

  • Remove logging of sensitive data from the code, and avoid logging full requests, responses or objects that may contain it.
  • Route logging through a wrapper that is disabled in release builds, and on Android strip logging calls from release builds with an R8 or ProGuard -assumenosideeffects rule for android.util.Log.
  • On iOS, use the unified logging system (Logger or os_log), which treats interpolated strings and objects as private by default, and do not mark sensitive values as public.
  • Disable verbose logging in third-party networking and SDK libraries in release builds, and review what crash reporting services collect.
-assumenosideeffects class android.util.Log { public static int v(...); public static int d(...); public static int i(...); }

Confirm the fix by repeating the monitored test against a release build and checking that no sensitive values appear in the logs.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Mobile Applications Findings

Every Mobile Applications finding