Prisma ORM (TypeScript / SQL) · CWE-915

Prisma ORM: BOPLA & Mass Assignment (Code Remediation)

Implement fail-closed guards and safe data filters. Prevent callers from overwriting role, isAdmin, balance, or orgId fields through DTO inputs. Tailored for Prisma ORM: Include ownerId or orgId inside every update/delete where filter; avoid unsafe raw SQL.

Primary AegisSec skill
owasp-api-graphql-audit ->
Companion: finding-verification-triage
Coverage ledger tracking key
surface:prisma-orm::boundary:mass-assignment::angle:remediation
Schema diff probing privileged body keys
Risk boundary
// Unverified Prisma ORM path (CWE-915 · Code Remediation)
// Handler accepts input without validating where: { id, orgId }.
Hardened guard
// Hardened Prisma ORM (CWE-915 · Code Remediation)
// 1. Include ownerId or orgId inside every update/delete where filter; avoid unsafe raw SQL
// 2. Allowlist explicit DTO fields cleanly before saving and project response payloads safely.

Verification steps

  1. 01Seed coverage-ledger.json for every Prisma ORM handler touching BOPLA & Mass Assignment.
  2. 02Trace request parameters through where: { id, orgId } validation down to the sink.
  3. 03Verify with paired positive/negative evidence via finding-verification-triage.