T09 · Insecure Skill Coding Practices
- Location
SKILL.md:431- Finding
User Identifier Exposed Through Application Logging
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 431-434
Vulnerability Type: Sensitive information written to application logs
Risk Level: MediumVulnerable Code
kotlin import android.util.Log // Info: Key checkpoints in normal flow Log.i(TAG, "loadData: started, userId = $userId")Technical Analysis
The Skill recommends including a user identifier in an informational Logcat message. User identifiers can constitute personal or linkable information and should not be recorded unless logging them is strictly necessary, appropriately protected, and subject to a defined retention policy.
This recommendation directly conflicts with
references/privacy-security.md, which states that PII and credentials must never be logged. Informational logs may remain enabled in production and can be copied into debugging output, automated telemetry, crash reports, support bundles, or device logs. Access conditions vary by Android version and application configuration, but debuggable builds, rooted devices, development tools, privileged applications, and integrated log collectors can expose the value.The issue is an insecure coding recommendation rather than a network exfiltration implementation. The audited code does not itself upload the identifier.
Attack Path
- A developer or coding agent follows the logging example when implementing an Android application.
- The resulting application records the current
userIdwheneverloadDatastarts. - The log statement remains active in a development, testing, or production build.
- An actor with access to Logcat, a debugging session, a diagnostic archive, a support bundle, or an integrated log collection service retrieves the entry.
- The actor correlates the identifier with application activity, other logged events, or external account information.
This path does not grant system privileges or arbitrary code execution. Exploitation requires ...[truncated 707 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove the user identifier from the example:
kotlin Log.i(TAG, "loadData: started") -
If event correlation is operationally necessary, use a short-lived, non-user-derived request identifier rather than an account identifier.
-
Avoid presenting hashing alone as anonymization. Stable hashes can still permit cross-event correlation and may be reversible through enumeration when the identifier space is predictable.
-
Restrict diagnostic logging to debug builds:
kotlin if (BuildConfig.DEBUG) { Log.d(TAG, "loadData: started") } -
Configure release optimization rules or a structured logging abstraction to remove verbose and informational logs from production builds.
-
Add an explicit rule to the main logging section prohibiting passwords, tokens, email addresses, account identifiers, device identifiers, and other PII.
-
Review telemetry, crash-reporting, and support-bundle integrations to ensure sensitive values are redacted before collection, transmission, or retention.
-
Add static-analysis checks or lint rules that detect sensitive variable names and values passed to Android logging APIs.
-
