No sensitive fields captured from DOM without user interaction
Why it matters
Content scripts run in the context of every web page the user visits, giving them direct DOM access to password fields, credit card inputs, and API key fields. Automatically reading these values — even for seemingly benign purposes like autofill — is classified as unauthorized data access under OWASP 2021 A02 and CWE-200. A compromised extension or malicious update can silently exfiltrate credentials at scale across every site the user visits. The Chrome Web Store User Data Policy explicitly prohibits capturing sensitive fields without user initiation; violations result in immediate takedown and potential account termination.
Severity rationale
Critical because automatic DOM capture of password or credit card fields enables credential theft at browser scale — an attacker who compromises the extension gains silent keylogger capability across every site the user visits.
Remediation
Remove all automatic sensitive field access from content scripts. If your extension must interact with credential fields, require a preceding user gesture:
// content.js — only activate on explicit user click
document.addEventListener('click', (e) => {
if (e.target.matches('input[type="password"]')) {
if (confirm('Allow extension to read this field?')) {
const value = e.target.value;
// process value
}
}
});
For legitimate credential management, use the browser's native Credential Management API with explicit user consent rather than direct DOM reads.
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
- cwe · CWE-319 — Cleartext Transmission of Sensitive Information
- owasp:2021 · A02 — Cryptographic Failures
- external · chrome-web-store-user-data-policy — Chrome Web Store User Data Privacy Policy — Prohibited products capturing credentials
Taxons
History
- 2026-04-18·v1.0.0·Initial import from extension-data-privacy·automated