5 ms·
> it's been running on many VMs without exploding memory for a while now Most of the security bugs we hear about don't cause random crashes on otherwise health
by oconnor663 2y ago
> it's been running on many VMs without exploding memory for a while now
Most of the security bugs we hear about don't cause random crashes on otherwise healthy machines, because that tends to get them noticed and fixed. It's the ones that require complicated steps to trigger that are really scary. When I look at NTP, I see a service that:
- runs as root
- talks to the network
- doesn't usually authenticate its traffic
- uses a bespoke binary packet format
- almost all network security depends on (for checking cert expiration)
That looks to me like an excellent candidate for a memory-safe reimplementation.
- cogman10 2y ago> runs as root ntpd can (and should) run as a user > talks to the network Makes outbound requests to the network. For it to be compromised, the network itself or a downstream server needs to be compromised. That's very different from something like hosting an http server. > doesn't usually authenticate its traffic Yes it does. ntp uses TLS to communicate with it's well known locations. > uses a bespoke binary packet format Not great but also see above where it's talking to well known locations authenticated and running as a user. It's a service that to be compromised requires state level interference.
- franga2000 2y ago> It's a service that to be compromised requires state level interference For servers it's definitely harder, although definitely not only state-level, but another big issue could be client-side. NTP servers can be set by DHCP, so the admin of any network you connect to could exploit such a bug against you. And once you have code execution on a desktop OS, all bets are off, even if you're not under the primary UID. It's not the most important threat vector, but it also doesn't seem as difficult as some of the other system services to rewrite, so I'd say it was a good first step for the memory-safe-everything project.
- woodruffw 2y agoI don’t think NTP uses TLS by default. The closest equivalent I can find online is NTS, which was only standardized in 2020 (and for which I can’t find clear adoption numbers). (But regardless: “the transport layer is secure” is not a good reason to leave memory unsafe code on the network boundary. Conventional wisdom in these settings is to do the “defense in depth” thing and assume that transport security can be circumvented.)
- mcpherrinm 2y agontpd-rs supports NTS and we (Let’s Encrypt) are using it a little bit. But it is far from having any wide adoption yet. There aren’t many public NTS servers: https://netfuture.ch/public-nts-server-list/ https://netfuture.ch/public-nts-server-list/ and https://github.com/jauderho/nts-servers https://github.com/jauderho/nts-servers have some listed.
- kortilla 2y agoNtp does not use TLS widely. It’s also a UDP protocol which makes it subject to spoofing attacks without a compromised network (no protection from kernel network stack verifying TCP sequence numbers).
- wbl 2y agoThe network is just a bunch of strangers in a meet me room.
- adolph 2y ago>> doesn't usually authenticate its traffic > Yes it does. ntp uses TLS to communicate with it's well known locations. My knee-jerk reaction is that TLS is not authentication. After skimming through the relevant spec [0], it is interesting how NTP uses TLS. [NTS-KE] uses TLS to establish keys, to provide the client with an initial supply of cookies, and to negotiate some additional protocol options. After this, the TLS channel is closed with no per-client state remaining on the server side. [0] 0. https://datatracker.ietf.org/doc/html/rfc8915 https://datatracker.ietf.org/doc/html/rfc8915