CVE-2025–47812: Wing FTP Remote Code Execution
Wing FTP Server mishandled null bytes in the username field, allowing an attacker to inject Lua code into session files. When the session file was loaded, the injected code executed with the privileges of the FTP service, leading to remote code execution as root or SYSTEM.
medium.com
Published on medium.com
In Wing FTP Server before 7.4.4. the user and admin web interfaces mishandle ‘\0’ bytes, ultimately allowing injection of arbitrary Lua code into user session files. This can be used to execute arbitrary system commands with the privileges of the FTP service (root or SYSTEM by default).
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application failed to sanitise null bytes and other special characters in the username before writing it into a Lua session file, and then executed that file without validation.
Impact
An attacker could execute arbitrary system commands with the privileges of the FTP service (root on Linux, SYSTEM on Windows), leading to full server compromise; this is exploitable even with an anonymous FTP account if enabled.
What the attacker needed
Anonymous FTP account enabled or valid credentials; web interface accessible
The fix
The vulnerability was fixed in Wing FTP Server 7.4.4; users should upgrade to that version or later.
How it was found
- Authenticate to the web interface with a username containing a null byte and injected Lua code.
- The server creates a session file containing the injected code.
- Send a request to any authenticated endpoint, such as /dir.html, to trigger loading and execution of the session file.
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 write-up has not been written yet. The Original tab links to the source.
Wing FTP Server is a program that lets people share files over the internet. It stored the username you type at login in a file that it later runs as a small program. By putting special characters in the username, an attacker could sneak their own commands into that file, and the server would run them with high privileges.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.