This article points to systemd resolved to being the reason that this port is open locally, but this raises a question. If you have any port open and UFW firewall rules don't block ingress from localhost, it is possible that malware could be designed to connect to local ports on Linux. This was literally only a thought I had when I noticed this strange behavior, it seemed counter-intuitive that you could lock down all ports with UFW and yet you can connect to ports locally with netcat.
I googled this and found this fascinating article on blocking ports:
It doesn't say anything about blocking ports on localhost. I wonder if others have thought of this/does this look like an actual threat vector, or is this just a natural function of the design of systemd with no dangerous consequences? I am curious what others might think, because this seems like a possible security oversight if there is no way to block ports on localhost, but maybe I am missing something.
Thanks,
Michael Lazin
.. τὸ γὰρ αὐτὸ νοεῖν ἐστίν τε καὶ εἶναι.