Deletion cascades to all related personal data records
Why it matters
GDPR Article 17(1) requires erasure of all personal data concerning the data subject — not just the primary contact row. CCPA §1798.105 similarly covers all personal information collected. Personal data in an email platform is routinely scattered across contacts, consent records, email event logs (with IP addresses and user agents), form submissions, and analytics events. Deleting the contacts row while leaving IP addresses and email addresses in event tables violates the right to erasure. CWE-459 (Incomplete Cleanup) and CWE-212 (Improper Removal of Sensitive Information) both apply: the deletion path exists but does not clean up the full surface area of PII.
Severity rationale
High because a deletion that covers only the primary contacts table leaves PII in event log tables, directly violating GDPR Art. 17(1)'s requirement to erase all personal data — not just the contact record.
Remediation
Maintain an explicit PII_TABLES inventory in your deletion service so new tables cannot be added to the schema without also being added to the erasure path:
// src/lib/compliance/deletion.ts
const PII_TABLES = [
{ table: 'contacts', column: 'id', action: 'anonymize' },
{ table: 'consent_records', column: 'contact_id', action: 'anonymize-ip' },
{ table: 'email_events', column: 'contact_id', action: 'anonymize' },
{ table: 'form_submissions',column: 'contact_id', action: 'delete' },
{ table: 'opt_out_requests',column: 'contact_id', action: 'retain-anonymized' },
] as const
In tests, assert that every table in PII_TABLES has zero readable PII after erasure. Cross-reference your database migration history for any table that references contact_id — each one must appear in this list.
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 Compliance & Consent Engine Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- gdpr · Art. 17(1) — Erasure without undue delay of all personal data
- cwe · CWE-459 — Incomplete cleanup — PII retained in related tables after deletion
- cwe · CWE-212 — Improper removal of sensitive information
- ccpa · §1798.105 — Deletion must cover all data categories held about the consumer
- soc2:2017 · C1.2 — Disposal of confidential information
- soc2:2017 · CC6.5 — Logical and physical protections over disposed assets
Taxons
History
- 2026-04-18·v1.0.0·Initial import from compliance-consent-engine·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (C1.2, CC6.5) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2