Vulnerabilities > CVE-2017-2890 - OS Command Injection vulnerability in Meetcircle Circle With Disney Firmware 2.0.1

047910
CVSS 8.8 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
LOW
Confidentiality impact
HIGH
Integrity impact
HIGH
Availability impact
HIGH
network
low complexity
meetcircle
CWE-78

Summary

An exploitable vulnerability exists in the /api/CONFIG/restore functionality of Circle with Disney running firmware 2.0.1. Specially crafted network packets can cause an OS command injection. An attacker can send an HTTP request trigger this vulnerability.

Vulnerable Configurations

Part Description Count
OS
Meetcircle
1
Hardware
Meetcircle
1

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Command Line Execution through SQL Injection
    An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.
  • Command Delimiters
    An attack of this type exploits a programs' vulnerabilities that allows an attacker's commands to be concatenated onto a legitimate command with the intent of targeting other resources such as the file system or database. The system that uses a filter or a blacklist input validation, as opposed to whitelist validation is vulnerable to an attacker who predicts delimiters (or combinations of delimiters) not present in the filter or blacklist. As with other injection attacks, the attacker uses the command delimiter payload as an entry point to tunnel through the application and activate additional attacks through SQL queries, shell commands, network scanning, and so on.
  • Exploiting Multiple Input Interpretation Layers
    An attacker supplies the target software with input data that contains sequences of special characters designed to bypass input validation logic. This exploit relies on the target making multiples passes over the input data and processing a "layer" of special characters with each pass. In this manner, the attacker can disguise input that would otherwise be rejected as invalid by concealing it with layers of special/escape characters that are stripped off by subsequent processing steps. The goal is to first discover cases where the input validation layer executes before one or more parsing layers. That is, user input may go through the following logic in an application: In such cases, the attacker will need to provide input that will pass through the input validator, but after passing through parser2, will be converted into something that the input validator was supposed to stop.
  • Argument Injection
    An attacker changes the behavior or state of a targeted application through injecting data or command syntax through the targets use of non-validated and non-filtered arguments of exposed services or methods.
  • OS Command Injection
    In this type of an attack, an adversary injects operating system commands into existing application functions. An application that uses untrusted input to build command strings is vulnerable. An adversary can leverage OS command injection in an application to elevate privileges, execute arbitrary commands and compromise the underlying operating system.

Seebug

bulletinFamilyexploit
description### Summary An exploitable vulnerability exists in the /api/CONFIG/restore functionality of Circle with Disney running firmware 2.0.1. Specially crafted network packets can cause an OS command injection. An attacker can send an HTTP request trigger this vulnerability. ### Tested Versions Circle with Disney 2.0.1 ### Product URLs https://meetcircle.com/ ### CVSSv3 Score 9.9 - CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H ### CWE CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') ### Details The vulnerable code exists in the restore api handler of the "apid" deamon ("/api/CONFIG/restore"), function `sub_417528`: ``` .text:004176A4 loc_4176A4: .text:004176A4 lw $v0, (dword_44CB3C - 0x450000)($v0) .text:004176A8 nop .text:004176AC beqz $v0, loc_4177A8 .text:004176B0 li $v0, 1 .text:004176B4 beq $s4, $v0, loc_417860 .text:004176B8 lui $a0, 0x43 .text:004176BC jal strlen .text:004176C0 addiu $a0, $s6, (byte_44CC40 - 0x450000) .text:004176C4 sltiu $v0, 0x14 .text:004176C8 bnez $v0, loc_4177A8 .text:004176CC lui $v0, 0x45 .text:004176D0 la $v0, byte_44CC40 # appid .text:004176D4 sw $v0, 0x200+var_1F0($sp) .text:004176D8 lui $a2, 0x43 .text:004176DC li $v0, 0x42 .text:004176E0 lui $a3, 0x43 .text:004176E4 addiu $a0, $sp, 0x200+var_148 .text:004176E8 li $a1, 0x80 .text:004176EC la $a2, aSrestore_backu # "%srestore_backup.sh /tmp/postfile.bin %s %d" .text:004176F0 la $a3, aMntSharesUs_19 # "/mnt/shares/usr/bin/scripts/" .text:004176F4 jal snprintf .text:004176F8 sw $v0, 0x200+var_1EC($sp) .text:004176FC jal system .text:00417700 addiu $a0, $sp, 0x200+var_148 ``` Looking at the pseudocode of the whole function, we see the following: ``` if (memcmp(request_url, "/api/CONFIG/restore", 18) == 0) if (stat("/mnt/shares/usr/bin/app_list") == 0) if (auth_token[0] != 0 && check_token(auth_token)) if (strlen(appid) > 20) { snprintf(cmd, 128, "%srestore_backup.sh /tmp/postfile.bin %s %d", "/mnt/shares/usr/bin/scripts/", appid, 66); system(cmd); } ``` As we can see the `appid` parameter, coming from the user as a multipart parameter, is passed direcly to `system` call without any sanitization leading in that way to command injection. This API is accessible for authenticated users. ### Timeline * 2017-08-29 - Vendor Disclosure * 2017-10-31 - Public Release
idSSV:96812
last seen2017-11-19
modified2017-11-08
published2017-11-08
reporterRoot
sourcehttps://www.seebug.org/vuldb/ssvid-96812
titleCircle with Disney Restore API Command Injection Vulnerability(CVE-2017-2890)

Talos

idTALOS-2017-0397
last seen2019-05-29
published2017-10-31
reporterTalos Intelligence
sourcehttp://www.talosintelligence.com/vulnerability_reports/TALOS-2017-0397
titleCircle with Disney Restore API Command Injection Vulnerability