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

047910
CVSS 9.0 - CRITICAL
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
SINGLE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
network
low complexity
meetcircle
CWE-78
critical

Summary

An exploitable vulnerability exists in the /api/CONFIG/backup functionality of Circle with Disney. Specially crafted network packets can cause an OS command injection. An attacker can send an HTTP request to 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/backup functionality of Circle with Disney. 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 ### 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 Vulnerable code exists in the backup api handler of the apid deamon ("/api/CONFIG/backup"). ``` vulnerable code listing .text:00415E10 loc_415E10: .text:00415E10 lui $s0, 0x43 .text:00415E14 jal unlink .text:00415E18 addiu $a0, $s0, (aMntSharesUs_15 - 0x430000) # "/mnt/shares/usr/bin/backup.bin" .text:00415E1C la $s0, aMntSharesUs_15 # "/mnt/shares/usr/bin/backup.bin" .text:00415E20 lui $a2, 0x43 .text:00415E24 lui $a3, 0x43 .text:00415E28 li $a1, 0x80 # maxlen .text:00415E2C la $a2, aScreate_backup # "%screate_backup.sh %s %s" .text:00415E30 la $a3, aMntSharesUs_16 # "/mnt/shares/usr/bin/scripts/" .text:00415E34 addiu $a0, $sp, 0x21B0+var_F8 # s .text:00415E38 sw $s0, 0x21B0+var_21A0($sp) .text:00415E3C jal snprintf .text:00415E40 sw $s2, 0x21B0+var_219C($sp) .text:00415E44 jal system ``` Looking at the pseudocode of the above, we see the following: ``` Line 1 if (strncmp((char *)request_url, "/api/CONFIG/", 12) == 0) { Line 2 if (strcmp((char *)(request_url + 12), "backup") == 0) { Line 3 appid_value = get_param_from_url("appid", 1); Line 4 if (appid_value != 0 && strlen((char *)appid_value) >= 20) { Line 5 unlink("/mnt/shares/usr/bin/backup.bin"); Line 6 snprintf((char *)&cmd, 128, "%screate_backup.sh %s %s", "/mnt/shares/usr/bin/scripts/", "/mnt/shares/usr/bin/backup.bin", (char *)appid_value); Line 7 system((char *)&cmd); ``` As we can see `appid` parameter coming from user as GET parameter is passed direcly to `system` call without any sanitization leading in that way to command injection. This API is accessible for authenticated users. But taking into account the weak authentication vulnerability (TALOS-2017-0370/CVE-2017-2864) anyone can use this API. An example of a url that contains the command injection can look like this: ``` https://CIRCLE_IP:4567/api/CONFIG/backup?token=8CE2DAF0F3C9-iNvDFypBs0RXv2jy- 20170621.085252&api=1.0&appid=AAAAAAAAAAAAAAAAAAAA;ls>/tmp/file_listing.txt Notes: For proper commands/params separation, a malicious user needs to use tabs instead of spaces. ``` ### Timeline * 2017-07-13 - Vendor Disclosure * 2017-10-31 - Public Release ### CREDIT Discovered by Marcin 'Icewall' Noga, Cory Duplantis, Yves Younan, Claudio Bozzato, Lilith Wyatt <(^_^)>, Aleksandar Nikolic, and Richard Johnson Cisco Talos.
idSSV:96819
last seen2017-11-19
modified2017-11-08
published2017-11-08
reporterRoot
titleCircle with Disney Backup API Command Injection Vulnerability(CVE-2017-2866)

Talos

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