Hacking Ticketastic
The ticket page was vulnerable to SQL injection, allowing an attacker to enumerate databases, tables and columns and to extract user passwords. A separate CSRF issue let an attacker create a new admin account by making a victim visit a crafted link.
Published on systemweakness.com
Hi guys! I’m back with another great blog, with this blog you can learn more about SQLi and Cross Site Request Forgery (CSRF).
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 ticket parameter was concatenated into a SQL query without parameterisation, and the account creation endpoint lacked CSRF protection and assigned admin rights to every new user.
Impact
An attacker could create an admin account via CSRF and could read the database contents, including user passwords, through SQL injection.
What the attacker needed
Victim clicks a crafted link; access to the ticket page
How it was found
- Create a link to the new user endpoint with chosen username and password values.
- Wait about a minute, then log in with the new user.
- Open the ticket page and notice an error revealing the database and framework.
- Use UNION-based injection to enumerate the database version and column count.
- List databases, then tables and columns in the interesting database.
- Extract the users table contents to obtain passwords and the final flag.
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.
SQL injection is when user input is placed into a database query without being treated as data, so an attacker can change the query. Here the ticket page let the attacker list databases and read user passwords. Separately, a CSRF flaw meant a link could create a new account without the victim meaning to, and every new account was an admin.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.