CVE Database›Document archive›CVE-2026-31681

CVE-2026-31681

kernel: netfilter: xt_multiport: validate range encoding in checkentry

Loading…

Severity

Moderate

Red Hat Product Security

6.1

CVSS 3.1

Review impact separately from score.

Published · April 25, 2026

Updated · June 28, 2026

Description

A flaw was found in the Linux kernel's netfilter xt_multiport module. This vulnerability arises from insufficient validation of range encoding within the checkentry function. A local attacker can exploit this by crafting malformed multiport rules, which causes the ports_match_v1() function to read beyond its intended memory boundary. This out-of-bounds read can lead to a denial of service (DoS) or potentially disclose sensitive information.

Statement

An out of bounds read can occur in the xt_multiport v1 match because the range encoding uses pflags and the matcher treats any non zero pflags entry as the start of a port range and then unconditionally consumes the next ports element as the range end. The checkentry path previously validated protocol flags and count but did not validate that every range start has a following element and that two consecutive elements are not both marked as range starts. A local attacker with CAP_NET_ADMIN can install a malformed rule with an invalid pflags layout and later trigger the match during packet processing. This can lead to a kernel crash. For the CVSS the PR is L because installing or modifying iptables or ip6tables rules requires administrative networking privileges.

CVSS score applicability

The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

Mitigation

In order to trigger the issue, it requires the ability to create user/net namespaces.

On non-containerized deployments of Red Hat Enterprise Linux 8, it is recommended to disable user namespaces by setting user.max_user_namespaces to 0:

echo "user.max_user_namespaces=0" > /etc/sysctl.d/userns.conf

sysctl -p /etc/sysctl.d/userns.conf

On containerized deployments, such as Red Hat OpenShift Container Platform, do not use this mitigation as the functionality is needed to be enabled.

CVSS / CWE

CVSS 3.1 · 6.1
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:H

CWE-125 · Out-of-bounds Read