Skip to content
SQL injection Write-up Beginner

Holistic Injection Exploit Report Mapping Vulnerable Input Points to Account Takeover and…

The login and search features of an OWASP Juice Shop instance passed user input straight into SQL queries, so a crafted username could bypass the password check and log in as the admin account. The same flaw in the search parameter allowed union-based queries that dumped database schema and table contents.

kizerh Follow

Published on kizerh.medium.com

This document records a completed ethical hacking engagement conducted against an instance of OWASP Juice Shop. The engagement focus was practical exploration of SQL injection vulnerabilities within authentication and search functionality.

Kiza, on kizerh.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application concatenated user input directly into SQL statements instead of using parameterised queries, so input could alter the query's logic.

Impact

An attacker could log in as the administrator and other users without credentials and could read database schema and table contents through the search feature.

What the attacker needed

Local Juice Shop instance; Burp Suite proxy; no credentials needed

The fix

The application should use parameterised queries or prepared statements, validate input and apply least privilege to the database account.

How it was found

  1. Send a normal login request to the proxy and replay it in Repeater.
  2. Inject a single quote into the username to trigger a database error and confirm injection.
  3. Craft a username that makes the condition true and comments out the password check, logging in as admin.
  4. Find another user's email in product reviews and log in as that account using the same technique.
  5. Inject into the search parameter to break out of the query and confirm control of the result set.
  6. Use union queries to find the column count, then read schema and table data.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The application builds database commands by gluing together text the user types, so a user can type extra database instructions that change what the command does. Here, typing a special username made the login check always succeed, letting the tester sign in as the administrator without knowing the password. The same trick in the search box let the tester read other tables in the database.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

More by kizerh

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.