GHSL-2020-009: UAF leads to RCE in ProFTPD
A use-after-free vulnerability in ProFTPD's memory pool allocator allows a remote attacker to corrupt memory by interrupting a data transfer, potentially leading to remote code execution.
Originally disclosed on GitHub Security Lab
A use-after-free vulnerability exists in ProFTPD. Successful exploitation of this vulnerability could allow a remote attacker to execute arbitrary code on the affected system.
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 new_block function is not thread-safe, so under concurrent operations it can return a memory block that is already in use, corrupting the pool list and leaving a dangling pointer.
Impact
This issue may lead to post-authentication remote code execution.
What the attacker needed
Valid credentials; ability to start a data transfer; ability to send an interrupt
The fix
The issue was fixed in a commit.
How it was found
- Create a user and extract a directory in their home folder.
- Compile ProFTPD with AddressSanitizer.
- Run ProFTPD as root with specific options.
- Start a netcat listener on a port.
- Send a trigger to the ProFTPD server using telnet.
- Observe ProFTPD crash with an ASAN trace.
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.
ProFTPD is a server program that lets people share files over the internet. A use-after-free bug means the program keeps using a piece of memory after it has been freed, which can let an attacker take control. Here, an attacker who can log in could interrupt a file transfer to trigger the bug and possibly run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.