Skip to content
DoS Advisory Intermediate CVE-2015-7978

Network Time Protocol Private Mode 'reslist' Stack Memory Exhaustion Vulnerability

The ntpd daemon's handling of the ntpdc reslist command uses recursion to traverse the restrict list, which can exhaust the call stack if the list is large enough. An unauthenticated attacker who can increase the restrict list size could crash ntpd.

Stephen Gray Follow

Originally disclosed on Cisco Talos

An unauthenticated ntpdc reslist command can cause a segmentation fault in ntpd by exhausting the call stack.

Stephen Gray, on Cisco Talos

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The functions list_restrict4() and list_restrict6() traverse the restrict list recursively instead of iteratively, so a long list exhausts the call stack.

Impact

An attacker who can increase the size of the restrict list on a server with request mode enabled could crash ntpd, causing a denial of service.

What the attacker needed

Mode 7 must be enabled (disabled by default); Restrict list must be large enough to exhaust stack; Attacker must be able to increase restrict list size

The fix

The code should be changed to use iteration instead of recursion, or to limit the recursion depth.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

The NTP daemon (ntpd) has a feature that lets administrators query its access restrictions. When displaying the list, the code calls itself repeatedly for each entry (recursion). If the list is very long, this repeated calling uses up all the memory reserved for function calls (the call stack), causing the program to crash. An attacker who can make the list long enough could crash the server without logging in.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by Stephen Gray

View all

1 more disclosed report, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.