CVE-2026-31495
Description
In the Linux kernel, the following vulnerability has been resolved:
netfilter: ctnetlink: use netlink policy range checks
Replace manual range and mask validations with netlink policy annotations in ctnetlink code paths, so that the netlink core rejects invalid values early and can generate extack errors.
- CTA_PROTOINFO_TCP_STATE: reject values > TCP_CONNTRACK_SYN_SENT2 at policy level, removing the manual >= TCP_CONNTRACK_MAX check. - CTA_PROTOINFO_TCP_WSCALE_ORIGINAL/REPLY: reject values > TCP_MAX_WSCALE (14). The normal TCP option parsing path already clamps to this value, but the ctnetlink path accepted 0-255, causing undefined behavior when used as a u32 shift count. - CTA_FILTER_ORIG_FLAGS/REPLY_FLAGS: use NLA_POLICY_MASK with CTA_FILTER_F_ALL, removing the manual mask checks. - CTA_EXPECT_FLAGS: use NLA_POLICY_MASK with NF_CT_EXPECT_MASK, adding a new mask define grouping all valid expect flags.
Extracted from a broader nf-next patch by Florian Westphal, scoped to ctnetlink for the fixes tree.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In the Linux kernel, netfilter ctnetlink lacked range validation for TCP state, window scale, and flags, potentially causing undefined behavior.
Vulnerability
CVE-2026-31495 addresses missing range and mask validation in the Linux kernel's netfilter ctnetlink subsystem. The code previously performed manual checks for several netlink attributes, but these were incomplete. Specifically, CTA_PROTOINFO_TCP_STATE was only checked against TCP_CONNTRACK_MAX without rejecting values above TCP_CONNTRACK_SYN_SENT2, and CTA_PROTOINFO_TCP_WSCALE_ORIGINAL/REPLY accepted values 0–255, while the normal TCP path clamps to TCP_MAX_WSCALE (14). Using an out-of-range window scale value as a shift count could cause undefined behavior [1][2].
Exploitation
An attacker with the ability to sendmsg() access to a netlink socket (typically requiring CAP_NET_ADMIN) could craft a netlink message containing a ctnetlink request with an invalid TCP window scale value (e.g., 15–255). The kernel would then use this value as a shift count in a u32 operation, leading to undefined behavior. No authentication beyond netlink socket access is needed, but the attacker must be able to communicate with the ctnetlink handler [1][2].
Impact
Successful exploitation could result in a denial of service (system crash) or potentially arbitrary code execution, depending on the compiler and architecture. The undefined shift operation may corrupt memory or cause unpredictable control flow. The CVSS v3 score is 5.5 (Medium), reflecting the need for local access and privileges [1][2].
Mitigation
The fix replaces manual checks with netlink policy annotations (NLA_POLICY_RANGE, NLA_POLICY_MASK) so that the netlink core rejects invalid values early and provides extack errors. The patch has been applied to the Linux kernel stable trees [3][4]. Users should update to a kernel containing the fix commit 435b576cd2fa or later.
AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
9cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*+ 8 more
- cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*range: >=2.6.22.1,<5.10.253
- cpe:2.3:o:linux:linux_kernel:2.6.22:-:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc6:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc7:*:*:*:*:*:*
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
8- git.kernel.org/stable/c/2ef71307c86a9f866d6e28f1a0c06e2e9d794474nvdPatch
- git.kernel.org/stable/c/435b576cd2faa75154777868f8cbb73bf71644d3nvdPatch
- git.kernel.org/stable/c/45c33e79ae705b7af97e3117672b6cd258dd0b1bnvdPatch
- git.kernel.org/stable/c/4f7d25f3f0786402ba48ff7d13b6241d77d975f5nvdPatch
- git.kernel.org/stable/c/675c913b940488a84effdeeac5a1cfb657b59804nvdPatch
- git.kernel.org/stable/c/8f15b5071b4548b0aafc03b366eb45c9c6566704nvdPatch
- git.kernel.org/stable/c/c6cb41eaae875501eaaa487b8db6539feb092292nvdPatch
- git.kernel.org/stable/c/fcec5ce2d73a41668b24e3f18c803541602a59f6nvdPatch
News mentions
0No linked articles in our index yet.