bug: Direct request body passed to database without validation #6
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The order and plan service functions pass
req.bodydirectly to Prismacreate()andupdate()operations without proper validation or sanitization. This allows:Location
File:
src/app/modules/order/order.service.tsComponent:
update_order_into_db()Lines: 145-159
File:
src/app/modules/plan/plan.service.tsComponent:
create_plan_into_db()andupdate_plan_into_db()Lines: 23-31, 33-57
How to Fix
Validate and extract only allowed fields before passing to Prisma:
Or use Zod schema validation:
Acceptance Criteria