libwebsockets MQTT Protocol PUBACK Packet Handling Out-Of-Bounds Write Remote Code Execution Vulnerability
The MQTT handling code in libwebsockets did not properly validate data in PUBACK packets, allowing a write past the end of an allocated buffer. A remote unauthenticated attacker could exploit this to execute code in the context of the current process.
This vulnerability allows remote attackers to execute arbitrary code on affected installations of libwebsockets. Authentication is not required to exploit this vulnerability.
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 PUBACK packet handler trusted a length or field from the incoming packet without checking it against the size of the destination buffer before writing.
Impact
A remote, unauthenticated attacker could execute arbitrary code in the context of the current process.
What the attacker needed
Network access to the MQTT service; no authentication required
The fix
The vendor issued an update to correct the vulnerability.
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 buffer is a fixed-size area of memory. If a program writes more data into it than it can hold, the extra data spills over into neighbouring memory, which is called an out-of-bounds write. Here, a network message called a PUBACK was not checked properly, so an attacker could send crafted data and potentially take over 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.