{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "a89ecb6a2ef732d04058d87801e2b6bd7e5c7089"
            },
            {
              "fixed": "8c5bf8f5b478f569191c4a7982de7cd5f5f73c1a"
            },
            {
              "fixed": "c9749f6232c845e31c21d4cc72200211df15d8a2"
            },
            {
              "fixed": "b67d638cbee9975c765feb45c126e96ed11ec802"
            },
            {
              "fixed": "36bf0d98e180a7c384c8d8a59b0d2d4b80e5eb16"
            },
            {
              "fixed": "aec14808271f2bf2b656de6ff12dfe73c5fd3b67"
            },
            {
              "fixed": "8368ce8eb01f0b91111d814703696e780d0ef12f"
            },
            {
              "fixed": "1e4baa853f1cc4227e04f52d6860524707cfb294"
            },
            {
              "fixed": "ff64c5bfef12461df8450e0f50bb693b5269c720"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.6.17"
            },
            {
              "fixed": "5.10.258"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "5.11.0"
            },
            {
              "fixed": "5.15.209"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "5.16.0"
            },
            {
              "fixed": "6.1.175"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.2.0"
            },
            {
              "fixed": "6.6.136"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.7.0"
            },
            {
              "fixed": "6.12.83"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.13.0"
            },
            {
              "fixed": "6.18.24"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.19.0"
            },
            {
              "fixed": "6.19.14"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31681.json"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nnetfilter: xt_multiport: validate range encoding in checkentry\n\nports_match_v1() treats any non-zero pflags entry as the start of a\nport range and unconditionally consumes the next ports[] element as\nthe range end.\n\nThe checkentry path currently validates protocol, flags and count, but\nit does not validate the range encoding itself. As a result, malformed\nrules can mark the last slot as a range start or place two range starts\nback to back, leaving ports_match_v1() to step past the last valid\nports[] element while interpreting the rule.\n\nReject malformed multiport v1 rules in checkentry by validating that\neach range start has a following element and that the following element\nis not itself marked as another range start.",
  "id": "CVE-2026-31681",
  "modified": "2026-07-15T01:49:04.809401881Z",
  "published": "2026-04-25T08:46:57.995Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/1e4baa853f1cc4227e04f52d6860524707cfb294"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/36bf0d98e180a7c384c8d8a59b0d2d4b80e5eb16"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/8368ce8eb01f0b91111d814703696e780d0ef12f"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/8c5bf8f5b478f569191c4a7982de7cd5f5f73c1a"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/aec14808271f2bf2b656de6ff12dfe73c5fd3b67"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/b67d638cbee9975c765feb45c126e96ed11ec802"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/c9749f6232c845e31c21d4cc72200211df15d8a2"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/ff64c5bfef12461df8450e0f50bb693b5269c720"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31681.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31681"
    },
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    }
  ],
  "schema_version": "1.8.0",
  "summary": "netfilter: xt_multiport: validate range encoding in checkentry"
}