|
|
Log in / Subscribe / Register

Code cleanups don't solve NTP's security issues

Code cleanups don't solve NTP's security issues

Posted Feb 15, 2017 1:39 UTC (Wed) by gdt (guest, #6284)
Parent article: A rift in the NTP world

I'm a network engineer on a large internet network. NTP causes us problems, and has done so for decades.

Being able to list IP addresses in the configuration — rather than only DNS names — is a major misfeature. These IP addresses get hardcoded by device manufacturers and that IP address is then forever bound to provide NTP service. That's because of a second misfeature, where blocking NTP — even returning a ICMP Administratively Denied — causes more traffic than servicing NTP. It's reasonable to require people providing NTP infrastructure to also configure DNS, and this small hassle is worth the cost when they no longer wish to prove the service at that particular IP address.

The configuration file isn't really designed for the NTP pool. There's no way to apply a "restrict" statement to a pool DNS name. So most NTP deployments from Linux vendors are vulnerable out-of-the-box to allowing a subverted NTP pool machine to use those NTP clients in a DDoS multiplcation attack.

NTP needs the control channel moved to TCP, again to limit the ability of servers to launch traffic multiplication attacks.

I don't see NTPsec making these sort of changes, so I'd question the "sec" appellation.


to post comments

Code cleanups don't solve NTP's security issues

Posted Feb 15, 2017 2:09 UTC (Wed) by pizza (subscriber, #46) [Link] (5 responses)

> Being able to list IP addresses in the configuration — rather than only DNS names — is a major misfeature.

I disagree. Forcing use of DNS names makes you reliant on DNS, which:

* requires that there be a DNS server, and that it be accessible.
* opens you up to dns hijacking should said DNS server (and all intermediate resolvers) not be under your direct control. It may prevent use of DNSSEC (as the local resolver's clock needs to be at least in the same ballpark as the server's)

..As an end-user and administrator of small (<50 user) networks, I've been bitten by all of these situations.

Code cleanups don't solve NTP's security issues

Posted Feb 15, 2017 2:16 UTC (Wed) by pizza (subscriber, #46) [Link] (4 responses)

Oh, one more thing that I accidently left out -- DHCP's 'time-server' attributes are specified in terms of IP addresses.

So you're always going to need to handle NTP client configuration in terms of IP addresses.

Code cleanups don't solve NTP's security issues

Posted Feb 15, 2017 19:25 UTC (Wed) by dwh (guest, #114129) [Link]

FYI, most (all?) DHCP server implementations accept time-server configuration in DNS name format, and perform the DNS lookup on behalf of the client.

So while the wire format DHCP protocol contents is 4-octet network byte order IPv4 or 16-octet network byte order IPv6 addresses, their contents are the result of DNS resolution and caching by the DHCP/DHCPv6 server; DNS remains the source of truth and clients receive updated results as they renew their leases (or abandon stale configuration when leases expire).

This is even when the DHCPv6 server offers IPv6 address(es), IPv6 multicast address(es), and also FQDN(s) all together for some reason that can never be adequately explained (RFC 5908).

Code cleanups don't solve NTP's security issues

Posted Feb 16, 2017 5:04 UTC (Thu) by gdt (guest, #6284) [Link] (2 responses)

DHCP using IP addresses is fine. That's a mechanism an administrator can use to modify the NTP server used by the appliance's software. My concern is appliances where the IP addresses used are baked in.

Code cleanups don't solve NTP's security issues

Posted Feb 16, 2017 14:21 UTC (Thu) by pizza (subscriber, #46) [Link] (1 responses)

> My concern is appliances where the IP addresses used are baked in.

It seems misguided to blame NTPd-the-project when the fault lies entirely with the idiots who shipped consumer gear with hardcoded, bad configurations.

(From NTPd's perspective, there's no way to tell a difference between "bad" and "good" here; that's entirely the integrator/administrator's purview)

Code cleanups don't solve NTP's security issues

Posted Feb 16, 2017 14:37 UTC (Thu) by pizza (subscriber, #46) [Link]

Oh, and my comments are even more applicable to NTP-the-protocol.

Code cleanups don't solve NTP's security issues

Posted Feb 15, 2017 19:02 UTC (Wed) by biergaizi (guest, #92498) [Link] (3 responses)

> Being able to list IP addresses in the configuration — rather than only DNS names — is a major misfeature. These IP addresses get hardcoded by device manufacturers.

It is a separate issue, the issue of human, and it is not related to this post. Having a different NTP implementation won't make any differences, current NTPd has nothing wrong. Having a different protocol may have no use neither. It is much harder to solve all these problems than your imagine.

Usually, if a device comes with hardcoded NTP addresses, it, in fact, usually indicates their program is poorly-written, and the manufacturers are irresponsible.

Those devices have the worst homebrew NTP implementation on the planet,

1. They send ancient NTPv1 packets, while the latest version is NTPv4.
2. They synchronize their time on the beginning of an hour, effectively making a flooding attack. Another larger flooding attack starts at 00:00 UTC.
3. They retry interval is around 3 minutes, if fails to reach the server, make even more traffic to the server, rather than an exponentially-increase interval.
4. They still try to talk to the default hardcoded servers, even if an alternative server list is set.
5. They don't support the Kiss of Death packet, nothing can stop them if they became wild.

ST-1 servers are the most vulnerable: they have highest accuracy, with reference clock. Despite the acceptable usage of ST-1 are passing time to downstream, or for scientific purposes, since there's only a handful of them and often listed publicly, they are often spotted by those manufacturers, and put in their devices by default.

ST-1 are usually provided by universities, or unpaid volunteers for the public good of the Internet. If a single server got hardcoded in those mass-manufactured devices, serious consequences can happen, the volunteer may literally bankrupt: your whole institute/school will be kicked out from the Internet [0]; when you came to the manufacture asking to pay the damage they are responsible for, you are threatened by a lawyer from California. [1] The whole Internet community should honor the spirit of self-sacrifice of these NTP volunteers.

Most of the NTP pool servers has similar issues, once you're in and became well-known on the net, there's no way out and keep receiving bad-traffic. Fortunately given a reasonable bandwidth, it is often a negligible issue though. But not as always. [2]

> That's because of a second misfeature, where blocking NTP — even returning a ICMP Administratively Denied — causes more traffic than servicing NTP.

In contrast, NTPd has proper rate-limit mechanism built-in, such as KoD and good pooling interval, blocking NTP does NOT causes more user traffic. What increased is the abuser traffic. The damage caused by a standard NTPd and silly sysadmin is much less significant and is negligible compared to the Internet of Scary Things.

By the way, not only hardware devices can contains dangerous NTP code, but also software.

As long as manufactures still write broken code and unaware of the proper way to use NTP, nothing can be done to solve this issue. Many involved in these misuses and abuses are totally unaware what they are doing. The proper way to use of NTP should have been written in all textbooks related to practical networking lectures.

NTPd does has issues, it has legacy code issues, it has vulnerabilities, it is not so actively maintained, and previously it has reflection attack issues, but the issue you mentioned is human issue, not NTPd issues. We still have reflection attack issues, though it has been fixed, it is still another human issue.

[0]: Flawed Routers Flood University of Wisconsin Internet Time Server
http://pages.cs.wisc.edu/~plonka/netgear-sntp/

[1]: Open Letter to D-Link about their NTP vandalism
https://web.archive.org/web/20060423012837/http://people....

[2]: Recent NTP pool traffic increase
https://mailman.nanog.org/pipermail/nanog/2016-December/0...

Tom.

Code cleanups don't solve NTP's security issues

Posted Feb 16, 2017 6:03 UTC (Thu) by gdt (guest, #6284) [Link] (2 responses)

In contrast, NTPd has proper rate-limit mechanism built-in, such as KoD and good pooling interval, blocking NTP does NOT causes more user traffic.

We had issues in 2003 with SMC routers, and blocking that traffic lead to a multiplication of incoming traffic. The KoD option didn't arrive in servers until later, and then not in clients for years after that. So we had to specially engineer the network for ntpd until most of the purchasers of those routers retired them.

It would be very useful if issuing a ICMP Administratively Denied prevented retries. The ACL is unlikely to suddenly disappear, so it would be safe to disable the association entirely. It's much easier for a network to issue a ICMP than to deploy an anycast edge of ntpd servers to issue KoD replies.

Please note that "we've fixed it now" is desirable but not immediately useful for operating a network. We'll probably have to run special queuing for ntpd UDP control plane traffic for the next decade. So there might be only a few years where the network hasn't been running without a special fix for some ntpd issue. As you can see, the timescales in network operations are much longer than the timescales in development: you are at the leading edge of deployment, we have to deal with the trailing edge of deployments.

That's why I say that the total security picture is important, human factors and all. It's better to avoid issues than to fix them.

We not adverse to change. It would be useful if the major NTP authors formed a small cabal and had an approximate date where they all make a new release which moves the control channel to TCP (or even to TLS if you think that is wise).

Code cleanups don't solve NTP's security issues

Posted Feb 16, 2017 7:15 UTC (Thu) by akkornel (subscriber, #75292) [Link] (1 responses)

The issue I see with relying on DNS is, if DNSSEC becomes more used, then having NTP require DNS won't work well, as DNS would require NTP to verify signatures. You could bypass DNSSEC verification just for the NTP IP lookup, but that seems dangerous to me. Similarly, using TLS would also be problematic, as you need to already have good time in order to verify TLS certificate dates.

So much of security today relies on each party in the exchange having the same, or similar, time.

If changes are being proposed, I would suggest relying on capabilities that already exist within DHCP:

1: ISPs which provide DHCP service should run at least three NTP server, and must include those NTP server IPs in all DHCP offers. Smaller ISPs may make arrangements with a higher-tier ISP, or other entity, if they're unable to run their own NTP servers. ISPs which do not provide DHCP service are exempt, although they may wish to provide NTP service for their customer ISPs.

2a: Router vendors must each obtain a vendor zone from the NTP Pool project, and configure that as their NTP servers for their router software. For example, 0.linksys.pool.ntp.org, 1.linksys.pool.ntp.org, and 2.linksys.pool.ntp.org would be the default NTP servers for a Linksys router.

2b: When the router receives one or more NTP server IP addresses in a DHCP offer, if the router accepts the DHCP offer, then the router must replace its existing NTP server entries with the NTP server IP addresses received in the DHCP offer: For each IP received in the DHCP offer, replace one of the pre-configured NTP servers.

2c: If the router provides DHCP (for example, to its local network), and the router received NTP server IP addresses from upstream, then the router must provide those NTP server IP addresses in all DHCP offers that the router makes to local machines.

Item 1 would be agreed upon and implemented by the ISPs. Those ISPs would then lean on their router suppliers, to ensure that the routers sold/rented/leased/whatever by the ISPs met all of the requirements of point 2. From there things could slowly flow to the remaining consumer router market. Some OSes are able to support getting NTP servers from DHCP; as more routers begin to provide them, OSes will begin to use them.

This would allow devices to get NTP servers from a "trusted" source (the same source giving them their IP address), and helps to localize NTP traffic to within an ISP (or an ISP's ISP). It also eliminates the reliance on things like DNS and TLS, with one exception: As DNS embraces DNSSEC more and more, point 2a will stop working. Point 2a is only a stopgap, so that router vendors will have something to put in default configs.

Code cleanups don't solve NTP's security issues

Posted Feb 16, 2017 8:06 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link]

There has been an idea to add a timestamp to DHCP replies. That would easily allow ~1s precision - more than enough to bootstrap DNSSEC and then acquire reliable NTP.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds