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 package | Versions | Reported by |
|---|---|---|
| Asterisk Asterisk | Asterisk <=18.26.2, Asterisk <= 20.15.0, Asterisk <= 21.10.0, Asterisk <= 22.5.0 | CVE List |
| sangoma asterisk | before 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.1 | NVD |
| sangoma certified_asterisk | 18.9, 20.7 | NVD |
All scores
| Gridware | 7.0high CVSS:4.0 | CVSS: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 |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Classification
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-1131 changed 2026-02-26 | CVE Terms of Use |
| NVD | CVE-2025-1131 changed 2026-10-19 | Public domain |