]> git.ipfire.org Git - thirdparty/chrony.git/commit
ntp: protect authenticated symmetric associations against DoS attacks
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 5 Mar 2015 11:44:30 +0000 (12:44 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 7 Apr 2015 14:34:42 +0000 (16:34 +0200)
commitd856bd34c4862398411d29200520e3a3b1d4569e
tree5753855bf7a4c641e5ed1f937ba4852647a45221
parentebab36e8597c0590b6ad1ad03298c7c2a13cc757
ntp: protect authenticated symmetric associations against DoS attacks

An attacker knowing that NTP hosts A and B are peering with each other
(symmetric association) can send a packet with random timestamps to host
A with source address of B which will set the NTP state variables on A
to the values sent by the attacker. Host A will then send on its next
poll to B a packet with originate timestamp that doesn't match the
transmit timestamp of B and the packet will be dropped. If the attacker
does this periodically for both hosts, they won't be able to synchronize
to each other. It is a denial-of-service attack.

According to [1], NTP authentication is supposed to protect symmetric
associations against this attack, but in the NTPv3 (RFC 1305) and NTPv4
(RFC 5905) specifications the state variables are updated before the
authentication check is performed, which means the association is
vulnerable to the attack even when authentication is enabled.

To fix this problem, save the originate and local timestamps only when
the authentication check (test5) passed.

[1] https://www.eecis.udel.edu/~mills/onwire.html
ntp_core.c