Review text content cannot be edited after submission without moderation
Why it matters
An edit route that updates review text without resetting status to 'pending' creates a post-approval backdoor: a user submits a clean review, it passes moderation, then they edit it to inject harmful content that immediately goes live because the approved status is preserved. CWE-284 (Improper Access Control) applies — the user gains a privilege (bypassing moderation) they were not supposed to retain after the initial approval. This also means edit protection is inseparable from ecommerce-reviews.moderation-trust.moderation-enforced: if moderation exists, every write path to review content must re-enter it.
Severity rationale
High because a post-approval edit bypass gives any authenticated user a reliable path to publish arbitrary content to live product pages without moderation.
Remediation
Either remove edit functionality entirely, or force re-approval on every text edit in api/reviews/[id]/route.ts.
// api/reviews/[id]/route.ts — PATCH handler
export async function PATCH(req: Request, { params }: { params: { id: string } }) {
const { text } = await req.json()
const session = await getServerSession()
if (!session) return Response.json({ error: 'Unauthorized' }, { status: 401 })
// Verify ownership
const review = await db.reviews.findUnique({ where: { id: params.id } })
if (review?.user_id !== session.user.id) return Response.json({ error: 'Forbidden' }, { status: 403 })
await db.reviews.update({
where: { id: params.id },
data: {
text,
status: 'pending' // Always re-queue; never preserve 'approved' after content change
}
})
return Response.json({ status: 'pending_review' })
}
Any edit pathway that touches text or rating must include status: 'pending' in the same UPDATE statement.
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-284 — Improper Access Control
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ecommerce-reviews·automated