summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2009-10-26 19:40:26 +0000
committerJeff Peeler <jpeeler@digium.com>2009-10-26 19:40:26 +0000
commitec0a1882c92552ecd0b06ac96585639d6bd120a6 (patch)
tree742e0c5698673252f454dba82cfcc2d3a7ec4169 /channels
parent71452322a275b4aacd012d922728ac3d709f767a (diff)
ACL check not present for verifying SIP INVITEs
The ACL check in check_peer_ok was missing and has now been restored. The missing check allowed for calls to be made on prohibited networks where an ACL was defined in sip.conf and the allowguest option was set to off. See the AST security advisory below for more information. Merge code associated with AST-2009-007. (closes issue #16091) Reported by: thom4fun git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 483e29281..6cec8071e 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -14459,7 +14459,11 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
of, ast_inet_ntoa(p->recv.sin_addr), ntohs(p->recv.sin_port));
return AUTH_DONT_KNOW;
}
-
+ if (!ast_apply_ha(peer->ha, sin)) {
+ ast_debug(2, "Found peer '%s' for '%s', but fails host access\n", peer->name, of);
+ unref_peer(peer, "unref_peer: check_peer_ok: from find_peer call, early return of AUTH_ACL_FAILED");
+ return AUTH_ACL_FAILED;
+ }
if (debug)
ast_verbose("Found peer '%s' for '%s' from %s:%d\n",
peer->name, of, ast_inet_ntoa(p->recv.sin_addr), ntohs(p->recv.sin_port));