Skip to content
Business logic Disclosed report Intermediate

KRB-FTP: Security level downgrade

libcurl does not abort an FTP connection when Kerberos authentication fails; instead it falls back to plain clear-text password authentication. An active man-in-the-middle attacker can force the Kerberos attempt to fail and thereby downgrade the session to unprotected credentials.

nyymi Follow

Originally disclosed on HackerOne

Informational View original
  • Disclosed after 3 days

Summary:

libcurl doesn't fail the FTP connection if Kerberos authentication fails for some reason, but rather reverts back to using regular clear text password authentication.

The logic is inlib/ftp.c ftp_statemachine: https://github.com/curl/curl/blob/07a9b89fedaec60bdbc254f23f66149b31d2f8da/lib/ftp.c#L2706

This means that active attacker in a man in the middle position can downgrade any attempt to use Kerberos FTP to regular one by merely forcing the Kerberos authentication to fail.

The more secure course of action would be to fail the FTP connection if Kerberos authentication fails. If such change is not deemed necessary the current limitations should be documented.

Steps To Reproduce:

  1. MitM the connection and make the kerberos authentication fail
  2. curl --krb private ftp://victim.tld/

Impact

  • Security level downgrade.

The original report as published on HackerOne, by nyymi. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

Likely the FTP state machine treats a failed Kerberos authentication as a reason to try the next authentication method rather than as a fatal error, so it silently falls back to clear-text credentials.

Impact

An active attacker in a man-in-the-middle position could downgrade a Kerberos-protected FTP session to clear-text password authentication.

What the attacker needed

Attacker in man-in-the-middle position; client uses Kerberos FTP option

The fix

The connection should be aborted when Kerberos authentication fails, or, if that behaviour is kept, the limitation should be documented.

How it was found

  1. Place yourself in a man-in-the-middle position and cause the Kerberos authentication to fail.
  2. Run curl against the FTP server with Kerberos requested and observe the fallback.

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.

Kerberos is a way of logging in without sending a password over the network. libcurl is a library many programs use to download files. The report says that when the Kerberos login fails, libcurl quietly switches to sending a normal password in the clear instead of stopping, so someone sitting on the network path can force that switch and read the password.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by nyymi

View all

51 more disclosed reports, best first.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.