Data export does not include other users' private messages
Why it matters
Data portability (GDPR Art. 20) entitles users to their own data — not other users' data. An export query that fetches entire conversation threads by conversation ID rather than by participant ID will return messages the requesting user received from, or in group threads containing, other users who did not request the export. This is a direct CWE-285 (improper authorization) and CWE-200 (information exposure) violation, and a data breach reportable under GDPR Art. 33 if it reaches the requesting user's device.
Severity rationale
Medium because the scope of exposure is bounded to conversation participants whose messages the user had legitimate access to read, but the export still violates their right to control their own data copy.
Remediation
Filter the message export query strictly to rows where the requesting user is sender or recipient — never by conversation ID alone. In your data export job (src/jobs/generateDataExport.ts):
const messages = await db.message.findMany({
where: {
OR: [
{ senderId: userId },
{ recipientId: userId }
]
},
select: {
id: true, content: true, sentAt: true,
senderId: true, recipientId: true
}
});
// Do NOT query by conversationId — that pulls all participants' messages
Code-review the export job whenever the message schema changes to ensure new join tables or group-chat expansions don't reintroduce the over-fetch pattern.
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 Community Privacy & Controls Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-285 — Improper Authorization
- owasp:2021 · A01 — Broken Access Control
- gdpr · Art. 20 — Right to data portability — own data only
- cwe · CWE-200 — Exposure of Sensitive Information to an Unauthorized Actor
- gdpr · Art. 33 — Notification of a personal data breach to the supervisory authority
- soc2:2017 · CC6.7 — Restriction of information transmission, movement, and removal
Taxons
History
- 2026-04-18·v1.0.0·Initial import from community-privacy-controls·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.7) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2