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:

March 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close