]> git.ipfire.org Git - thirdparty/asterisk.git/commit
AST-2017-006: Fix app_minivm application MinivmNotify command injection
authorCorey Farrell <git@cfware.com>
Sun, 2 Jul 2017 00:24:27 +0000 (20:24 -0400)
committerJoshua Colp <jcolp@digium.com>
Wed, 30 Aug 2017 18:42:04 +0000 (18:42 +0000)
commit7ca730601211c595ad56c91259a1d229d712abf2
treead982e04995f22cc0890843b16ef119aeed65716
parentb189f8c5cf758734e0690c824c0e118707f236ce
AST-2017-006: Fix app_minivm application MinivmNotify command injection

An admin can configure app_minivm with an externnotify program to be run
when a voicemail is received.  The app_minivm application MinivmNotify
uses ast_safe_system() for this purpose which is vulnerable to command
injection since the Caller-ID name and number values given to externnotify
can come from an external untrusted source.

* Add ast_safe_execvp() function.  This gives modules the ability to run
external commands with greater safety compared to ast_safe_system().
Specifically when some parameters are filled by untrusted sources the new
function does not allow malicious input to break argument encoding.  This
may be of particular concern where CALLERID(name) or CALLERID(num) may be
used as a parameter to a script run by ast_safe_system() which could
potentially allow arbitrary command execution.

* Changed app_minivm.c:run_externnotify() to use the new ast_safe_execvp()
instead of ast_safe_system() to avoid command injection.

* Document code injection potential from untrusted data sources for other
shell commands that are under user control.

ASTERISK-27103

Change-Id: I7552472247a84cde24e1358aaf64af160107aef1
README-SERIOUSLY.bestpractices.txt
apps/app_minivm.c
apps/app_mixmonitor.c
apps/app_system.c
configs/samples/minivm.conf.sample
funcs/func_shell.c
include/asterisk/app.h
main/asterisk.c
res/res_monitor.c