The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-31707

CVE-2026-31707: Linux Kernel Buffer Overflow Vulnerability

CVE-2026-31707 is a buffer overflow vulnerability in the Linux kernel's ksmbd module that allows integer overflow in message validation. This article covers the technical details, affected versions, and mitigation steps.

Published: May 7, 2026

CVE-2026-31707 Overview

CVE-2026-31707 is an integer overflow vulnerability in the Linux kernel's ksmbd SMB server subsystem. The flaw resides in ipc_validate_msg(), which computes expected response message sizes using attacker-influenced fields from the userspace ksmbd daemon. Three code paths perform unsigned arithmetic that can wrap, allowing a crafted response to bypass the size validation check. Downstream consumers then trust the unverified length, leading to out-of-bounds memory operations [CWE-787].

Critical Impact

A wrapped msg_sz value matching entry->msg_sz enables out-of-bounds writes via memcpy in smb2pdu.c and kmemdup in ksmbd_alloc_user(), threatening kernel memory integrity and availability.

Affected Products

  • Linux kernel ksmbd subsystem (multiple stable branches)
  • Systems running the in-kernel SMB3 server with ksmbd-tools userspace daemon
  • Distributions shipping vulnerable kernels prior to the four upstream stable backports

Discovery Timeline

  • 2026-05-01 - CVE-2026-31707 published to NVD
  • 2026-05-06 - Last updated in NVD database

Technical Details for CVE-2026-31707

Vulnerability Analysis

The ksmbd kernel module communicates with a userspace daemon over a Netlink-based IPC channel. The function ipc_validate_msg() calculates the expected response size for each event type before forwarding the buffer to consumers. Three response types perform arithmetic on attacker-controlled fields without overflow checks.

For KSMBD_EVENT_RPC_REQUEST and KSMBD_EVENT_SHARE_CONFIG_REQUEST, the code adds resp->payload_sz (a __u32) to a fixed struct size in unsigned int arithmetic. A sufficiently large payload_sz causes the sum to wrap below UINT_MAX. For KSMBD_EVENT_LOGIN_REQUEST_EXT, the code multiplies resp->ngroups (a __s32) by sizeof(gid_t). A negative ngroups is converted to SIZE_MAX before the multiplication, producing an attacker-controlled wrapped value.

Root Cause

The root cause is unchecked integer arithmetic mixing signed, unsigned, and size_t types when computing buffer length expectations. When the wrapped msg_sz happens to equal entry->msg_sz, the size check at the next line passes. Consumers in smb2pdu.c:6742 then call memcpy using the original rpc_resp->payload_sz, and ksmbd_alloc_user() calls kmemdup using resp_ext->ngroups, both reading or writing past the allocated buffer.

Attack Vector

Exploitation requires local access with privileges sufficient to influence the ksmbd userspace daemon's response messages, or compromise of the daemon process itself. The attacker crafts an IPC response whose payload_sz or ngroups field triggers integer wraparound such that the computed msg_sz matches the transport-layer length. The kernel then trusts the unverified field, producing out-of-bounds memory access in kernel context.

The upstream fix introduces check_add_overflow() on the RPC and SHARE_CONFIG paths and rejects ngroups values outside [0, NGROUPS_MAX] at the IPC boundary for the LOGIN_REQUEST_EXT path. This mirrors commit aab98e2dbd64, which previously hardened the request side against the same class of overflow. Refer to the upstream patch series for the complete diff.

Detection Methods for CVE-2026-31707

Indicators of Compromise

  • Unexpected crashes, panics, or KASAN reports referencing ipc_validate_msg, ksmbd_alloc_user, or smb2pdu.c in kernel logs.
  • Anomalous ksmbd-tools daemon behavior, including unexpected restarts or memory growth in NDR response paths.
  • SMB session activity correlated with kernel oops events on hosts running ksmbd.

Detection Strategies

  • Audit kernel versions across the fleet and flag hosts running ksmbd builds prior to the upstream fixes.
  • Enable KASAN and kernel panic-on-oops in test environments to surface overflow-driven memory corruption during validation.
  • Monitor dmesg and journald for ksmbd: warnings, particularly entries originating from ipc_validate_msg() or login/RPC handling paths.

Monitoring Recommendations

  • Forward kernel logs to a centralized log platform and alert on ksmbd errors and unexpected SMB service restarts.
  • Track integrity of the ksmbd-tools userspace binary using file integrity monitoring to identify tampering that could weaponize this flaw.
  • Baseline SMB traffic patterns and alert on anomalous session counts or authentication storms preceding kernel instability.

How to Mitigate CVE-2026-31707

Immediate Actions Required

  • Apply the stable kernel updates referenced in the vendor advisories as soon as distribution packages are available.
  • Disable the ksmbd kernel module on hosts that do not require an in-kernel SMB server, falling back to Samba if file sharing is needed.
  • Restrict local access and tighten privilege boundaries on systems that must continue running ksmbd until patched.

Patch Information

The Linux kernel maintainers released fixes across multiple stable branches. The patches add check_add_overflow() on the KSMBD_EVENT_RPC_REQUEST and KSMBD_EVENT_SHARE_CONFIG_REQUEST paths and validate ngroups against NGROUPS_MAX for KSMBD_EVENT_LOGIN_REQUEST_EXT. See the stable commit 299db777, commit 7dd0c858, commit 99c631d0, and commit d6a6aa81.

Workarounds

  • Unload the ksmbd module with modprobe -r ksmbd and blacklist it where SMB serving is not required.
  • Block inbound SMB traffic at host and network firewalls to reduce the attack surface against vulnerable kernels.
  • Limit which local accounts can interact with the ksmbd IPC interface and audit the ksmbd-tools daemon configuration for least privilege.
bash
# Configuration example
# Unload and blacklist the ksmbd module pending patch deployment
sudo modprobe -r ksmbd
echo 'blacklist ksmbd' | sudo tee /etc/modprobe.d/blacklist-ksmbd.conf
sudo update-initramfs -u

# Verify the running kernel no longer exposes the module
lsmod | grep ksmbd

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechLinux

  • SeverityHIGH

  • CVSS Score7.1

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-787
  • Vendor Resources
  • Kernel Code Change

  • Kernel Code Change

  • Kernel Code Change

  • Kernel Code Change
  • Related CVEs
  • CVE-2026-31747: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31748: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31729: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31697: Linux Kernel Buffer Overflow Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English