Skip to content
SQL injection Write-up Intermediate

The return to blogging and a blind SQL injection

Admidio before 4.3.9 has a blind SQL injection in the ecard_recipients POST parameter, allowing a low-privileged user to execute arbitrary SQL and extract data such as password hashes.

medium.com

Published on medium.com

This post will cover what I’ve been up to, while also covering a time-based SQL injection inside Admidio tracked as CVE-2024–37906.

Echo_Slow, on 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

The application took the ecard_recipients POST parameter, placed it into an array, and concatenated it directly into an SQL query without sanitisation or parameterisation.

Impact

A low-privileged member user could extract arbitrary data from the database, including password hashes, as demonstrated by the exploit script.

What the attacker needed

A low-privileged account; ability to send POST requests to ecard_send.php

The fix

The vulnerability was fixed in version 4.3.9 by casting the user-supplied value to an integer before use in the SQL query.

How it was found

  1. Log in with a low-privileged account and obtain a session cookie.
  2. Fetch the CSRF token from the overview page.
  3. Send a POST request to ecard_send.php with a crafted ecard_recipients value that includes a time-delay SQL condition.
  4. Measure the response time to determine if the condition was true.
  5. Use binary search to extract the length and characters of database query results.

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.

A blind SQL injection is a flaw where user input is inserted into a database command without proper handling, letting an attacker ask yes/no questions and infer data from delays. Here, a logged-in user could send a crafted message request that made the database wait, revealing information like password hashes.

What is SQL injection?

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

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.