Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: nf_conntrack_sip: extend request line validation

on SIP requests, so a fragmented TCP SIP packet from an allow header starting with
INVITE,NOTIFY,OPTIONS,REFER,REGISTER,UPDATE,SUBSCRIBE
Content-Length: 0

will not bet interpreted as an INVITE request. Also Request-URI must start with an alphabetic character.

Confirm with RFC 3261
Request-Line = Method SP Request-URI SP SIP-Version CRLF

Fixes: 30f33e6dee80 ("[NETFILTER]: nf_conntrack_sip: support method specific request/response handling")
Signed-off-by: Ulrich Weber <ulrich.weber@riverbed.com>
Acked-by: Marco Angaroni <marcoangaroni@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Ulrich Weber and committed by
Pablo Neira Ayuso
444f9017 dab45060

+4 -1
+4 -1
net/netfilter/nf_conntrack_sip.c
··· 1436 1436 handler = &sip_handlers[i]; 1437 1437 if (handler->request == NULL) 1438 1438 continue; 1439 - if (*datalen < handler->len || 1439 + if (*datalen < handler->len + 2 || 1440 1440 strncasecmp(*dptr, handler->method, handler->len)) 1441 + continue; 1442 + if ((*dptr)[handler->len] != ' ' || 1443 + !isalpha((*dptr)[handler->len+1])) 1441 1444 continue; 1442 1445 1443 1446 if (ct_sip_get_header(ct, *dptr, 0, *datalen, SIP_HDR_CSEQ,