NTP users are strongly urged to take immediate action to ensure that their NTP daemons are not susceptible to being used in distributed denial-of-service (DDoS) attacks. Please also take this opportunity to defeat denial-of-service attacks by implementing Ingress and Egress filtering through BCP38.

ntp-4.2.8p18 was released on 25 May 2024 and addresses 40 bugs and provides 40 improvements.

Please see the NTP 4.2.8p18 Changelog for details.

Bug 2781 - authentication doesn't protect symmetric associations against DoS attacks
Summary: authentication doesn't protect symmetric associations against DoS attacks
Status: VERIFIED FIXED
Alias: None
Product: ntp
Classification: Unclassified
Component: ntpd (show other bugs)
Version: 4.2.8
Hardware: PC All
: P2 normal
Assignee: Harlan Stenn
URL:
Depends on: 2779
Blocks:
  Show dependency tree
 
Reported: 2015-03-04 09:46 UTC by Harlan Stenn
Modified: 2024-07-23 18:14 UTC (History)
6 users (show)

See Also:
stenn: blocking4.2.8+


Attachments
Proposed patch to not update state variables when authentication fails (1.02 KB, patch)
2015-03-06 09:23 UTC, Miroslav Lichvar
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harlan Stenn 2015-03-04 09:46:01 UTC

    
Comment 1 Harlan Stenn 2015-03-04 09:49:01 UTC
Removing bugs@, adding security@
Comment 2 Miroslav Lichvar 2015-03-06 09:21:37 UTC
authentication doesn't protect 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 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. This is a known denial-of-service attack, described at [1].

According to the document the NTP authentication is supposed to protect symmetric associations against this attack, but that doesn't seem to be the case. The state variables are updated even when authentication fails and the peers are sending packets with originate timestamps that don't match the transmit timestamps on the receiving side.

This seems to be a very old problem, it's in the oldest ntp version I could find (xntp3.3wy). It's also in the NTPv3 (RFC 1305) and NTPv4 (RFC 5905) specifications, so other NTP implementations with support for symmetric associations and authentication may be vulnerable too.

For authentication using symmetric keys it should be sufficient to move the code updating the state variables after the MAC is validated (TEST5). For autokey that's not enough, it seems the attacker can still reset the protocol with crypto-NAK or CRYPTO_ASSOC messages and possibly other ways. I'm not sure if this can be fixed for autokey in general.

[1] https://www.eecis.udel.edu/~mills/onwire.html
Comment 3 Miroslav Lichvar 2015-03-06 09:23:44 UTC
Created attachment 1210 [details]
Proposed patch to not update state variables when authentication fails
Comment 4 Harlan Stenn 2015-03-06 10:25:31 UTC
As Miroslav notes, we'll need to issue an errata against the RFCs.
Comment 5 Harlan Stenn 2015-04-07 09:35:32 UTC
Fixed in 4.2.8p2 and 4.3.14.
Comment 6 Harlan Stenn 2015-04-08 09:17:44 UTC
Miroslav is happy with the fix.
Comment 7 venkat 2015-05-19 12:22:00 UTC
It was mentioned that this issue can impact NTPv3 also. However attached patch does not seem to be relevant xntp 3.5 because corresponding code is not there, which is peer->xmt = p_xmt;

Can you please let me know if a patch/fix is available for xntp 3.5

Thanks.
Comment 8 Danny Mayer 2015-05-19 15:41:16 UTC
(In reply to comment #7)
> It was mentioned that this issue can impact NTPv3 also. However attached patch
> does not seem to be relevant xntp 3.5 because corresponding code is not there,
> which is peer->xmt = p_xmt;
> 
> Can you please let me know if a patch/fix is available for xntp 3.5
> 
> Thanks.

NTP 3.5 has not been supported for many years. You should upgrade to the latest version of NTP which is currently 4.2.8p2. Is there a reason to fix 3.5 instead of upgrading to the latest version which can at least be supported?

Danny
Comment 9 venkat 2015-05-20 04:51:58 UTC
Thanks Danny for quick response. 

We have commitment to support it for some more time in our products.

If possible can you please help :
- how to know if 3.5 is impacted
- is there any fix available

Thanks for help.
Comment 10 Danny Mayer 2015-05-20 20:38:27 UTC
(In reply to comment #9)
> Thanks Danny for quick response. 
> 
> We have commitment to support it for some more time in our products.
> 
> If possible can you please help :
> - how to know if 3.5 is impacted
> - is there any fix available
> 
> Thanks for help.

That version of NTP is something like 20 years old. If you have committed to support the same version what prevents you from providing the upgrade to the latest version? Support could be available for this ancient version but it could not be done for free.

Danny