Skip to content
Memory corruption Advisory Advanced CVE-2019-5016

KCodes NetUSB unauthenticated remote kernel arbitrary memory read vulnerability

The NetUSB.ko kernel module in NETGEAR routers does not validate a device index in a client command, allowing an unauthenticated attacker on the local network to cause an out-of-bounds memory read. This can lead to a denial of service (kernel panic) or disclosure of kernel memory.

Dave McDaniel Follow

Originally disclosed on Cisco Talos

Critical 10.0 View original

An exploitable arbitrary memory read vulnerability exists in the KCodes NetUSB.ko kernel module which enables the ReadySHARE Printer functionality of at least two NETGEAR Nighthawk Routers and potentially several other vendors/products. A specially crafted index value can cause an invalid memory read, resulting in a…

Dave McDaniel, 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 device index byte in the client command is used without validation to index into an array of session structures, leading to an out-of-bounds pointer dereference.

Impact

An unauthenticated attacker on the local network could cause a denial of service (kernel panic) or disclose kernel memory, potentially leading to further exploitation.

What the attacker needed

Attacker on the local network; no authentication required

The fix

The device index should be validated against the number of available devices before being used to access the session array.

How it was found

  1. Send the handshake bytes to the router's NetUSB service.
  2. Receive the encrypted response and send back the encrypted server data along with the computer name and sync command.
  3. Send a command with opcode 0x2 (getConfigDescriptor) and a malicious device index (e.g., 0x8a) to point to the computer name on the stack.
  4. The module dereferences the crafted pointer and copies memory contents into the response, which is sent back to the client.

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.

A router runs a small program in its core (the kernel) to share USB printers over the network. That program trusts a number sent by the client to pick a device from a list, but it never checks whether the number is valid. By sending a bad number, an attacker on the same network can make the router read memory it should not, which can crash the router or leak sensitive data.

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 Dave McDaniel

View all

23 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.

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.