Against All Odds: Exploiting a QNAP NAS
Stack-based buffer overflows were found in the upload handlers of QNAP File Station, with the most impactful in the upload_and_move function reachable by any low-privileged user. Because classic control-flow hijacking was blocked, the researchers pursued non-control-data exploitation instead.
Published on blog.syss.com
In this blog post, we take a look at a strcpy()-based overflow and non-control-data exploitation in a QNAP NAS.
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely an unchecked strcpy() of an attacker-controlled filename into a fixed-size stack buffer in the upload_and_move handler.
Impact
A low-privileged user could trigger memory corruption through the upload handler, though classic control-flow hijacking was blocked, so the practical impact depended on non-control-data exploitation.
What the attacker needed
Low-privileged account on the NAS; access to File Station upload feature
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 write-up has not been written yet. The Original tab links to the source.
A buffer overflow happens when a program copies more data into a fixed-size memory space than it can hold, so the extra data spills into neighbouring memory. Here the vulnerable code copies a filename into a small stack buffer without checking its length. The interesting part is that the usual trick of redirecting the program's execution was blocked, so the attackers had to corrupt ordinary data values instead.
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.