SQL injection when configuring a database
The installer's database configuration form did not escape backticks in the database name, allowing an attacker to inject SQL that creates an additional database. An attacker could execute arbitrary SQL statements on the database server during installation.
- Triaged in 15 days
- Fixed in 3 months
- Disclosed after 4 months
Summary:
I found a SQL Injection in the form of a system install (Database configuration)
Steps To Reproduce:
- Run command:
git clone https://github.com/ImpressCMS/impresscms.git - Stop at a menu item:
Database configuration - In the
Database namefield, insert the following exploit:
impresscms`;create database `vuln

- Submit the form

- Two databases (
impresscms,vuln) created successfully. POC is attached to the report
Supporting Material/References:
PHP addslashes - single quote ('), double quote ("), backslash, NUL (the NUL byte), but Backtick is not escaped!
Impact
Executing arbitrary code on a database
Attachments
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the installer used PHP's addslashes() to escape the database name, which does not escape backticks, and then placed the name inside backticks in a SQL statement.
Impact
An attacker could execute arbitrary SQL statements on the database server, such as creating additional databases.
What the attacker needed
Access to the installer; ability to submit the database configuration form
How it was found
- Clone the ImpressCMS repository.
- Start the installer and go to the database configuration step.
- Enter a crafted database name containing a backtick and additional SQL.
- Submit the form.
- Observe that two databases are created.
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 report has not been written yet. The Original tab links to the source.
When you set up a website, you often give it a database name. The installer put that name directly into a database command without properly handling special characters like backticks. This let someone sneak in extra database commands, like creating another 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.