Consent stored as structured records, not boolean flags
Why it matters
GDPR Article 7 requires you to demonstrate that consent was freely given, specific, informed, and unambiguous — a boolean flag proves none of this. Under GDPR Article 30, you must maintain records of processing activities. A single subscribed BOOLEAN column cannot tell a regulator when consent was given, under which version of your privacy policy, from which collection point, or for which communication scope. CCPA §1798.100 similarly requires you to substantiate what personal data you hold and how it was lawfully obtained. When a data protection authority opens an investigation, a boolean flag is not evidence — it is a liability.
Severity rationale
Critical because a boolean flag leaves you unable to demonstrate lawful basis for processing under GDPR Art. 7, exposing you to enforcement action and fines up to 4% of global annual turnover.
Remediation
Replace the boolean flag with a dedicated consent_records table where every row is an immutable event. Add the migration to your supabase/migrations/ or Prisma schema:
CREATE TABLE consent_records (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
contact_id UUID NOT NULL REFERENCES contacts(id),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
source TEXT NOT NULL, -- 'checkout-form', 'api-import', 'landing-page'
scope TEXT NOT NULL, -- 'marketing', 'transactional', 'partner'
granted BOOLEAN NOT NULL,
policy_version TEXT NOT NULL,
ip_address TEXT,
user_agent TEXT
);
CREATE INDEX idx_consent_records_contact_id ON consent_records(contact_id);
The most recent granted = true record for a (contact_id, scope) pair is the effective consent state. Keep the boolean as a denormalized cache if needed for query speed, but never as the source of truth.
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. 7 — Conditions for consent
- gdpr · Art. 30 — Records of processing activities
- ccpa · §1798.100 — Right to know / access
- cwe · CWE-778 — Insufficient logging
- iso-27001:2022 · A.8.15 — Logging
Taxons
History
- 2026-04-18·v1.0.0·Initial import from compliance-consent-engine·automated