{
  "id": "CVE-2025-38248",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-38248",
  "published_at": "2025-07-09T10:42:29.133Z",
  "title": "bridge: mcast: Fix use-after-free during router port configuration",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "cna",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": {
    "created_at": "2026-01-22T04:46:19Z",
    "first_seen_at": "2026-11-14T11:25:11.578Z",
    "days_after_publication": 196.8,
    "repo": "guard-wait/CVE-2025-38248_EXP",
    "source": "github"
  },
  "poc_repo_count": 1,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": {
    "category": "Router / network device",
    "confidence": "medium",
    "reason": "product or title mentions \"router\""
  },
  "description": "In the Linux kernel, the following vulnerability has been resolved:\n\nbridge: mcast: Fix use-after-free during router port configuration\n\nThe bridge maintains a global list of ports behind which a multicast\nrouter resides. The list is consulted during forwarding to ensure\nmulticast packets are forwarded to these ports even if the ports are not\nmember in the matching MDB entry.\n\nWhen per-VLAN multicast snooping is enabled, the per-port multicast\ncontext is disabled on each port and the port is removed from the global\nrouter port list:\n\n # ip link add name br1 up type bridge vlan_filtering 1 mcast_snooping 1\n # ip link add name dummy1 up master br1 type dummy\n # ip link set dev dummy1 type bridge_slave mcast_router 2\n $ bridge -d mdb show | grep router\n router ports on br1: dummy1\n # ip link set dev br1 type bridge mcast_vlan_snooping 1\n $ bridge -d mdb show | grep router\n\nHowever, the port can be re-added to the global list even when per-VLAN\nmulticast snooping is enabled:\n\n # ip link set dev dummy1 type bridge_slave mcast_router 0\n # ip link set dev dummy1 type bridge_slave mcast_router 2\n $ bridge -d mdb show | grep router\n router ports on br1: dummy1\n\nSince commit 4b30ae9adb04 (\"net: bridge: mcast: re-implement\nbr_multicast_{enable, disable}_port functions\"), when per-VLAN multicast\nsnooping is enabled, multicast disablement on a port will disable the\nper-{port, VLAN} multicast contexts and not the per-port one. As a\nresult, a port will remain in the global router port list even after it\nis deleted. This will lead to a use-after-free [1] when the list is\ntraversed (when adding a new port to the list, for example):\n\n # ip link del dev dummy1\n # ip link add name dummy2 up master br1 type dummy\n # ip link set dev dummy2 type bridge_slave mcast_router 2\n\nSimilarly, stale entries can also be found in the per-VLAN router port\nlist. When per-VLAN multicast snooping is disabled, the per-{port, VLAN}\ncontexts are disabled on each port and the port is removed from the\nper-VLAN router port list:\n\n # ip link add name br1 up type bridge vlan_filtering 1 mcast_snooping 1 mcast_vlan_snooping 1\n # ip link add name dummy1 up master br1 type dummy\n # bridge vlan add vid 2 dev dummy1\n # bridge vlan global set vid 2 dev br1 mcast_snooping 1\n # bridge vlan set vid 2 dev dummy1 mcast_router 2\n $ bridge vlan global show dev br1 vid 2 | grep router\n       router ports: dummy1\n # ip link set dev br1 type bridge mcast_vlan_snooping 0\n $ bridge vlan global show dev br1 vid 2 | grep router\n\nHowever, the port can be re-added to the per-VLAN list even when\nper-VLAN multicast snooping is disabled:\n\n # bridge vlan set vid 2 dev dummy1 mcast_router 0\n # bridge vlan set vid 2 dev dummy1 mcast_router 2\n $ bridge vlan global show dev br1 vid 2 | grep router\n       router ports: dummy1\n\nWhen the VLAN is deleted from the port, the per-{port, VLAN} multicast\ncontext will not be disabled since multicast snooping is not enabled\non the VLAN. As a result, the port will remain in the per-VLAN router\nport list even after it is no longer member in the VLAN. This will lead\nto a use-after-free [2] when the list is traversed (when adding a new\nport to the list, for example):\n\n # ip link add name dummy2 up master br1 type dummy\n # bridge vlan add vid 2 dev dummy2\n # bridge vlan del vid 2 dev dummy1\n # bridge vlan set vid 2 dev dummy2 mcast_router 2\n\nFix these issues by removing the port from the relevant (global or\nper-VLAN) router port list in br_multicast_port_ctx_deinit(). The\nfunction is invoked during port deletion with the per-port multicast\ncontext and during VLAN deletion with the per-{port, VLAN} multicast\ncontext.\n\nNote that deleting the multicast router timer is not enough as it only\ntakes care of the temporary multicast router states (1 or 3) and not the\npermanent one (2).\n\n[1]\nBUG: KASAN: slab-out-of-bounds in br_multicast_add_router.part.0+0x3f1/0x560\nWrite of size 8 at addr ffff888004a67328 by task ip/384\n[...]\nCall Trace:\n \u003cTASK\u003e\n dump_stack\n---truncated---",
  "cwe": "CWE-416",
  "cpes": [
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.16:rc1:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.16:rc2:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.16:rc3:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 7.8,
    "nvd": 7.8
  },
  "repos": [
    {
      "repo": "guard-wait/CVE-2025-38248_EXP",
      "url": "https://github.com/guard-wait/CVE-2025-38248_EXP",
      "created_at": "2026-01-22T04:46:19Z",
      "first_seen_at": "2026-11-14T11:25:11.578Z",
      "stars": 0,
      "is_poc": "yes",
      "kind": "exploit",
      "suspicion_score": 0,
      "suspicious": false,
      "suspicion_reasons": [],
      "status": "analyzed",
      "owner_created_at": "2022-01-20T07:24:43Z"
    }
  ],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \u003c 5df2d582f6e8a81e7ab066464845b38b2fb04094",
          "\u003e= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \u003c 7bb080340bb5ffc928f47c563a9ca1528ce54911",
          "\u003e= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \u003c 4d3c2a1d4c7c33103f1ddfdbc5cfe1ea4f6d0dcd",
          "\u003e= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \u003c bdced577da71b118b6ed4242ebd47f81bf54d406",
          "\u003e= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \u003c f05a4f9e959e0fc098046044c650acf897ea52d2",
          "\u003e= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \u003c 7544f3f5b0b58c396f374d060898b5939da31709"
        ],
        "fixed_in": [
          "5df2d582f6e8a81e7ab066464845b38b2fb04094",
          "7bb080340bb5ffc928f47c563a9ca1528ce54911",
          "4d3c2a1d4c7c33103f1ddfdbc5cfe1ea4f6d0dcd",
          "bdced577da71b118b6ed4242ebd47f81bf54d406",
          "f05a4f9e959e0fc098046044c650acf897ea52d2",
          "7544f3f5b0b58c396f374d060898b5939da31709"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "5.15"
        ],
        "fixed_in": [
          "0",
          "5.15.224",
          "6.1.191",
          "6.6.122",
          "6.12.67",
          "6.15.5",
          "6.16"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to 5df2d582f6e8a81e7ab066464845b38b2fb04094 or 7bb080340bb5ffc928f47c563a9ca1528ce54911 or 4d3c2a1d4c7c33103f1ddfdbc5cfe1ea4f6d0dcd or bdced577da71b118b6ed4242ebd47f81bf54d406 or f05a4f9e959e0fc098046044c650acf897ea52d2 or 7544f3f5b0b58c396f374d060898b5939da31709 or later.",
      "Upgrade Linux to 0 or 5.15.224 or 6.1.191 or 6.6.122 or 6.12.67 or 6.15.5 or 6.16 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
