An exploitable configuration modification vulnerability exists in the control mode (mode 6) functionality of ntpd. A specially crafted control mode packet can set ntpd traps, providing information disclosure and DDoS amplification, and unset ntpd traps, preventing legitimate monitoring. A remote, unauthenticated, network attacker can trigger this vulnerability.
CVSSv2: 6.4 - (AV:N/AC:L/Au:N/C:P/I:P/A:N)
CVSSv3: 6.5 - CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
ntpd provides a
trap functionality that sends asynchronous notifications to a number of
trap receivers whenever an event of interest occurs. Example events of interest include: association mobilization and demobilization, authentication failures, reachability changes, etc.
Since at least ntp-4.0.94 (July 21, 1999), ntpd has allowed traps to be configured via control (mode 6) and private (mode 7) NTP modes. Though private mode requires messages modifying trap settings to be be authenticated, control mode allows unauthenticated packets to modify trap settings using the
UNSETTRAP control messages.
This vulnerability can be used to achieve several goals:
restrict notrap), the attacker can instruct a victim ntpd instance to send traps to the attacker’s host. Whenever a reportable event occurs for some peer, the victim ntpd will send a trap to the attacker leaking all the peer variables associated with that peer. The information leaked includes the peer’s org and rec variables allowing the attacker to bypass TEST2 and impersonate said peer in a manner similar to CVE-2015-8139 and CVE-2016-1548.
The attacker can force the victim ntpd to leak the information for any peer at any time by triggering a reportable event for said peer. There are multiple methods to trigger a reportable event for a peer, among them spoofing an invalid crypto-NAK or incorrectly authenticated packet from the peer.
NOTE: With ntp-4.2.8p8 and earlier the 0rigin attack (CVE-2015-8138)  already allows impersonation of reachable peers. In those ntpd versions, this vulnerability provides another method for impersonating unreachable peers.
The attacker forges a
SETTRAP packet from the
victim to the
amplifier, causing the
amplifier to set a trap for the
victim. The attacker then repeatedly triggers reportable events causing trap messages to be sent to the victim. E.g. the attacker rapidly forges invalid crypto-NAKs and/or bad_auth packets from the
ntpd attempts to limit the number of consecutive traps sent for events of a single type. To maximize effect, the attacker can alternate between events of different types.
ntpd will periodically time out old traps when a new one is set. Therefore, for a long-term attack, the attacker may need to periodically refresh the trap on the
trap receiverin an
Authentication should be required in order to modify trap configuration.
Several mitigations can lessen the impact of this vulnerability.
restrict default notraprestriction. This setting is the default on many modern Linux systems.
This mitigation has no effect on the “Evading Monitoring” impact described above because the alleged sender of the packet is an authorized trap receiver.
Block NTP control mode trap configuration commands using a firewall or IPS. It does not appear that support for configuring control mode traps was ever implemented in ntpq, the reference NTP control mode client. As such, on most networks blocking control mode trap configuration commands should have no effect on legitimate traffic. Specifically, firewalls should block packets with the following characteristics:
Traps specified in ntp.conf cannot be modified using this vulnerability.
2016-09-20 - Vendor Disclosure
2016-11-21 - Public Release
Discovered by Matthew Van Gundy of Cisco ASIG.
Vulnerability Reports Next Report