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.
Originally disclosed on Cisco Talos
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…
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
- Send the handshake bytes to the router's NetUSB service.
- Receive the encrypted response and send back the encrypted server data along with the computer name and sync command.
- Send a command with opcode 0x2 (getConfigDescriptor) and a malicious device index (e.g., 0x8a) to point to the computer name on the stack.
- 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.