All of lore.kernel.org
 help / color / mirror / Atom feed
* CVE-2026-52986: netfilter: nf_conntrack_sip: don't use simple_strtoul
@ 2026-06-24 16:30 Greg Kroah-Hartman
  0 siblings, 0 replies; only message in thread
From: Greg Kroah-Hartman @ 2026-06-24 16:30 UTC (permalink / raw)
  To: linux-cve-announce; +Cc: Greg Kroah-Hartman

From: Greg Kroah-Hartman <gregkh@kernel.org>

Description
===========

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>.

The Linux kernel CVE team has assigned CVE-2026-52986 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 2.6.26 with commit 05e3ced297fe755093140e7487e292fb7603316e and fixed in 5.10.258 with commit 8cd0358379570003659186706e077929d6930c40
	Issue introduced in 2.6.26 with commit 05e3ced297fe755093140e7487e292fb7603316e and fixed in 5.15.209 with commit 9c6afcb1c3cbb2c0da65b8515ac14d7273872f84
	Issue introduced in 2.6.26 with commit 05e3ced297fe755093140e7487e292fb7603316e and fixed in 6.1.175 with commit b3264c977e79d8a25778d4fd11520f00fea1329c
	Issue introduced in 2.6.26 with commit 05e3ced297fe755093140e7487e292fb7603316e and fixed in 6.6.141 with commit ea2ecd29b8f4433e52607192ca91084f95787ca0
	Issue introduced in 2.6.26 with commit 05e3ced297fe755093140e7487e292fb7603316e and fixed in 6.12.91 with commit 9f69c323ae0ab517e595c2cc74e0ae0d9d085611
	Issue introduced in 2.6.26 with commit 05e3ced297fe755093140e7487e292fb7603316e and fixed in 6.18.33 with commit 7df9863bf538a626e8a684e59cb2c43eac0ef3c8
	Issue introduced in 2.6.26 with commit 05e3ced297fe755093140e7487e292fb7603316e and fixed in 7.0.10 with commit 523762e3b6933fff81f01dfa3c60c0774044cdab
	Issue introduced in 2.6.26 with commit 05e3ced297fe755093140e7487e292fb7603316e and fixed in 7.1 with commit 8cf6809cddcbe301aedfc6b51bcd4944d45795f6

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2026-52986
will be updated if fixes are backported, please check that for the most
up to date information about this issue.


Affected files
==============

The file(s) affected by this issue are:
	net/netfilter/nf_conntrack_sip.c
	net/netfilter/nf_nat_sip.c


Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/8cd0358379570003659186706e077929d6930c40
	https://git.kernel.org/stable/c/9c6afcb1c3cbb2c0da65b8515ac14d7273872f84
	https://git.kernel.org/stable/c/b3264c977e79d8a25778d4fd11520f00fea1329c
	https://git.kernel.org/stable/c/ea2ecd29b8f4433e52607192ca91084f95787ca0
	https://git.kernel.org/stable/c/9f69c323ae0ab517e595c2cc74e0ae0d9d085611
	https://git.kernel.org/stable/c/7df9863bf538a626e8a684e59cb2c43eac0ef3c8
	https://git.kernel.org/stable/c/523762e3b6933fff81f01dfa3c60c0774044cdab
	https://git.kernel.org/stable/c/8cf6809cddcbe301aedfc6b51bcd4944d45795f6

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-24 16:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24 16:30 CVE-2026-52986: netfilter: nf_conntrack_sip: don't use simple_strtoul Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.