Background scripts do not persistently log full browsing history
Why it matters
A background script that persistently logs visited URLs to chrome.storage.local or an external server is, functionally, spyware — regardless of intent. GDPR Art. 5(1)(c) prohibits collecting data beyond what is necessary; Art. 5(1)(e) requires data not be retained longer than needed. Persistent browsing history in extension storage becomes a high-value target: a single compromise of the extension or its backend server exposes a complete record of the user's online behavior. The Chrome Web Store User Data Policy explicitly prohibits collecting user activity beyond declared core functionality, and violations result in immediate delisting.
Severity rationale
High because persistent browsing history constitutes a detailed behavioral profile that, once collected, can be exfiltrated, subpoenaed, or sold — the harm is irreversible once the data exists.
Remediation
Replace persistent storage writes inside tab listeners with in-memory state that clears on extension unload:
// GOOD — memory only, no persistent history log
let currentTabUrl = null;
chrome.tabs.onActivated.addListener(({ tabId }) => {
chrome.tabs.get(tabId, (tab) => {
currentTabUrl = tab.url; // Used in-session only, not persisted
});
});
If your feature genuinely requires storing activity (e.g., a user-controlled history tool), make it explicit: get consent first per pii-consent, encrypt the data per local-pii-encrypted, and document the retention period per retention-periods. Never write URL data to storage inside a tab event handler without those three controls in place.
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
- cwe · CWE-200 — Exposure of Sensitive Information to an Unauthorized Actor
- gdpr · Art. 5(1)(c) — Data minimisation
- gdpr · Art. 5(1)(e) — Storage limitation
- external · chrome-web-store-user-data-policy — Chrome Web Store User Data Privacy Policy — Prohibited: collecting browsing history without consent
Taxons
History
- 2026-04-18·v1.0.0·Initial import from extension-data-privacy·automated