{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-21735",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-21735"
  ],
  "published": "2025-02-27T02:12:01Z",
  "summary": "NFC: nci: Add bounds checking in nci_hci_create_pipe()",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nNFC: nci: Add bounds checking in nci_hci_create_pipe()\n\nThe \"pipe\" variable is a u8 which comes from the network.  If it's more\nthan 127, then it results in memory corruption in the caller,\nnci_hci_connect_gate().",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.129",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-21735"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/bd249109d266f1d52548c46634a15b71656e0d44"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/674e17c5933779a8bf5c15d596fdfcb5ccdebbc2"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/10b3f947b609713e04022101f492d288a014ddfa"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d5a461c315e5ff92657f84d8ba50caa5abf5c22a"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/172cdfc3a5ea20289c58fb73dadc6fd4a8784a4e"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/2ae4bade5a64d126bd18eb66bd419005c5550218"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/59c7ed20217c0939862fbf8145bc49d5b3a13f4f"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/110b43ef05342d5a11284cc8b21582b698b4ef1c"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T12:19:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 8.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:A - The malformed `pipe` value arrives in an HCI-over-NCI response from the NFC controller/HCI host network (host controller, UICC, eSE), not from any local syscall argument, so the attacker sits on the NFC proximity/host-network boundary rather than on the local host. NFC is a limited-distance, logically adjacent transport, matching AV:A.\nAC:L - The attacker only has to return a pipe identifier of 129-255 in the ADM_CREATE_PIPE response; the out-of-bounds index is taken deterministically with no race, no memory-layout grooming, and no state the attacker cannot influence. Every attempt succeeds on the first try.\nPR:N - The attacker supplying the response needs no credentials or account on the target system whatsoever. The local side of the path (`nfc_dev_up` \u2192 `discover_se`) is performed automatically by the platform's NFC daemon at boot/NFC-enable, so no attacker-held privilege is involved in reaching the vulnerable code.\nUI:N - HCI session init runs as part of normal NFC device bring-up and secure-element discovery, which happens automatically when the NFC stack starts; no victim action is required for the malicious response to be parsed.\nS:U - The corruption occurs in kernel heap memory belonging to the NFC subsystem and is handled entirely within the kernel's own security authority. No VM, IOMMU, or sandbox boundary is crossed.\nC:H - The attacker controls the index of an out-of-bounds array write into `struct nci_hci_dev`, and kernel-heap memory corruption of this kind is treatable as a primitive that can be leveraged toward disclosure of adjacent kernel state; corrupted `gate2pipe[]` entries are subsequently emitted in HCP headers back over the HCI link, giving the attacker an observable read-back channel for the corrupted region.\nI:H - This is a genuine out-of-bounds array write with an attacker-controlled offset (`pipes[129..255]`), overwriting kernel data structures outside the intended array bounds \u2014 the fix author explicitly describes it as \"memory corruption in the caller\". Out-of-bounds writes are scored High for integrity.\nA:H - The out-of-bounds index triggers a kernel panic outright on hardened/Android configurations built with CONFIG_UBSAN_BOUNDS + CONFIG_UBSAN_TRAP, and otherwise corrupts the gate-to-pipe mapping state so the NFC/secure-element stack operates on bogus pipe identifiers, leaving the subsystem in an inconsistent, non-functional state."
    }
  }
}
