CVE-2025-1131
JSON

7.0high

Asterisk Unsafe Shell Sourcing in safe_asterisk Leads to Local Privilege Escalation

Severity
7.0high CVSS:4.0 by Gridware
Exploit likelihood
0.22% (higher than 13% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Gridware

Description

A local privilege escalation vulnerability exists in the safe_asterisk script included with the Asterisk toolkit package. When Asterisk is started via this script (common in SysV init or FreePBX environments), it sources all .sh files located in /etc/asterisk/startup.d/ as root, without validating ownership or permissions. Non-root users with legitimate write access to /etc/asterisk can exploit this behaviour by placing malicious scripts in the startup.d directory, which will then execute with root privileges upon service restart.

Affected

Product or packageVersionsReported by
Asterisk AsteriskAsterisk <=18.26.2, Asterisk <= 20.15.0, Asterisk <= 21.10.0, Asterisk <= 22.5.0CVE List
sangoma asteriskbefore 18.26.3, from 20.0.0 before 20.15.1, from 21.0.0 before 21.10.1, from 22.0.0 before 22.5.1NVD
sangoma certified_asterisk18.9, 20.7NVD

All scores

Gridware7.0high CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:N/V:C/RE:H/U:Amber
NVD7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-427

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

What each source says

CVE List

A local privilege escalation vulnerability exists in the safe_asterisk script included with the Asterisk toolkit package. When Asterisk is started via this script (common in SysV init or FreePBX environments), it sources all .sh files located in /etc/asterisk/startup.d/ as root, without validating ownership or permissions. Non-root users with legitimate write access to /etc/asterisk can exploit this behaviour by placing malicious scripts in the startup.d directory, which will then execute with root privileges upon service restart.

NVD (es)

Una vulnerabilidad de escalada de privilegios local existe en el script safe_asterisk incluido con el paquete de herramientas de Asterisk. Cuando Asterisk se inicia a través de este script (común en entornos SysV init o FreePBX), carga todos los archivos .sh ubicados en /etc/asterisk/startup.d/ como root, sin validar la propiedad o los permisos. Usuarios no-root con acceso de escritura legítimo a /etc/asterisk pueden explotar este comportamiento colocando scripts maliciosos en el directorio startup.d, los cuales se ejecutarán entonces con privilegios de root al reiniciar el servicio.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-1131 changed 2026-02-26CVE Terms of Use
NVDCVE-2025-1131 changed 2026-10-19Public domain