Reviewing sensitive application data stored in clients
Data protection needs to cover the sensitivity, use, location and lifetime of information across application components. Understanding sensitive application data stored in clients helps establish which security property the feature needs and where that property is actually enforced.
What does this involve?
Storage security concerns the copies that remain after an operation has finished. Files, databases, caches and exports can have different access rules and retention periods. A protected main database does not automatically protect a temporary copy or a restored backup.
Why it matters
Consider a realistic failure: a private record is protected in the primary store but persists in an export, cache or client copy after access should end.
Exposure can involve private records, reusable credentials or information that identifies a customer. The practical impact depends on which copy is accessible, the access an attacker needs and whether the recovered material remains useful.
A code audit connects a stated requirement to the implementation responsible for enforcing it. Source review and targeted behavioural checks should explain the same boundary and any relevant exceptions.
How penetration testers check for it
Review the specific control expectations below against the code, deployment and observable application behaviour.
- Confirm that authenticated data is cleared from client storage, such as the browser DOM, after the client or session is terminated. The 'Clear-Site-Data' HTTP response header field may be able to help with this but the client-side should also be able to clear up if the server connection is not available when the session is terminated.
- Confirm that the application sets sufficient anti-caching HTTP response header fields (i.e., Cache-Control: no-store) so that sensitive data is not cached in browsers.
- Confirm that data stored in browser storage does not contain sensitive data, with the exception of session tokens.
- Check temporary copies, exports, backups and deletion behaviour.
- Establish whether recovered information grants any further access.
How to fix it
Implement the required boundary in the component that actually performs the sensitive operation and retain focused regression coverage.
- Retain only the information needed for the service.
- Separate private working data from deliberately shared content.
- Protect encryption keys independently of encrypted files.
- Verify removal and recovery behaviour against the intended lifecycle.
Encryption is one part of the design. It cannot compensate for an application that willingly returns plaintext to an unauthorised caller.
Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.
Related issues
- Documenting sensitive data classes and protection requirements
- Reviewing log content, correlation and sensitive data exposure
- Auditing token claims, validity windows and sensitive contents
Read about our methodology or contact pentested.com to discuss the security of your application code.