Skip to content

Security

Reporting a vulnerability

Please do not open a public issue for a security problem. Report it privately with GitHub: open the Security tab of the repository and choose Report a vulnerability.

Include the version of uFTP and how it was built (with or without OpenSSL, IPv6), what you did and what happened (ideally the commands sent to the server), the configuration that matters without passwords, the operating system, and a small script that reproduces the problem if you have one.

What to expect: a first answer within 7 days; the problem is checked and fixed, and we tell you when the fix is ready. When it is released the problem is published as a security advisory (with a CVE where it applies) and the person who reported it is credited, if they want. We ask you to keep the details private until the fix is released, for at most 90 days.

Supported versions

Security fixes are made for the latest release. Upgrade to the latest version.

Running uFTP safely

  • Keep uftpd.cfg readable only by root (chmod 600), and use hashed passwords.
  • Set FORCE_TLS = true to require TLS for login. Configure clients to use PROT P to encrypt file transfers. TLS and certificates
  • Give every user the smallest HOME_n that they need. A user cannot leave the home directory.
  • Set MIN_FREE_SPACE_MB (the server runs as root: without it a user can fill the disk of the system), and the limits of your site.
  • Put fail2ban in front of the logs: a ready filter and jail are in contrib/fail2ban/ in the source. See Block attacks with fail2ban.
  • Give each user only the permissions they need (READ_ONLY_n, a drop box with upload,mkdir). run (for SITE RUN) is not part of all: give it only to users you trust, because the script runs with the privileges of uFTP.
  • Run uFTP without root (a hardened systemd unit, or the Docker image). An authentication hook and a SITE RUN script run with the same privileges as uFTP: keep them owned by root and not writable by others (uFTP refuses to start with a hook or a script that anybody can change).
  • Restrict the passive ports in the firewall to the range of RANDOM_PORT_START to RANDOM_PORT_END.