GHSL-2024-297_GHSL-2024-298: Remote Code Execution in Plenti via arbitrary file write and arbitrary file deletion - CVE-2024-49380, CVE-2024-49381
The local server started by Plenti's serve command exposes a POST endpoint that writes or deletes files based on paths supplied in the request body. An attacker able to reach that server could write arbitrary files, which may lead to remote code execution, or delete files, causing information loss.
Plenti’s serve command creates a local server to view one’s website. This server is vulnerable to arbitrary file write and arbitrary file deletion, which may lead to remote code execution.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The endpoint trusts the file path supplied in the request body and writes or deletes it without confining it to the project directory.
Impact
Writing arbitrary files may lead to remote code execution, and deleting arbitrary files may lead to information loss; the text does not state whether the server is reachable beyond the local machine.
What the attacker needed
Plenti serve command is running; Attacker can send requests to the local server
The fix
The vulnerability was fixed in v0.7.2.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Plenti is a website builder that can run a small web server on your own computer so you can preview your site. That server accepts requests that tell it to save or remove files, and it does not check where those files are. Anyone who can send requests to that server could make it overwrite or delete files on the machine.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.