It is kind of funny that the first allocated port outside of the "Well-known" (aka below port 1024) range is just a random "network blackjack" entry at port 1025
benjojo
replied 20 Jan 2026 19:36 +0000
in reply to: https://benjojo.co.uk/u/benjojo/h/NTJ9C1J1G18m467ztP
Also worth reiterating that the concept of "well-known" is a incredibly stupid UNIX-ism that doesn't really deserve to exist today however some extremely fringe (and silly) cases around backwards compatibility (that are depending on authenticating based on a port number) you can fix the stupidity by setting sysctl net.ipv4.ip_unprivileged_port_start=23 There is some argument to set it just below SSH (port 22) to prevent some stupid service from being able to bind on to port 22, But anything above that should be fair game lifting this limitation stops you from having to give applications root when they start up, or bless them with some systems capability flag through the file system
picofarad@noauthorit..
replied 20 Jan 2026 23:05 +0000
in reply to: https://benjojo.co.uk/u/benjojo/h/68534172TctqTdZDXz
@benjojo i... just... use... a reverse proxy like haproxy if i don't want to run as root or whatever. 9 times out of ten whatever i am setting up doesn't even have a public IP anyhow so who cares
benjojo
replied 20 Jan 2026 23:31 +0000
in reply to: https://noauthority.social/users/picofarad/statuses/115929929627804140
@picofarad I mean sure, but the overall point is that the fact you (without tweaking this sysctl or setting the fs capability flag) have to run your application as root to bind on 80/443 is really quite silly, and gives your applications a lot of exposure to things, even if they drop down to some other user shortly after binding
noisytoot@berkeley.e..
replied 22 Jan 2026 02:04 +0000
in reply to: https://benjojo.co.uk/u/benjojo/h/68534172TctqTdZDXz
@benjojo How do you restrict which users can bind to certain ports in a better way? (I think it's possible with eBPF, but I don't know how exactly)
benjojo
replied 22 Jan 2026 09:39 +0000
in reply to: https://berkeley.edu.pl/objects/12d53216-292c-4719-9253-19b0d0e28289
@noisytoot does it actually matter which users are binding to the ports? I generally operate on the rule of thumb that security in a multi-used system is actually dead, if there is a compromise in one of the users, I just assume that root has been compromised as well Obviously I am not running timeshare systems here or anything similar to that so your mileage may vary
noisytoot@berkeley.e..
replied 23 Jan 2026 13:08 +0000
in reply to: https://benjojo.co.uk/u/benjojo/h/Pnk5Sk8Y753D7ctNtp
@benjojo on a shared system it definitely matters, but even if you're the only actual user, one of the users being compromised doesn't necessarily mean that root is compromised (or you might as well just run everything as root)
benjojo
replied 23 Jan 2026 18:50 +0000
in reply to: https://berkeley.edu.pl/objects/e7755e3a-76df-409a-b1bb-f2108da491a9
Yeah but you say a bit of an load bearing "doesn't necessarily" there, I think the only reasonable position to take on multi user systems over the years (at least where there are real stakes) is that a compromise have any user on a multi user system should be treated as a full system compromise. There are just too many variables and they are realistically to hard to verify/assure against, you can try and mitigate them, but assuming your tooling is in place, you should be able to blow away the machine and cycle any rights that box had on it. It's important to consider nuance, just because I don't trust multi user boundaries does not mean that I'm going to actively give away surface for free, at the very least the multi user system permissions help surface bugs sometimes.
but even if you're the only actual user, one of the users being compromised doesn't necessarily mean that root is compromised
(or you might as well just run everything as root)
noisytoot@berkeley.e..
replied 26 Jan 2026 18:11 +0000
in reply to: https://benjojo.co.uk/u/benjojo/h/Rb6DHJ6716w2R11jBc
just because I don’t trust multi user boundaries does not mean that I’m going to actively give away surface for free Exactly. It’s still worth restricting which users can bind to which ports just like it’s still worth using separate users for separate services, even if the security of multi-user boundaries is imperfect.
benjojo
replied 26 Jan 2026 18:45 +0000
in reply to: https://berkeley.edu.pl/objects/7e1944c8-1d26-4d54-9c33-e479f8481dbe
@noisytoot I think the difference between us is that you seem to think that me being able to bind on 443 as a 'random' user is a security risk, when I think not being able to is a bigger risk (because it forces various processes to be root (even if at just the stat) or blessed in a magical way)
evey@chaos.social
replied 20 Jan 2026 19:48 +0000
in reply to: https://benjojo.co.uk/u/benjojo/h/68534172TctqTdZDXz
@benjojo The biggest culprit is NFSv3 and NFSv4 in lesser regards. v3 AUTH_SYS regards the UIDs you send as trusted if your source port is in the well-kown/Priviliged port range.
wolf480pl@mstdn.io
replied 20 Jan 2026 19:51 +0000
in reply to: https://benjojo.co.uk/u/benjojo/h/68534172TctqTdZDXz
@benjojo or you could pass the listen socket to them at startup from some privileged wrapper (xinetd, or systemd, or s6-tcpserver-sockedbinder, etc)
cvtsi2sd@hachyderm.i..
replied 20 Jan 2026 20:01 +0000
in reply to: https://mstdn.io/users/wolf480pl/statuses/115929165247226609
@wolf480pl @benjojo speaking of wrappers and well-known ports, I once discovered about the service assigned TCP port 1, and I'm still angry it never caught on.
benjojo
replied 20 Jan 2026 20:02 +0000
in reply to: https://hachyderm.io/users/cvtsi2sd/statuses/115929204803595875
wolf480pl@mstdn.io
replied 20 Jan 2026 20:02 +0000
in reply to: https://hachyderm.io/users/cvtsi2sd/statuses/115929204803595875
sully@splodge.fluff...
replied 20 Jan 2026 21:36 +0000
in reply to: https://benjojo.co.uk/u/benjojo/h/68534172TctqTdZDXz
@benjojo Brunel in the 90s controlled inbound access to tcp ports below 1024. The cheeky scamps running the student radio FreeBSD box didn't have sshd also listening on 2222, nooooooo
cks@mastodon.social
replied 21 Jan 2026 03:15 +0000
in reply to: https://benjojo.co.uk/u/benjojo/h/68534172TctqTdZDXz
@benjojo My biased view is that well known ports are a good thing but privileged ports are a hack (BSD acknowledged it at the time, even). I think the idea of well known ports predates the BSD hack, although the BSD hack likely influenced what ports were assigned. (These days, maybe it should all be implemented through DNS with a fallback to a default port. But then you have a default port and etc etc.)
penguin42@mastodon.o..
replied 21 Jan 2026 12:19 +0000
in reply to: https://mastodon.social/users/cks/statuses/115930911518436667
cks@mastodon.social
replied 21 Jan 2026 15:29 +0000
in reply to: https://mastodon.org.uk/users/penguin42/statuses/115933051072608210
penguin42@mastodon.o..
replied 21 Jan 2026 16:40 +0000
in reply to: https://mastodon.social/users/cks/statuses/115933796363536456