Skip to content
Memory corruption Advisory Advanced CVE-2016-9032

Joyent SmartOS Hyprlofs FS IOCTL Native File System name Buffer Overflow Privilege Escalation Vulnerability

A stack buffer in the Hyprlofs ioctl handler is sized MAXPATHLEN, but the length check allows a name of exactly MAXPATHLEN bytes, so the terminating null byte is written one byte past the buffer. A local attacker with the required privilege could use this out-of-bounds write to potentially escalate privileges or cause a denial of service.

Tyler Bohan Follow

Originally disclosed on Cisco Talos

High 7.0 View original

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.

Tyler Bohan, 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 length validation uses a greater-than comparison against MAXPATHLEN instead of greater-than-or-equal, so a name of exactly MAXPATHLEN bytes passes and the null terminator is written one byte beyond the stack buffer.

Impact

A local attacker holding the Hyprlofs control privilege could potentially escalate privileges or cause a denial of service; the text hedges this as 'could result in potential privilege escalation'.

What the attacker needed

Local access to SmartOS; Hyprlofs control privilege

The fix

The length check should reject names of MAXPATHLEN bytes or more, or the buffer should be sized to leave room for the terminator.

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 program keeps a fixed-size space in memory for a file name. The code checks that the name is not longer than that space, but it forgets that it also needs room for the zero byte that marks the end of the text. So a name of exactly the maximum length pushes that final zero byte just past the space, corrupting nearby memory. Someone who can already run code on the machine may be able to turn that small corruption into more control over 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.

More by Tyler Bohan

View all

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