CVE-2019-15075 (published 2020-03-20T18:15Z)

An issue was discovered in iNextrix ASTPP before 4.0.1. web_interface/astpp/application/config/config.php does not have strong random keys, as demonstrated by use of the 8YSDaBtDHAB3EQkxPAyTz2I5DttzA9uR private key and the r)fddEw232f encryption key.

Severity: MEDIUM
CVSS v2 base score: 5.0 (AV:N/AC:L/Au:N/C:P/I:N/A:N)
CVSS v3 base score: 7.5, HIGH (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N)

Weakness information:
cwe_id: CWE-798
cwe_name: Use of Hard-coded Credentials
description: The product contains hard-coded credentials, such as a password or cryptographic key.
extended_description: 
		   There are two main variations:
		   
			 Inbound: the product contains an authentication mechanism that checks the input credentials against a hard-coded set of credentials. In this variant, a default administration account is created, and a simple password is hard-coded into the product and associated with that account. This hard-coded password is the same for each installation of the product, and it usually cannot be changed or disabled by system administrators without manually modifying the program, or otherwise patching the product. It can also be difficult for the administrator to detect.
			 Outbound: the product connects to another system or component, and it contains hard-coded credentials for connecting to that component. This variant applies to front-end systems that authenticate with a back-end service. The back-end service may require a fixed password that can be easily discovered. The programmer may simply hard-code those back-end credentials into the front-end product.
		   
         
         
cwe_id: CWE-327
cwe_name: Use of a Broken or Risky Cryptographic Algorithm
description: The product uses a broken or risky cryptographic algorithm or protocol.
extended_description: 
	   Cryptographic algorithms are the methods by which data is scrambled to prevent observation or influence by unauthorized actors. Insecure cryptography can be exploited to expose sensitive information, modify data in unexpected ways, spoof identities of other users or devices, or other impacts.
           It is very difficult to produce a secure algorithm, and even high-profile algorithms by accomplished cryptographic experts have been broken. Well-known techniques exist to break or weaken various kinds of cryptography. Accordingly, there are a small number of well-understood and heavily studied algorithms that should be used by most products. Using a non-standard or known-insecure algorithm is dangerous because a determined adversary may be able to break the algorithm and compromise whatever data has been protected.
           Since the state of cryptography advances so rapidly, it is common for an algorithm to be considered "unsafe" even if it was once thought to be strong. This can happen when new attacks are discovered, or if computing power increases so much that the cryptographic algorithm no longer provides the amount of protection that was originally thought.
	   For a number of reasons, this weakness is even more challenging to manage with hardware deployment of cryptographic algorithms as opposed to software implementation. First, if a flaw is discovered with hardware-implemented cryptography, the flaw cannot be fixed in most cases without a recall of the product, because hardware is not easily replaceable like software. Second, because the hardware product is expected to work for years, the adversary's computing power will only increase over time.
	 
         

Fix information:
repo_url: https://github.com/iNextrix/ASTPP
commit_details: repo_url: https://github.com/iNextrix/ASTPP
author: devang.nathwani
author_date: 2019-07-12 16:55:07+05:30
msg: [IMP] Generating random strong keys
repository: repo_url: https://github.com/iNextrix/ASTPP
repo_name: iNextrix/ASTPP
description: Open Source VoIP Billing Solution http://www.astppbilling.org | Report a bug https://jira.astppbilling.org
repo_language: PHP
owner: iNextrix
file_changes: filename: astpp-config.conf
change_type: ModificationType.MODIFY
diff: @@ -3,7 +3,8 @@ dbhost = 127.0.0.1
 dbname = astpp
 dbuser = astppuser
 dbpass = <PASSSWORD>
-
+PRIVATE_KEY = <PR_KEY>
+ENCRYPTION_KEY = <EN_KEY>
 
 ; Database type:  ASTPP was designed for a MySQL database initially.  Valid options are:
 ; MySQL. Pgsql is coming but is not ready yet.

programming_language: Python
filename: install.sh
change_type: ModificationType.MODIFY
diff: @@ -70,6 +70,8 @@ genpasswd()
 
 MYSQL_ROOT_PASSWORD=`echo "$(genpasswd 20)" | sed s/./*/5`
 ASTPPUSER_MYSQL_PASSWORD=`echo "$(genpasswd 20)" | sed s/./*/5`
+PR_KEY=`echo "$(genpasswd 32)"`
+EN_KEY=`echo "$(genpasswd 12)"`
 #Fetch OS Distribution
 get_linux_distribution ()
 { 
@@ -332,6 +334,8 @@ normalize_astpp ()
         sed -i "s#DB_PASSWD=\"<PASSSWORD>\"#DB_PASSWD = \"${ASTPPUSER_MYSQL_PASSWORD}\"#g" ${ASTPPDIR}astpp.lua
         sed -i "s#base_url=http://localhost:8089/#base_url=https://${ASTPP_HOST_DOMAIN_NAME}/#g" ${ASTPPDIR}/astpp-config.conf
         sed -i "s#PASSWORD = <PASSWORD>#PASSWORD = ${ASTPPUSER_MYSQL_PASSWORD}#g" /etc/odbc.ini
+        sed -i "s#<PR_KEY>#${PR_KEY}#g" ${ASTPPDIR}astpp-config.conf
+        sed -i "s#<EN_KEY>#${EN_KEY}#g" ${ASTPPDIR}astpp-config.conf
         systemctl restart nginx
 }
 

programming_language: Shell
filename: config.php
change_type: ModificationType.MODIFY
diff: @@ -228,7 +228,7 @@ $config ['cache_path'] = '';
  * | MUST set private key with 32 characters.
  * |
  */
-$config ['private_key'] = '8YSDaBtDHAB3EQkxPAyTz2I5DttzA9uR';
+$config ['private_key'] = $astpp_config ['PRIVATE_KEY'];
 /*
  * |--------------------------------------------------------------------------
  * | Encryption Key
@@ -238,8 +238,7 @@ $config ['private_key'] = '8YSDaBtDHAB3EQkxPAyTz2I5DttzA9uR';
  * | MUST set an encryption key. See the user guide for info.
  * |
  */
-$config ['encryption_key'] = 'r)fddEw232f';
-
+$config ['encryption_key'] = $astpp_config ['ENCRYPTION_KEY'];
 /*
  * |--------------------------------------------------------------------------
  * | Session Variables

programming_language: PHP