Joyent SmartOS Hyprlofs FS IOCTL Native File System path Buffer Overflow Privilege Escalation Vulnerability
A buffer overflow in the Hyprlofs file system's ioctl handler allows a local attacker to write a null byte out of bounds by supplying a path length exactly equal to MAXPATHLEN. This could lead to privilege escalation or denial of service.
Originally disclosed on Cisco Talos
An exploitable buffer overflow exists in the the Joyent SmartOS OS 20161110T013148Z Hyprlofs file system. The vulnerability is present in the Ioctl system call with the command HYPRLOFSADDENTRIES when dealing with native file systems.
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
Impact
This could potentially lead to privilege escalation or be used as a denial of service.
What the attacker needed
Local access to SmartOS; ability to call ioctl on Hyprlofs
How it was found
- Open a file descriptor to the Hyprlofs file system.
- Call ioctl with the HYPRLOFS_ADD_ENTRIES command and provide an entry with hle_plen equal to MAXPATHLEN.
- The kernel copies the path into a stack buffer and writes a null byte at index MAXPATHLEN, one byte past the buffer.
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 overflow happens when a program writes more data into a fixed-size memory area than it can hold, causing data to spill into adjacent memory. Here, a length check is off by one, so a path of exactly the maximum allowed length causes a single null byte to be written just past the end of a stack buffer. This can corrupt memory and potentially let an attacker gain higher privileges or crash the system.
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.