Skip to content
Memory corruption Advisory Advanced

GHSL-2020-051, GHSL-2020-052: Multiple vulnerabilities in NTOP nDPI

The nDPI SSH dissector has integer overflow vulnerabilities that allow a remote attacker to control a heap overflow and potentially achieve remote code execution. A related out-of-bounds read can cause denial of service.

anticomputer Follow

Originally disclosed on GitHub Security Lab

The NTOP Deep Packet Inspection Toolkit is driven in large part by the nDPI library. This library contains a large set of network protocol dissectors intended to parse and analyze packet-captured network traffic.

anticomputer, on GitHub Security Lab

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

Likely, the code uses a 16-bit offset variable that can be integer-overflowed by a 32-bit length from the packet, bypassing bounds checks and allowing out-of-bounds writes and reads.

Impact

These issues may lead to Remote Code Execution in the case of GHSL-2020-051 and Denial of Service in the case of GHSL-2020-052.

What the attacker needed

Network traffic inspected by nDPI; attacker can send crafted SSH packets

The fix

The issues were fixed in a commit by the maintainer.

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.

When nDPI inspects SSH traffic, it reads length values from the packet and uses them to copy data into a buffer. Because it does not properly check these lengths, an attacker can send a crafted packet that makes the program write beyond the buffer, potentially taking control of the system. A separate flaw lets an attacker read beyond the buffer, which can crash the program.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by anticomputer

View all

4 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.