Bug 1199435 (CVE-2015-1799)

Summary: CVE-2015-1799 ntp: authentication doesn't protect symmetric associations against DoS attacks
Product: [Other] Security Response Reporter: Miroslav Lichvar <mlichvar>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: carnil, ffutigam, jrusnack, moshiro, redhat-bugzilla, rrosario, sardella, security-response-team, slawomir, tfrazier, vkaigoro, yozone
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A denial of service flaw was found in the way NTP hosts that were peering with each other authenticated themselves before updating their internal state variables. An attacker could send packets to one peer host, which could cascade to other peers, and stop the synchronization process among the reached peers.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-22 05:49:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1209578, 1215935, 1221564, 1221565    
Bug Blocks: 1193283, 1200382, 1210268    

Description Miroslav Lichvar 2015-03-06 09:38:41 UTC
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 10 Kurt Seifried 2015-04-07 16:30:39 UTC
Acknowledgement:

This issue was discovered by Miroslav Lichvár of Red Hat.

Comment 11 Kurt Seifried 2015-04-07 16:54:19 UTC
Moved all the chrony stuff to https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2015-1853

Comment 12 Kurt Seifried 2015-04-07 16:56:37 UTC
Created ntp tracking bugs for this issue:

Affects: fedora-all [bug 1209578]

Comment 13 Kurt Seifried 2015-04-08 16:00:53 UTC
This issue was fixed upstream:

http://support.ntp.org/bin/view/Main/SecurityNotice#Recent_Vulnerabilities

The updated version is available at:

http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p2.tar.gz

Comment 19 Fedora Update System 2015-04-22 22:55:42 UTC
ntp-4.2.6p5-22.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Fedora Update System 2015-04-22 22:55:58 UTC
ntp-4.2.6p5-30.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 22 Fedora Update System 2015-04-28 13:00:54 UTC
ntp-4.2.6p5-30.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Martin Prpič 2015-07-14 08:05:58 UTC
Mitigation:

To work around this issue, instead of configuring NTP hosts as peers with the 'peer' directive, use the 'server' directive on both hosts so that the connection uses a regular client/server mode of operation.

More information about how to configure NTP can be found at:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-Configuring_NTP_Using_ntpd.html

Autokey authentication between NTP peers is not sufficient to fully mitigate this issue.

Comment 25 errata-xmlrpc 2015-07-22 07:00:48 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

Via RHSA-2015:1459 https://rhn.redhat.com/errata/RHSA-2015-1459.html

Comment 30 errata-xmlrpc 2015-11-19 08:38:49 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2015:2231 https://rhn.redhat.com/errata/RHSA-2015-2231.html