Описание
eKuiper API endpoints handling SQL queries with user-controlled table names.
Summary
A critical SQL Injection vulnerability exists in the getLast API functionality of the eKuiper project. This flaw allows unauthenticated remote attackers to execute arbitrary SQL statements on the underlying SQLite database by manipulating the table name input in an API request. Exploitation can lead to data theft, corruption, or deletion, and full database compromise.
Details
The root cause lies in the use of unsanitized user-controlled input when constructing SQL queries using fmt.Sprintf, without validating the table parameter. Specifically, in:
Any value passed as the table parameter is directly interpolated into the SQL string, enabling injection attacks. This is reachable via API interfaces that expose time-series queries.
PoC
- Deploy eKuiper instance (default config is sufficient).
- Send a crafted request to the SQL query endpoint:
- Effect: Executes two SQL queries — the first selects data, the second drops the
userstable. - Verify Result:
Impact
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Refferences
Пакеты
github.com/lf-edge/ekuiper/v2
< 2.2.1
2.2.1
github.com/lf-edge/ekuiper
<= 1.14.7
Отсутствует
Связанные уязвимости
LF Edge eKuiper is a lightweight IoT data analytics and stream processing engine running on resource-constraint edge devices. In versions before 2.2.1, there is a critical SQL Injection vulnerability in the getLast API functionality of the eKuiper project. This flaw allows unauthenticated remote attackers to execute arbitrary SQL statements on the underlying SQLite database by manipulating the table name input in an API request. Exploitation can lead to data theft, corruption, or deletion, and full database compromise. This is fixed in version 2.2.1.