exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

TP-LINK Cloud Cameras NCXXX Hardcoded Encryption Key

TP-LINK Cloud Cameras NCXXX Hardcoded Encryption Key
Posted May 1, 2020
Authored by Pietro Oliva

TP-LINK Cloud Cameras including products NC200, NC210, NC220, NC230, NC250, NC260, and NC450 suffer from having a hardcoded encryption key. The issue is located in the methods swSystemBackup and sym.swSystemRestoreFile, where a hardcoded encryption key is used in order to encrypt/decrypt a config backup file. The algorithm in use is DES ECB with modified s-boxes and permutation tables.

tags | exploit
advisories | CVE-2020-12110
SHA-256 | 8a9bf019904b9da201926fdb2f4eca44ec5bb26ff30a3e12709465ed196958ca

TP-LINK Cloud Cameras NCXXX Hardcoded Encryption Key

Change Mirror Download
Vulnerability title: TP-LINK Cloud Cameras NCXXX Hardcoded Encryption Key
Author: Pietro Oliva
CVE: CVE-2020-12110
Vendor: TP-LINK
Product: NC200, NC210, NC220, NC230, NC250, NC260, NC450
Affected version: NC200 <= 2.1.9 build 200225, NC210 <= 1.0.9 build 200304,
NC220 <= 1.3.0 build 200304, NC230 <= 1.3.0 build 200304,
NC250 <= 1.3.0 build 200304, NC260 <= 1.5.2 build 200304,
NC450 <= 1.5.3 build 200304.

Fixed version: NC200 <= 2.1.10 build 200401, NC210 <= 1.0.10 build 200401,
NC220 <= 1.3.1 build 200401, NC230 <= 1.3.1 build 200401,
NC250 <= 1.3.1 build 200401, NC260 <= 1.5.3 build_200401,
NC450 <= 1.5.4 build 200401


Description:
The issue is located in the methods swSystemBackup and sym.swSystemRestoreFile,
where a hardcoded encryption key is used in order to encrypt/decrypt a config
backup file. The algorithm in use is DES ECB with modified s-boxes and
permutation tables.

Impact:
Attackers could exploit this vulnerability to decrypt backup files and get
access to sensitive data, such as the following:
-Alarm FTP server user and password
-Wlan passphrase
-PPPOE user and password
-Alarm SMTP server user and password
-DDNS user and password

In addition to that, attackers could forge an encrypted backup file that can
be restored via the web interface. This allowed arbitrary files to be written or
overwritten with arbitrary attacker-controlled contents. Needless to say, this
could result in permanent damage or code execution as root.

Exploitation:
An attacker would have to figure out the modified DES algorithm in order to be
able to encrypt/decrypt config backup files. This is not hard to do with some
google search. Once that has been done, attackers can either decrypt backup
files or create their own with custom contents, effectlively writing arbitrary
files on the device.


Evidence:
The disassembly of affected code from an NC200 camera is shown below:

swSystemRestoreFile:

0x004a0f88 lui gp, 0xa
0x004a0f8c addiu gp, gp, -0x5c78
0x004a0f90 addu gp, gp, t9
0x004a0f94 addiu sp, sp, -0x4f8
0x004a0f98 sw ra, (var_4f4h)
0x004a0f9c sw fp, (var_4f0h)
0x004a0fa0 move fp, sp
0x004a0fa4 sw gp, (var_18h)
0x004a0fa8 sw a0, (encrypted_filename_ptr)
0x004a0fac lw v0, -0x7fe4(gp)
0x004a0fb0 nop
0x004a0fb4 addiu v0, v0, -0x4c40 ; "/tmp/plainBackup"
0x004a0fb8 nop
0x004a0fbc sw v0, (decrypted_filename_ptr)
0x004a0fc0 lw a0, (encrypted_filename_ptr)
0x004a0fc4 lw a1, -0x7fe4(gp)
0x004a0fc8 nop
0x004a0fcc addiu a1, a1, -0x4c2c ; "tp-link"
0x004a0fd0 lw a2, (decrypted_filename_ptr)
0x004a0fd4 lw t9, -sym.DES_Decrypt(gp)
0x004a0fd8 nop
0x004a0fdc jalr t9

swSystemBackup:

0x004a1c54 lw a0, -0x7fe4(gp)
0x004a1c58 nop
0x004a1c5c addiu a0, a0, -0x4bbc ; "/usr/local/config/ipcamera/pBackup"
0x004a1c60 lw a1, -0x7fe4(gp)
0x004a1c64 nop
0x004a1c68 addiu a1, a1, -0x4c2c ; "tp-link"
0x004a1c6c lw a2, -0x7fe4(gp)
0x004a1c70 nop
0x004a1c74 addiu a2, a2, -0x4b84 ; "/usr/local/config/ipcamera/eBackup"
0x004a1c78 lw t9, -sym.DES_Encrypt(gp)
0x004a1c7c nop
0x004a1c80 jalr t9

Mitigating factors:
-Almost every camera model has a different hardcoded key. However, this is not
hard to find and all cameras of the same model share the same encryption key
which cannot be changed.

Remediation:
Install firmware updates provided by the vendor to fix the vulnerability.
The latest updates can be found at the following URLs:

https://www.tp-link.com/en/support/download/nc200/#Firmware
https://www.tp-link.com/en/support/download/nc210/#Firmware
https://www.tp-link.com/en/support/download/nc220/#Firmware
https://www.tp-link.com/en/support/download/nc230/#Firmware
https://www.tp-link.com/en/support/download/nc250/#Firmware
https://www.tp-link.com/en/support/download/nc260/#Firmware
https://www.tp-link.com/en/support/download/nc450/#Firmware

Disclosure timeline:
29th March 2020 - Vulnerability reported to vendor.
10th April 2020 - Patched firmware provided by vendor for verification.
10th April 2020 - Confirmed the vulnerability was fixed.
29th April 2020 - Firmware updates released to the public.
29th April 2020 - Vulnerability details are made public.


Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    18 Files
  • 19
    Nov 19th
    7 Files
  • 20
    Nov 20th
    13 Files
  • 21
    Nov 21st
    6 Files
  • 22
    Nov 22nd
    48 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    60 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close