Pwning 3CX Phone Management Backends from the Internet
A pre-authentication relative path traversal in the 3CX Phone Management System's download endpoint allowed reading files under a restricted directory, and a patch bypass using an absolute path traversal enabled reading any file, including the PostgreSQL database file containing admin credentials in cleartext. With those credentials, an authenticated ZipSlip vulnerability in the Call Flow Apps upload led to remote code execution as SYSTEM.
medium.com
Published on medium.com
After an unplanned journey with Microsoft Exchange the month before, I started to look for new interesting vulnerability research targets for February: widely used, usually reachable from Internet perimeter and hopefully not so much targeted by other security researchers.
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 use of Path.Combine with user-controlled input without proper validation, and an incomplete patch that only checked for '..' and drive-letter paths but not for paths starting with a directory separator or drive letter without a backslash.
Impact
An unauthenticated attacker could read sensitive files, obtain admin credentials, and achieve remote code execution as SYSTEM, though the initial traversal was limited to a specific directory until bypassed.
What the attacker needed
Network access to the 3CX management console; No authentication for the download endpoint; Windows installation (for backslash traversal); Valid admin credentials (for RCE chain)
The fix
The vulnerabilities were fixed in multiple 3CX updates: the initial traversal in Update 2, the bypass in Update 3, and the final bypass in Hotfix 1.
How it was found
- Identify the unauthenticated download endpoint /download/{platform}/{file} in the ElectronController.
- Send a request with a file parameter containing backslash-based relative path traversal to read files under C:\ProgramData\3CX\Instance1\Data.
- After the first patch, bypass the check by using an absolute path starting with a backslash to read any file.
- Read the PostgreSQL database file containing the customers table with admin credentials in cleartext.
- Log in to the management console with the obtained admin credentials.
- Upload a ZIP file containing path traversal entries via the Call Flow Apps feature to write files outside the intended directory, overwriting an executable that runs as SYSTEM.
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.
The software had a file download feature that did not properly check the file path, so an attacker could use '..' to escape the intended folder and read other files. After the first fix, the check could still be bypassed by starting the path with a backslash, which Windows treats as an absolute path. This let attackers read the database file with admin passwords, then log in and upload a malicious ZIP that wrote files outside the intended folder, eventually running code as the system user.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.