Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› M9 Insecure Data Storage
Cyber Security

M9 Insecure Data Storage

← Back to Glossary
By NHI Mgmt Group Updated November 26, 2026 Domain: Cyber Security

M9 Insecure Data Storage is the ninth category in the OWASP Mobile Top 10 (2024), covering sensitive data left unprotected on a device, in logs, backups or shared storage. Attackers with physical access, malware or a rooted device extract tokens and personal data. Defenders avoid storing sensitive data, use platform secure storage and encryption, and review logs and backups.

What M9 Insecure Data Storage Means in Practice

M9 Insecure Data Storage is not just about “saving data locally.” It is about whether sensitive material on a mobile device remains protected if the handset is lost, inspected, rooted, compromised by malware, or backed up into places the app did not intend. The risk spans app files, caches, logs, databases, backups and any shared storage path that other apps or tools can reach.

For mobile teams, the key distinction is between data that must persist and data that should never be written to disk at all. Tokens, credentials, personal data and other sensitive values become much easier to extract once they leave memory and are written in a form that the platform cannot adequately protect. That is why this category is usually treated as a design issue as much as an implementation issue.

Common Storage Paths That Create Exposure

Insecure storage can appear in obvious places, such as plaintext files and unencrypted databases, but it often shows up in less visible paths too. Debug logs, crash reports, clipboard use, exported caches, temporary files and auto-backup features can all copy data into locations that outlive the session and are easier to inspect than the live app state.

Shared storage is especially risky because it weakens the boundary between the app and the rest of the device. If an app places sensitive content where another app, backup process or forensic tool can read it, the original access decision is lost. The same problem arises when developers assume a platform default is equivalent to secure storage, even when the data is still recoverable by device compromise or account sync.

How Defenders Reduce the Blast Radius

The first defensive question is whether the data needs to be stored at all. If the answer is no, the safest option is to avoid persistence and keep the value short-lived in memory only. If persistence is required, the data should move into platform-provided secure storage, with encryption and access controls that match the sensitivity of the value and the device model.

That principle is captured well in the Kotlin and Android Secure Coding Guide, which covers Android Keystore use, safe handling of app data, and related code-level controls. The broader Mobile App Security Guide ties those storage choices to MASVS-aligned mobile hardening, while the OWASP Mobile Top 10 M9 Insecure Data Storage Guide explains the main leak paths and platform-specific protections.

Testing, Detection and Review After Exposure

Because insecure storage is often a “silent” failure, teams need to test for it explicitly. Static review should look for hardcoded paths, unsafe logging, unguarded serialization, plaintext caches and backup settings that move data outside the intended trust boundary. Dynamic testing should confirm what actually lands on disk, in logs, in local backups and in shared areas after normal app use and error handling.

When a storage weakness is found, the question is not only whether the app leaks data now, but whether previously stored material is already recoverable. That means reviewing logs, backups and exported files for sensitive values that may need to be rotated or invalidated, especially where tokens or session material were written before the fix. Defensive logging and immutable off-host retention are also relevant when app traces or backend logs might reveal the same material, as discussed in the M1029 Remote Data Storage and T1070 Indicator Removal Defensive Guide.

Risk and Threat Considerations

Insecure local storage turns a mobile app into a durable evidence source for an attacker. Once tokens, personal data or other secrets are written to device storage, malware, a rooted environment, a physical examiner or a cloud backup may recover them long after the original session ended.

Failure mechanism: The app stores sensitive material in plaintext, weakly protected local files, logs, caches or backups, so an attacker can extract it without defeating the application runtime itself. Shared storage, permissive backup settings and poor log hygiene widen the exposure.

Impact: The usual consequences are account takeover, privacy loss, replay of stolen tokens, and longer-lived compromise if the same data can be used to impersonate the user or access linked services.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS, NIST SP 800-53 Rev 5 and CIS Controls v8 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.

FrameworkControl / ReferenceRelevance
OWASP ASVSV14 — Data ProtectionMobile local storage risks are handled as data protection and sensitive-data handling.
Recommendation — Apply V14 to minimise local storage of sensitive data and protect any retained data at rest.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementStored mobile tokens and similar authenticators need lifecycle control and rotation after exposure.
SC-28 — Protection of Information at RestThe subject directly concerns sensitive data left unprotected on device storage and backups.
Recommendation — Use IA-5 to manage token lifecycle and rotate exposed authenticators promptly. Use SC-28 to encrypt or otherwise protect sensitive data at rest on mobile devices.
ISO/IEC 27001:2022A.8.24 — Use of cryptographySecure storage on mobile devices depends on cryptographic protection for sensitive data at rest.
Recommendation — Apply A.8.24 to use approved cryptography for locally stored sensitive data.
CIS Controls v8CIS-3 — Data ProtectionMobile insecure storage is a data protection failure that CIS controls address directly.
Recommendation — Use CIS-3 to classify, minimise and protect sensitive data stored on endpoints and devices.

Practitioner Guidance

Why practitioners should care: This category is often fixed too narrowly, by encrypting one file while leaving logs, backups or debug output unchanged. A real remediation review needs to follow the data path end to end, from collection to persistence to deletion.

What to watch for: Treat any sensitive value that survives beyond the current interaction as suspect, especially if it can be copied by backups, log collectors or other apps. The safest pattern is to minimise storage, use the platform’s secure facilities where persistence is unavoidable, and ensure post-incident review includes rotation of any stored tokens or comparable secrets.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 26, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org