{
  "id": "cve-2025-37899",
  "title": "o3 helps find a Linux kernel ksmbd use-after-free",
  "product": "Linux kernel (ksmbd SMB server)",
  "ai_system": "OpenAI o3",
  "organization": "Sean Heelan",
  "summary": "Independent researcher Sean Heelan reports a use-after-free of sess->user in the ksmbd session-logoff handler, reachable when a second connection binds to the same session. The fix removes the free in smb2pdu.c and is tagged for stable backporting.",
  "ai_role": "Heelan ran o3 through the API 100 times on about 12k lines of SMB handler code, with no scaffolding or tools. o3 reported the bug in some runs with a signal-to-noise ratio he puts near 1:50, and he identified the real finding himself and wrote the patch.",
  "disclosure_date": "2025-05-22",
  "ai_attribution_date": "2025-05-22",
  "classification": "undisclosed",
  "classification_note": "Per the author's account the bug was not previously known to him; the source does not independently show it was unknown to others.",
  "cves": [
    "CVE-2025-37899"
  ],
  "source_url": "https://sean.heelan.io/2025/05/22/how-i-used-o3-to-find-cve-2025-37899-a-remote-zeroday-vulnerability-in-the-linux-kernels-smb-implementation/",
  "ai_source_url": "https://sean.heelan.io/2025/05/22/how-i-used-o3-to-find-cve-2025-37899-a-remote-zeroday-vulnerability-in-the-linux-kernels-smb-implementation/",
  "remediation": "fix documented",
  "remediation_note": "The kernel commit 2fc9feff45d9 (ksmbd: fix use-after-free in session logoff) authored by Heelan removes the faulty free. The kernel release containing it was not established here.",
  "advisory_url": "https://github.com/torvalds/linux/commit/2fc9feff45d92a92cd5f96487655d5be23fb7e2b",
  "checked_date": "2026-11-14",
  "cvss": [
    {
      "cve": "CVE-2025-37899",
      "version": "3.1",
      "score": 8.8,
      "vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "source_url": "https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2025/37xxx/CVE-2025-37899.json",
      "source_name": "Linux (CNA; CVE Program record)",
      "checked_date": "2026-11-16",
      "scenarios": [
        "AV:N - ksmbd is the in-kernel SMB server; both the freeing SMB2 LOGOFF and the racing SMB2 SESSION_SETUP (multichannel bind) are ordinary SMB PDUs delivered over TCP/445 from a remote client. No local access is required.\nAC:L - The attacker controls both sides of the race — they open both TCP connections and choose when to send LOGOFF and the binding SESSION_SETUP — and both paths block on slow ksmbd.mountd IPC round trips (`ksmbd_ipc_login_request()` / `ksmbd_ipc_logout_request()`), giving a very wide window that can be retried indefinitely with fresh sessions.\nPR:L - `smb2_session_logoff()` is gated by `ksmbd_conn_good()` and a successful `ksmbd_session_lookup_all()`, and channel binding requires a non-guest session, so the attacker needs one ordinary unprivileged SMB account (any share user, no admin rights) — matching the kernel CNA scoring of the sibling multichannel session UAFs CVE-2025-22040/22041.\nUI:N - The attacker drives both connections and both SMB requests entirely on their own; no action by any local user or administrator is needed.\nS:U - The corruption stays within the kernel's own memory and security authority — a standard in-kernel use-after-free with no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - The freed `struct ksmbd_user` holds `name`, `passkey` and `passkey_sz`; after reclaim, `ksmbd_compare_user()` performs a `memcmp` of attacker-chosen length through a dangling pointer (unbounded OOB read usable as an oracle) and `smb2_query_info` FS_OBJECTID copies 16 bytes via `user_passkey(sess->user)` straight into the network response, disclosing kernel memory and the victim's NTLM passkey to the remote client.\nI:H - `set_user_flag(sess->user, KSMBD_USER_FLAG_BAD_PASSWORD)` performs an OR-write into the freed object, and `sess->user->uid`/`->gid` from freed memory drive `smb_inherit_dacl()` and file ownership; combined with heap spraying of the reclaimed slab object this yields a write primitive suitable for control-flow hijack.\nA:H - Dereferencing the freed `ksmbd_user` (and the `sess->user = NULL` store racing other readers) reliably produces kernel oopses, slab corruption, or a panic, taking down the file server."
      ]
    }
  ],
  "impacts": [
    {
      "cves": [
        "CVE-2025-37899"
      ],
      "consequences": [
        "other"
      ],
      "conditions": "A concurrent SMB session setup can use the session user object while another thread frees it during session logoff, creating a use-after-free. No further consequence established.",
      "exploitation": "Exploitation in the wild is not established by the cited description.",
      "source_url": "https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2025/37xxx/CVE-2025-37899.json",
      "checked_date": "2026-11-16"
    }
  ]
}
