Post

Against All Odds: Exploiting a QNAP NAS

A stack-based buffer overflow in QNAP File Station’s upload_and_move function allows low-privileged users to achieve remote code execution. The vulnerability stems from unsafe strcpy() handling of multipart filenames without length validation. Traditional control-flow hijacking is blocked by ASLR, NX, and stack canaries, but the authors achieved RCE through non-control-data exploitation: corrupting adjacent stack objects to overwrite upload IDs, which are then used as source paths in root-privileged rename() and unlink() operations. This enables arbitrary file read and deletion, escalating to code execution. The vulnerability was discovered via AFL++ fuzzing directly on the target NAS, demonstrating RCE on default QTS 5.2.8.3359.

Read original article

This post is licensed under CC BY 4.0 by the author.