Bug 1434014 (CVE-2017-6460)

Summary: CVE-2017-6460 ntp: Buffer Overflow in ntpq when fetching reslist from a malicious ntpd
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: linville, mlichvar, sardella, security-response-team, slawomir
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ntp 4.2.8p10, ntp 4.3.94 Doc Type: If docs needed, set a value
Doc Text:
A vulnerability was found in NTP, in the ntpq program. A malicious server could send a specially crafted response which would cause a stack buffer overflow, leading to a crash or potential code execution.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-30 06:06:19 UTC Type: ---
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:    
Bug Blocks: 1434021    

Description Adam Mariš 2017-03-20 14:35:49 UTC
A stack buffer overflow in ntpq can be triggered by a malicious ntpd server when ntpq requests the restriction list from the server. This is due to a missing length check in the reslist() function. It occurs whenever the function parses the server's response and encounters a flagstr variable of an excessive length. The string will be copied into a fixed-size buffer, leading to an overflow on the function's stack-frame. Note well that this problem requires a malicious server, and affects ntpq, not ntpd.

Affects: All versions of ntpq, up to but not including ntp-4.2.8p10, and ntp-4.3.0 up to, but not including ntp-4.3.94.

Comment 1 Adam Mariš 2017-03-20 14:35:54 UTC
Acknowledgments:

Name: the NTP project
Upstream: Cure53

Comment 4 Adam Mariš 2017-03-23 10:08:59 UTC
Created ntp tracking bugs for this issue:

Affects: fedora-all [bug 1435163]

Comment 5 Doran Moppert 2017-03-30 06:05:52 UTC
This flaw affects the mode6 reslist command, which is not supported by ntp-4.2.6p5 or earlier in Red Hat Enterprise Linux or Fedora <= 25.