# Explicit user consent obtained before collecting any PII

- **Pattern:** `ab-001299` (`extension-data-privacy.data-collection.pii-consent`)
- **Severity:** critical
- **Lifecycle:** active
- **Last modified:** 2026-04-18
- **Canonical URL:** https://auditbuffet.com/patterns/ab-001299
- **License:** CC-BY-4.0 — attribute to AuditBuffet Pattern Catalog (https://auditbuffet.com/patterns/ab-001299)

## Why it matters

Chrome extensions operate inside the browser with elevated trust, making them a uniquely dangerous collection point for PII. Collecting names, emails, or browsing patterns without explicit opt-in consent violates GDPR Art. 6 and Art. 7, CCPA §1798.100, and the Chrome Web Store User Data Policy — each of which requires a lawful basis before processing. CWE-359 captures the failure mode precisely: exposing private information without authorization. Beyond compliance, extensions that silently harvest PII expose users to identity theft and damage developer reputation irreparably if discovered by a store reviewer or security researcher.

## Severity rationale

Critical because silent PII collection without consent is the defining privacy violation regulators and app store reviewers flag first — it enables data harvesting at browser-scale with zero user awareness or recourse.

## Remediation

Gate every PII collection call behind a stored consent flag. Add an explicit opt-in toggle to your options page before any data leaves the device:

```html
<label>
  <input type="checkbox" id="enableTracking" />
  Allow anonymous usage statistics to improve this extension
</label>
```

Then in your background script, read the flag before sending:

```js
chrome.storage.local.get(['consentGiven'], ({ consentGiven }) => {
  if (consentGiven) {
    sendAnalytics(data);
  }
});
```

Default the flag to `false` (opt-in, not opt-out) so unconfigured installs never transmit PII.

## Detection

**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](https://auditbuffet.com/audits/extension-data-privacy). The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.

## External references

- gdpr Art. 6
- gdpr Art. 7
- ccpa §1798.100
- cwe CWE-359
- external chrome-web-store-user-data-policy — https://developer.chrome.com/docs/webstore/user_data/

Taxons: privacy-consent

HTML version: https://auditbuffet.com/patterns/ab-001299
