Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
Post image 6
1 / 6
0

The ORM Didn't Save You: SQL Injection in a Prisma Codebase

DEV Community·Oopssec Store·about 1 month ago
#pAtc5ZGm
Reading 0:00
15s threshold

This writeup walks through a SQL injection in the product search feature of the oss-oopssec-store , an intentionally vulnerable e-commerce app for learning web security. The lab is built with Next.js and Prisma , so you might assume the ORM shields you from SQLi by default, and it mostly does, until someone reaches for $queryRawUnsafe and drops user input straight into a raw query. That's exactly what happens here. The search input gets interpolated into the SQL string with no sanitization, so you can manipulate the query to pull data from other tables and grab the flag. Table of contents Lab setup Feature overview and attack surface Exploitation procedure Vulnerable code analysis Remediation Lab setup Spin up the lab locally: npx create-oss-store oss-store cd oss-store npm run dev Enter fullscreen mode Exit fullscreen mode Or with Docker (no Node.js required): docker run -p 3000:3000 leogra/oss-oopssec-store Enter fullscreen mode Exit fullscreen mode The app runs at http://localhost:3000 .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More