Users can request and receive a copy of all personal data held about them
Why it matters
GDPR Art. 15 grants every EU data subject the right to receive a copy of all personal data held about them, within 30 days of requesting it. An application with no data export feature and no DSAR process is not compliant — not having a formal process is itself a violation, regardless of whether any user has actually made a request. When a subject access request does arrive (and they will, especially as GDPR awareness grows), scrambling to manually assemble a data export from multiple tables is both error-prone and legally risky. Incomplete exports — for example, returning profile fields but omitting activity history or consent records — also violate Art. 15.
Severity rationale
High because the absence of any DSAR mechanism makes it structurally impossible to comply with Art. 15's 30-day fulfillment deadline, leaving the controller in ongoing breach for every day the gap exists.
Remediation
Implement a self-service data export endpoint in app/api/user/export/route.ts that gathers all personal data held about the authenticated user.
export async function GET() {
const session = await getServerSession()
if (!session?.user?.id) return new Response('Unauthorized', { status: 401 })
const userId = session.user.id
const [profile, activity, purchases, consents] = await Promise.all([
db.user.findUnique({ where: { id: userId }, select: { id: true, email: true, name: true, createdAt: true } }),
db.activityLog.findMany({ where: { userId } }),
db.order.findMany({ where: { userId }, include: { items: true } }),
db.consentRecord.findMany({ where: { userId } }),
])
return new Response(JSON.stringify({ _meta: { exportedAt: new Date().toISOString() }, profile, activity, purchases, consents }, null, 2), {
headers: {
'Content-Type': 'application/json',
'Content-Disposition': `attachment; filename="my-data-${Date.now()}.json"`,
},
})
}
Add a "Download my data" button in account settings. Log each export request with a timestamp to demonstrate compliance with the 30-day fulfillment requirement per Art. 12(3).
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 GDPR Readiness Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- gdpr · Art. 15 — Right of access by the data subject
- gdpr · Art. 12 — Transparent information, communication and modalities
- nist:rev5 · IP-3 — Personally identifiable information processing and transparency
Taxons
History
- 2026-04-18·v1.0.0·Initial import from gdpr-readiness·automated