November 28, 2026
Time-Based SQL Injection in Account Activation $X,XXX
Introduction

By Casper0x
3 min read
Introduction
While hunting on one of HackerOne programs, I managed to discover a SQL Injection vulnerability, for which the company rewarded me $X,XXX.
In this article, I will explain how I discovered a Time-Based SQL Injection vulnerability that allowed me to extract all the information stored in the database.
Due to the program's rules, I will not disclose the name of the program or the website. Instead, I will use example.com as the target domain throughout this article.
During reconnaissance of the website, I came across a JavaScript (JS) file. After analyzing its contents, I noticed an important section related to account activation.
I then continued performing further reconnaissance against one of the APIs. I discovered that when someone creates an account, the website requires an administrator to manually activate that account.
Before diving deeper into this vulnerability and exploiting it, let's first understand what SQL and SQL Injection are.
To understand this vulnerability, you should first be familiar with the following two concepts:
1. What is SQL?
SQL stands for Structured Query Language. It is a language used by applications to communicate with databases, which are used to store information.
For example, when you submit an account activation code (Token), the application sends a query to the database similar to the following:
2. What is SQL Injection (SQLi)?
SQL Injection occurs when a programmer allows user-supplied input to be directly incorporated into server-side SQL queries without properly validating the request or sanitizing the input.
In this situation, an attacker may use characters such as ' (single quote) or ; (semicolon) to interfere with the application's SQL query and potentially retrieve information stored in the database.
After discovering the endpoint, I attempted to create an account. However, the account could not be activated because it required an administrator to approve it.
then i crafted a request and sent it to the endpoint, When I submitted the request without a token, the server returned the following response:
404 Not Found
I inserted a single quote (') to check whether the endpoint might be vulnerable to SQL Injection, The server returned a 500 Internal Server Error. This can sometimes indicate a SQL-related error, although it doesn't necessarily confirm the presence of SQL Injection on its own.
Testing for Time-Based SQL Injection
Next, we needed to test for a Time-Based SQL Injection vulnerability.
This technique relies on observing the response time. When the injected condition evaluates to true, the application may deliberately delay its response for a specified number of seconds.
On some bug bounty programs, you may need to stop your testing at this stage. However, depending on the program's rules, further testing may be permitted to identify additional information, such as:
- Database name
- Database user
- Database version
During my testing, I encountered a limitation where the vulnerable parameter accepted only a very small number of characters, making it difficult to construct a suitable SQL Injection payload.
I tried using AI tools to help develop a payload that would fit within this restriction, but most of them refused to assist with the request.
At this point, I used ObsidianLabs to help me work through the payload limitation and explore a solution that would fit the character restriction. It was helpful in overcoming this obstacle, and I was eventually able to develop a Proof of Concept (PoC) to demonstrate the vulnerability.
I used this payload for gathering Database Version as POC:
1'; IF (SUBSTRING(@@VERSION,1,1) = 'M') WAITFOR DELAY '0:0:4' -1'; IF (SUBSTRING(@@VERSION,1,1) = 'M') WAITFOR DELAY '0:0:4' -This experience reminded me that understanding the vulnerability itself is only part of the process. Sometimes, the real challenge is finding a way to work around unexpected restrictions during testing.