Profanity/spam detection or manual review queue is implemented
Why it matters
A review form with no content filtering is an XSS injection surface (CWE-79, OWASP A03:2021 Injection): stored review text rendered without escaping can execute scripts in other users' browsers. Beyond injection risk, unfiltered review text lets competitors post identical five-star spam 100 times over — the only limit is how fast they can POST. A manual admin review queue without automated pre-filtering creates an unmanageable backlog at any real volume. At minimum, one automated layer (a profanity library or AI moderation API call) must run before the INSERT to catch the automated attacks.
Severity rationale
High because absent content filtering allows stored XSS via review text and enables unlimited spam submission with no automated defense at any layer.
Remediation
Add automated content filtering in api/reviews/submit using a profanity library, then route suspicious submissions through the manual queue at app/admin/reviews/page.tsx.
// api/reviews/submit
import Filter from 'bad-words'
const filter = new Filter()
const cleanText = filter.clean(reviewText)
const isSuspicious = cleanText !== reviewText
await db.reviews.create({
data: {
text: cleanText,
status: isSuspicious ? 'pending' : 'approved',
// ...
}
})
// app/admin/reviews/page.tsx
export default async function ReviewQueue() {
const pending = await db.reviews.findMany({ where: { status: 'pending' }, orderBy: { created_at: 'asc' } })
return <ReviewModerationTable reviews={pending} />
}
The admin route must be behind an auth check — never expose the moderation queue to unauthenticated users.
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 Reviews & Social Proof Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-79 — Improper Neutralization of Input During Web Page Generation (XSS)
- owasp:2021 · A03 — Injection
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ecommerce-reviews·automated