Implement dropping into a defined user/group after startup #4

Open
opened 2025-01-03 21:41:58 +00:00 by Wirlaburla · 0 comments

On Unix-based systems, ports below 1024 are seen as "system ports", and cannot be bound to unless by root. This is a security risk for an FTP server that listens on control port 21. Service management can allow us to bind to system ports without an elevated user but we should handle dropping into a defined user in case the server is ran as a superuser.

We can most likely implement this drop when we initialize a client, as that is where file manipulations are handled. The main thread simply handles incoming connections and distributes them, which isn't a big security risk under root.

User/group should be handled by configuration values, defaulting to "ftp".

On Unix-based systems, ports below 1024 are seen as "system ports", and cannot be bound to unless by root. This is a security risk for an FTP server that listens on control port 21. Service management can allow us to bind to system ports without an elevated user but we should handle dropping into a defined user in case the server is ran as a superuser. We can most likely implement this drop when we initialize a client, as that is where file manipulations are handled. The main thread simply handles incoming connections and distributes them, which isn't a big security risk under root. User/group should be handled by configuration values, defaulting to "ftp".
Wirlaburla added the Kind/Security
Priority
High
labels 2025-01-03 21:41:58 +00:00
Sign in to join this conversation.