Product records contain all required fields
Why it matters
Missing or nullable required fields break every downstream system that depends on them: a product without a name can't be indexed by search engines, a missing price silently renders as $0.00 or crashes checkout, and an absent image produces broken layout holes that erode customer trust. ISO 25010:2011 functional-correctness requires that a system produces correct outputs; a schema that permits null names or prices fails that baseline. CWE-1279 (Improper Preserved Integrity of Hardware Configuration) maps to this class of structural omission — when the data model doesn't enforce what the business treats as mandatory, inconsistencies accumulate across catalog, cart, and fulfillment.
Severity rationale
High because missing required fields produce silent data corruption that propagates to checkout, search indexes, and fulfillment — defects visible to customers before they're visible to developers.
Remediation
Define all four required fields as non-nullable in prisma/schema.prisma and run prisma migrate dev to enforce the constraint at the database layer — not just in application code.
model Product {
id String @id @default(cuid())
name String @db.VarChar(255)
description String @db.Text
price Decimal @db.Decimal(10, 2)
images String[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
In src/app/api/products/route.ts, add a Zod schema that rejects requests missing any of the four fields before the database write.
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 Catalog & Product Logic Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-1279 — Improper Validation of Consistency within Input
- iso-25010:2011 · functional-correctness — Functional Correctness (Functional Suitability)
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ecommerce-catalog·automated