Temporary data caches cleared when user logs out or uninstalls
Why it matters
GDPR Art. 5(1)(e) requires personal data not be retained longer than necessary — cached session data that survives a logout or uninstall violates this principle. A user who logs out of an extension expecting their session to be cleared can still have their data re-accessed if the extension is re-opened without re-authentication. GDPR Art. 17 (right to erasure) is practically impossible to honor if cached data persists beyond logout. CWE-212 (Improper Removal of Sensitive Information Before Storage or Transfer) covers this failure. Uninstall handlers that do not clear extension storage leave personal data on the user's device indefinitely — often forgotten and never cleaned up.
Severity rationale
Low because data persistence after logout is a latent privacy risk rather than an immediate exfiltration — but it directly violates GDPR Art. 5(1)(e) storage limitation and makes Art. 17 erasure requests unenforceable.
Remediation
Implement a logout() function that clears all session state, and hook it to the extension's uninstall event:
function logout() {
// Clear in-memory state
currentUser = null;
sessionCache = {};
// Clear extension storage keys written during the session
chrome.storage.local.remove(['authToken', 'sessionId', 'cachedProfile']);
}
// Clear on uninstall — chrome.runtime.setUninstallURL can trigger server-side cleanup
// For local cleanup, use onSuspend in MV2 or alarm-based cleanup in MV3
chrome.storage.local.get(null, (items) => {
const sessionKeys = Object.keys(items).filter(k => k.startsWith('session_'));
chrome.storage.local.remove(sessionKeys);
});
Document which storage keys are session-scoped vs. persistent preferences, and ensure logout() targets only session keys to avoid destroying legitimate user settings on re-install.
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 Extension Data Privacy Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- gdpr · Art. 5(1)(e) — Storage limitation — data not kept longer than necessary
- gdpr · Art. 17 — Right to erasure ('right to be forgotten')
- cwe · CWE-212 — Improper Removal of Sensitive Information Before Storage or Transfer
Taxons
History
- 2026-04-18·v1.0.0·Initial import from extension-data-privacy·automated