Crash logs exclude sensitive user data
Why it matters
Crash reporting SDKs by default capture the full application state at the time of a crash — including Redux stores, navigation state, and any API response bodies that were in memory. If your Redux state holds an auth token or your last API response includes user PII, that data ships to Sentry, Crashlytics, or Bugsnag's servers without any user consent or awareness. GDPR Art. 32 requires appropriate technical measures to protect personal data during processing — sending PII to a third-party crash analytics service without scrubbing is a data transfer that must be disclosed and minimized. CWE-532 (Insertion of Sensitive Information Into Log File) applies directly. OWASP A09 (Security Logging and Monitoring Failures) includes over-logging as a failure mode.
Severity rationale
Medium because PII in crash logs requires authenticated access to the crash analytics dashboard to exploit, but represents a GDPR Art. 32 violation and creates data processor obligations with the crash reporting vendor.
Remediation
Configure a beforeSend hook (Sentry) or equivalent to strip sensitive fields before logs leave the device. Scrub auth tokens, user IDs, and API response bodies that contain PII.
import * as Sentry from '@sentry/react-native'
Sentry.init({
dsn: process.env.SENTRY_DSN,
beforeSend(event) {
// Strip auth tokens from Redux state snapshot
if (event.contexts?.['redux state']) {
const state = event.contexts['redux state'] as Record<string, unknown>
if (state.auth) {
state.auth = { authenticated: !!(state.auth as Record<string, unknown>).token }
}
}
// Redact PII from request/response bodies
if (event.request?.data) {
const data = event.request.data as Record<string, unknown>
if (data.email) data.email = '[REDACTED]'
if (data.phone) data.phone = '[REDACTED]'
}
return event
},
})
For Firebase Crashlytics, use crashlytics().setAttribute() with only non-identifying session metadata — never log full user objects or API responses as custom keys.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Mobile Permissions & Privacy Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-532 — Insertion of Sensitive Information into Log File
- gdpr · Art. 32 — Security of processing
- owasp:2021 · A09 — Security Logging and Monitoring Failures
Taxons
History
- 2026-04-18·v1.0.0·Initial import from mobile-permissions-privacy·automated