Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-fv2p-qj5p-wqq4
No affected components available
Summary
Path traversal is also known as directory traversal. These vulnerabilities enable an attacker to read arbitrary files on the server that is running an application. In this case, an attacker might be able to write to arbitrary files on the server, allowing them to modify application data or behavior, and ultimately take full control of the server.
Details
The file handler function trusts the filename provided by the user. This includes the cases when the user uses a path instead of the filename. This makes possible to write arbitrary files to the system and replace the files owned by kuiper user on the filesystem. The vulnerable function is fileUploadHandler which is shown below:
https://github.com/lf-edge/ekuiper/blob/1e6b6b6601445eb05316532f5fbef7f0a863ecfe/internal/server/rest.go#L329-L359
Exploitation of this vulnerability allows an attacker to rewrite the files owned by ekuiper including the main kuiper binaries as they are owned by kuiper user:
PoC
- The files should be uploaded to
/kuiper/data/uploadsdirectory. So let's move to the/kuiper/data, examine the existing files and create an emptytraversal-pocfile owned by kuiper:
- Now, we can go to Services > Configuration > File Management and try to upload file with name
../test:
In the response we can see the path of the uploaded file and can assume that the traversal worked.
- Now we can try to change the
traversal-pocfile that we know exists on the server. It can be made with the following request:
- Now, if we look at the server, we can see the file created in the traversed directory and the replaced poc-file:
Impact
- Possibility to upload files to external directories;
- Possibility to rewrite any file owned by kuiper user on the filesystem.
Reported by Alexey Kosmachev, Lead Pentester from Bi.Zone
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker needs basic access or low-level privileges. No user interaction is needed for the attacker to exploit this vulnerability. The vulnerability can affect other systems as well, not just the initial system. There is a high impact on the integrity of the data. There is a low impact on the availability of the system.
Exploitation activity has been observed. Apply available patches or mitigations urgently.
Probability that this vulnerability will be exploited in the wild within the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard