Skip to content
Memory corruption Advisory Advanced

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.

antonio-morales Follow

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.

antonio-morales, on GitHub Security Lab

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

  1. Create a user and extract a directory in their home folder.
  2. Compile ProFTPD with AddressSanitizer.
  3. Run ProFTPD as root with specific options.
  4. Start a netcat listener on a port.
  5. Send a trigger to the ProFTPD server using telnet.
  6. 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.

More by antonio-morales

View all

45 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.