3CX Phone System Local Privilege Escalation Vulnerability
A local privilege escalation vulnerability in the Windows version of 3CX Phone System allowed an unprivileged local user to read a configuration file containing PostgreSQL superuser credentials, then use those credentials to load a malicious DLL into the PostgreSQL service running as NT AUTHORITY\SYSTEM and escalate to full administrator. A separate post-authentication arbitrary file read existed in the Linux management console's Terminal feature via allowed commands.
Published on praetorian.com
In an effort to safeguard our customers, we perform proactive vulnerability research with the goal of identifying zero-day vulnerabilities that are likely to impact the security of leading organizations. Recently, we decided to take a look at the 3CX Phone Management System with the goal of identifying an…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the config.json file containing PostgreSQL superuser credentials was readable by any local user, and the PostgreSQL service ran as NT AUTHORITY\SYSTEM with the ability to load arbitrary DLLs, allowing privilege escalation.
What the attacker needed
Unprivileged local access to Windows server; PostgreSQL service running as SYSTEM; authenticated access to Linux management console
The fix
The local privilege escalation was fixed in version 20 update 1, and the Terminal feature containing the file read was removed in new versions.
How it was found
- As an unprivileged local user, read the config.json file in the ProgramData directory.
- Extract the PostgreSQL credentials from the file.
- Connect to the PostgreSQL service using those credentials, which have superuser privileges.
- Use PostgreSQL functionality to load a malicious DLL, causing code execution as NT AUTHORITY\SYSTEM.
- Overwrite a service binary that runs with full SYSTEM privileges and restart the service to gain full administrator rights.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This report describes two security problems in a phone management system. The first lets someone who already has a low-level login on a Windows server read a file with powerful database passwords, then use those passwords to run their own code as the highest-level system user. The second lets a logged-in administrator on Linux read any file on the server by misusing built-in diagnostic commands.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.