diff options
author | Mark Michelson <mmichelson@digium.com> | 2008-03-13 20:59:00 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2008-03-13 20:59:00 +0000 |
commit | d236e3d1b1b38a2a900e995db88afd31567a63c6 (patch) | |
tree | 60257f7a19cff5ab37a1a484250e67d097223f23 | |
parent | 5aba7c1cbe075e0f1c5090e6a7686dcbff125cf3 (diff) |
Fixing a potential buffer overflow in the manager command ModuleCheck.
Though this overflow is exploitable remotely, we are NOT issuing a security
advisory for this since in order to exploit the overflow, the attacker would
have to establish an authenticated manager session AND have the system privilege.
By gaining this privilege, the attacker already has more powerful weapons at his
disposal than overflowing a buffer with a malformed manager header, so the vulnerability
in this case really lies with the authentication method that allowed the attacker to
gain the system privilege in the first place.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | main/manager.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/manager.c b/main/manager.c index fb834c437..84ec2cc81 100644 --- a/main/manager.c +++ b/main/manager.c @@ -2634,14 +2634,14 @@ static int manager_modulecheck(struct mansession *s, const struct message *m) } else { cut = filename + strlen(filename); } - sprintf(cut, ".so"); + snprintf(cut, sizeof(filename) - cut - 1, ".so"); ast_log(LOG_DEBUG, "**** ModuleCheck .so file %s\n", filename); res = ast_module_check(filename); if (!res) { astman_send_error(s, m, "Module not loaded"); return 0; } - sprintf(cut, ".c"); + snprintf(cut, sizeof(filename) - cut - 1, ".c"); ast_log(LOG_DEBUG, "**** ModuleCheck .c file %s\n", filename); version = ast_file_version_find(filename); |