asterisk.c: Add option to restrict shell access from remote consoles.

UserNote: A new asterisk.conf option 'disable_remote_console_shell' has
been added that, when set, will prevent remote consoles from executing
shell commands using the '!' prefix.

Resolves: #GHSA-c7p6-7mvq-8jq2
This commit is contained in:
George Joseph
2025-05-19 08:16:53 -06:00
committed by github-actions[bot]
parent 67360eb671
commit 3a5ffe2842
5 changed files with 20 additions and 1 deletions

View File

@@ -88,7 +88,7 @@ long option_minmemfree;
#endif
int ast_option_rtpusedynamic = 1;
unsigned int ast_option_rtpptdynamic = 35;
int ast_option_disable_remote_console_shell = 0;
/*! @} */
struct ast_eid ast_eid_default;
@@ -224,6 +224,7 @@ void load_asterisk_conf(void)
int option_trace_new = 0;
int option_verbose_new = 0;
/* init with buildtime config */
#ifdef REF_DEBUG
/* The REF_DEBUG compiler flag is now only used to enable refdebug by default.
@@ -477,6 +478,8 @@ void load_asterisk_conf(void)
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_SOUNDS_SEARCH_CUSTOM);
} else if (!strcasecmp(v->name, "channel_storage_backend")) {
internal_channel_set_current_storage_driver(v->value);
} else if (!strcasecmp(v->name, "disable_remote_console_shell")) {
ast_option_disable_remote_console_shell = ast_true(v->value);
}
}
if (!ast_opt_remote) {