CRITICAL Introduced in 2.6.26
netfilter SIP Port OOB
CVE-2026-52986
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
KernelScan AI8.1HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: netfilter: nf_conntrack_sip: don't use simple_strtoul Replace unsafe port parsing in epaddr_len(), ct_sip_parse_header_uri(), and ct_sip_parse_request() with a new sip_parse_port() helper that validates each digit against the buffer limit, eliminating the use of simple_strtoul() which assumes NUL-terminated strings. The previous code dereferenced pointers without bounds checks after sip_parse_addr() and relied on simple_strtoul() on non-NUL-terminated skb data. A port that reaches the buffer limit without a trailing character is also rejected as malformed. Also get rid of all simple_strtoul() usage in conntrack, prefer a stricter version instead. There are intentional changes: - Bail out if number is > UINT_MAX and indicate a failure, same for too long sequences. While we do accept 05535 as port 5535, we will not accept e.g. 'sip:10.0.0.1:005060'. While its syntactically valid under RFC 3261, we should restrict this to not waste cycles when presented with malformed packets with 64k '0' characters. - Force base 10 in ct_sip_parse_numerical_param(). This is used to fetch 'expire=' and 'rports='; both are expected to use base-10. - In nf_nat_sip.c, only accept the parsed value if its within the 1k-64k range. - epaddr_len now returns 0 if the port is invalid, as it already does for invalid ip addresses. This is intentional. nf_conntrack_sip performs lots of guesswork to find the right parts of the message to parse. Being stricter could break existing setups. Connection tracking helpers are designed to allow traffic to pass, not to block it. Based on an earlier patch from Jenny Guanni Qu <qguanni@gmail.com>.
02KernelScan AI Analysis
Risk summary
A remote attacker can send a crafted SIP packet with a malformed numeric field (port, CSeq, status code, Content-Length, expires, or rport) to a system running the nf_conntrack_sip kernel module, causing the kernel to read beyond the packet buffer boundary. This can leak small amounts of kernel slab data and will typically result in a kernel crash or denial of service when unmapped pages are touched. No authentication or special privileges are required since the vulnerable code processes network traffic in the connection tracking path.
Vulnerability analysis
The root cause is that simple_strtoul() assumes NUL-terminated strings, but skb packet data is not NUL-terminated. In epaddr_len(), ct_sip_parse_header_uri(), ct_sip_parse_request(), ct_sip_parse_numerical_param(), and multiple SIP message handlers, the code called simple_strtoul() on pointers into the packet buffer without any bounds check against the end of the packet data. If a crafted SIP packet places a numeric value at the very end of the buffer without a terminating character, simple_strtoul() will read past the buffer limit, constituting an unbounded out-of-bounds read on kernel memory. This can expose slab contents before eventually hitting unmapped pages and causing a kernel panic. The fix introduces sip_parse_port() and sip_strtouint() helpers that iterate character by character while checking against the limit pointer. The attack surface is entirely network-facing: the SIP conntrack helper processes UDP/TCP packets without requiring any local access or privileges. Any system with nf_conntrack_sip loaded (common on SIP-capable firewalls/NAT gateways) and reachable from the network is vulnerable.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.15 | 2.6.26 | 5.15.209 | 9c6afcb1c3cb |
| 6.1 | 2.6.26 | 6.1.175 | b3264c977e79 |
| 6.12 | 2.6.26 | 6.12.91 | 9f69c323ae0a |
| 6.18 | 2.6.26 | 6.18.33 | 7df9863bf538 |
| 7.0 | 2.6.26 | 7.0.10 | 523762e3b693 |
| 5.10 | 2.6.26 | 5.10.258 | 8cd035837957 |
| mainline | 2.6.26 | 7.1 | 8cf6809cddcb |
| 6.6 | 2.6.26 | 6.6.141 | ea2ecd29b8f4 |