iOS Sensitive Data in Logs
Overview
iOS device logs (accessible via Xcode Console, idevicesyslog, and Crash Reports) can be read by:
- Developers with physical device access
- Malicious apps with log access entitlements
- Anyone who can read the device logs via iTunes backup
Logging passwords, tokens, PII, or financial data is a compliance violation.
Remediation
- Remove all NSLog/print calls in production builds using macros
- Use
os_logwith%{private}format specifier for sensitive data - Build with
DEBUGflag guard:#if DEBUG ... NSLog(...) ... #endif