NTP BUG 2937: nextvar() missing length check in ntpq
Last update: April 22, 2024 18:49 UTC (7e7bd5857)
Summary
Description
ntpq
may call nextvar()
which executes a memcpy()
into the name buffer without a proper length check against its maximum length of 256 bytes. Note well that we’re taking about ntpq
here. The usual worst-case effect of this vulnerability is that the specific instance of ntpq
will crash and the person or process that did this will have stopped themselves.
Mitigation
- Upgrade to 4.2.8p6 or later.](https://downloads.nwtime.org/ntp/4.2.8/)
- If you are unable to upgrade:
- If you have scripts that feed input to
ntpq
make sure there are some sanity checks on the input received from the “outside”.
- This is potentially more dangerous if
ntpq
is run as root.
Credit
This weakness was discovered by Jonathan Gardner of Cisco ASIG.
Timeline