Skip to content
DoS Advisory Intermediate CVE-2020-6060

Mini-SNMPD socket disconnect denial-of-service vulnerability

Mini-SNMPD 1.4 fails to properly remove closed TCP sockets from its client list, leaving a socket with file descriptor -1. When the server later calls FD_SET on this negative descriptor, it writes before the allocated stack array, triggering a stack buffer overflow and process termination.

Aleksandar Nikolic Follow

Originally disclosed on Cisco Talos

High 7.5 View original

A stack buffer overflow vulnerability exists in the way MiniSNMPD version 1.4 handles multiple connections. A specially timed sequence of SNMP connections can trigger a stack overflow, resulting in a denial of service.

Aleksandar Nikolic, 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 loop that removes disconnected sockets decrements the list length before comparing it to the loop counter, so when multiple sockets are closed, not all are removed and a socket with file descriptor -1 remains in the list.

Impact

A remote attacker could cause a denial of service by crashing the Mini-SNMPD process, as the stack buffer overflow is detected by the C library and terminates the program.

What the attacker needed

Network access to the Mini-SNMPD server

The fix

The loop should decrement the list length only after removing the socket and should not skip elements, ensuring no closed socket with file descriptor -1 remains.

How it was found

  1. Open four TCP connections to the Mini-SNMPD server.
  2. Close the first and third connections.
  3. The server's cleanup loop fails to remove all closed sockets, leaving one with file descriptor -1.
  4. On the next select loop, FD_SET is called with -1, causing a stack buffer overflow and crash.

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.

Mini-SNMPD is a small server program that listens for network connections. When several connections are closed at the same time, the program's cleanup code makes a mistake and leaves a closed connection in its list. Later, the program tries to use that closed connection's internal number (which is now -1) in a way that writes outside a small memory area on the stack, causing the program to crash. An attacker can trigger this just by opening several connections and closing some of them.

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 Aleksandar Nikolic

View all

147 more disclosed reports, 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.