Content can be deleted or hidden by moderators
Why it matters
Storing a deletion flag that is never checked in the read path is a false sense of control — under DSA Art. 16 and CWE-284, content removal must actually prevent the content from being visible to users. Platforms where deleted=true content still appears in public feeds, search results, or API responses give bad actors exactly what they want: their content stays up regardless of moderation actions. Soft-delete patterns that skip the WHERE clause in even one public query defeat the entire enforcement model.
Severity rationale
Critical because ineffective content removal means moderation actions have no real effect — abusive, illegal, or harmful content remains publicly visible after moderators act.
Remediation
Implement a deleted_at soft-delete column and enforce its exclusion in every public-facing query. In src/lib/queries.ts:
export async function getPublicPosts() {
return db.posts.findMany({
where: {
deletedAt: null,
status: { not: 'removed' },
},
orderBy: { createdAt: 'desc' },
});
}
Audit every query in the codebase that reads posts, comments, or messages — confirm each includes deletedAt: null in its WHERE clause. Removed content may be retained in the database for records (moderation log, appeals), but must never surface in any public API response or UI render path.
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 Content Moderation & Safety Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-284 — Improper Access Control
- external · DSA-Art16 — EU Digital Services Act Article 16 — Notice and Action Mechanisms
Taxons
History
- 2026-04-18·v1.0.0·Initial import from community-moderation-safety·automated