Skip to content
SQL injection Disclosed report Intermediate CVE-2021-44135

SQL injection in pagekit/pagekit

The SettingsController's configAction allowed users to set the comment listing order to ASC or DESC, but the value was saved without sanitisation and later concatenated directly into an SQL query. An attacker could inject SQL commands through this setting, potentially altering database queries.

pagekit/pagekit

Originally disclosed on huntr

Critical View original

Pagekit is a modular and lightweight CMS built with Symfony components and Vue.js. The configAction in SettingsController allow user to set the order of comments listing. The allowed options are ASC and DESC. That config then get concatenated directly to the SQL query. Due to the fact that there wasnt any sanitizion before saving that config, it can lead to the SQL Injection vulnerability.

From the GitHub Advisory Database (GHSA-45hc-r4fj-qj89, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

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 application failed to validate or sanitise the comment order setting before storing it and concatenating it into an SQL query.

Impact

An attacker could inject SQL commands through the comment order setting, potentially reading or modifying database contents.

What the attacker needed

Access to the settings configuration

The fix

The setting should be validated to allow only 'ASC' or 'DESC' before saving, and parameterised queries should be used instead of concatenation.

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.

SQL injection is when user input is inserted into a database command without being checked, letting an attacker change the command. Here, a setting that should only accept 'ASC' or 'DESC' was saved without validation and then used directly in a database query. This could let someone run their own database commands.

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.