CVE-2026-31707
ksmbd: validate response sizes in ipc_validate_msg()
Description
In the Linux kernel, the following vulnerability has been resolved: ksmbd: validate response sizes in ipc_validate_msg() ipc_validate_msg() computes the expected message size for each response type by adding (or multiplying) attacker-controlled fields from the daemon response to a fixed struct size in unsigned int arithmetic. Three cases can overflow: KSMBD_EVENT_RPC_REQUEST: msg_sz = sizeof(struct ksmbd_rpc_command) + resp->payload_sz; KSMBD_EVENT_SHARE_CONFIG_REQUEST: msg_sz = sizeof(struct ksmbd_share_config_response) + resp->payload_sz; KSMBD_EVENT_LOGIN_REQUEST_EXT: msg_sz = sizeof(struct ksmbd_login_response_ext) + resp->ngroups * sizeof(gid_t); resp->payload_sz is __u32 and resp->ngroups is __s32. Each addition can wrap in unsigned int; the multiplication by sizeof(gid_t) mixes signed and size_t, so a negative ngroups is converted to SIZE_MAX before the multiply. A wrapped value of msg_sz that happens to equal entry->msg_sz bypasses the size check on the next line, and downstream consumers (smb2pdu.c:6742 memcpy using rpc_resp->payload_sz, kmemdup in ksmbd_alloc_user using resp_ext->ngroups) then trust the unverified length. Use check_add_overflow() on the RPC_REQUEST and SHARE_CONFIG_REQUEST paths to detect integer overflow without constraining functional payload size; userspace ksmbd-tools grows NDR responses in 4096-byte chunks for calls like NetShareEnumAll, so a hard transport cap is unworkable on the response side. For LOGIN_REQUEST_EXT, reject resp->ngroups outside the signed [0, NGROUPS_MAX] range up front and report the error from ipc_validate_msg() so it fires at the IPC boundary; with that bound the subsequent multiplication and addition stay well below UINT_MAX. The now-redundant ngroups check and pr_err in ksmbd_alloc_user() are removed. This is the response-side analogue of aab98e2dbd64 ("ksmbd: fix integer overflows on 32 bit systems"), which hardened the request side.
INFO
Published Date :
May 1, 2026, 2:16 p.m.
Last Modified :
Nov. 11, 2026, 9:10 p.m.
Remotely Exploit :
No
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS 3.1 | HIGH | 416baaa9-dc9f-4396-8d5f-8c081fb06d67 |
Solution
- Apply kernel updates with overflow checks for response sizes.
- Validate group counts against expected ranges.
- Reject invalid group counts at the IPC boundary.
- Remove redundant checks in ksmbd_alloc_user.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-31707.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-31707 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-31707
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-31707 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-31707 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Translated by [email protected]
Nov. 11, 2026
Action Type Old Value New Value Added Translation Title: Linux Kernel, Description: En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: ksmbd: validar tamaños de respuesta en ipc_validate_msg() ipc_validate_msg() calcula el tamaño de mensaje esperado para cada tipo de respuesta sumando (o multiplicando) campos controlados por el atacante de la respuesta del demonio a un tamaño de estructura fijo en aritmética de entero sin signo. Tres casos pueden desbordarse: KSMBD_EVENT_RPC_REQUEST: msg_sz = sizeof(struct ksmbd_rpc_command) + resp -> payload_sz; KSMBD_EVENT_SHARE_CONFIG_REQUEST: msg_sz = sizeof(struct ksmbd_share_config_response) + resp -> payload_sz; KSMBD_EVENT_LOGIN_REQUEST_EXT: msg_sz = sizeof(struct ksmbd_login_response_ext) + resp -> ngroups * sizeof(gid_t); resp -> payload_sz es __u32 y resp -> ngroups es __s32. Cada suma puede envolverse en entero sin signo; la multiplicación por sizeof(gid_t) mezcla con signo y size_t, por lo que un ngroups negativo se convierte a SIZE_MAX antes de la multiplicación. Un valor envuelto de msg_sz que resulta ser igual a entry -> msg_sz omite la comprobación de tamaño en la siguiente línea, y los consumidores posteriores (smb2pdu.c:6742 memcpy usando rpc_resp -> payload_sz, kmemdup en ksmbd_alloc_user usando resp_ext -> ngroups) entonces confían en la longitud no verificada. Usar check_add_overflow() en las rutas RPC_REQUEST y SHARE_CONFIG_REQUEST para detectar desbordamiento de entero sin restringir el tamaño de carga útil funcional; las herramientas ksmbd del espacio de usuario aumentan las respuestas NDR en bloques de 4096 bytes para llamadas como NetShareEnumAll, por lo que un límite de transporte estricto es inviable en el lado de la respuesta. Para LOGIN_REQUEST_EXT, rechazar resp -> ngroups fuera del rango con signo [0, NGROUPS_MAX] de antemano y reportar el error desde ipc_validate_msg() para que se active en el límite IPC; con ese límite la multiplicación y suma subsiguientes se mantienen muy por debajo de UINT_MAX. La comprobación de ngroups ahora redundante y pr_err en ksmbd_alloc_user() se eliminan. Este es el análogo del lado de la respuesta de aab98e2dbd64 (’ksmbd: corregir desbordamientos de entero en sistemas de 32 bits’), que reforzó el lado de la solicitud. -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Oct. 30, 2026
Action Type Old Value New Value Added Affected Affected value modified. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/31xxx/CVE-2026-31707.json">CVE-2026-31707</a> Added Reference https://git.kernel.org/stable/c/299db777ea0cfa5c407e41b045c24a14c034c27b Added Reference https://git.kernel.org/stable/c/52518503a1a00bc33e9522c4eb05df023e3ae978 Added Reference https://git.kernel.org/stable/c/7dd0c858e1909769a4c91842724315ee74f1a5f1 Added Reference https://git.kernel.org/stable/c/99c631d0366c1eab8fb188fe66425f4581ebdde4 Added Reference https://git.kernel.org/stable/c/bf396208418371174869baba9434535cd3288e80 Added Reference https://git.kernel.org/stable/c/d6a6aa81eac2c9bff66dc6e191179cb69a14426b Removed Reference https://git.kernel.org/stable/c/299db777ea0cfa5c407e41b045c24a14c034c27b Removed Reference https://git.kernel.org/stable/c/7dd0c858e1909769a4c91842724315ee74f1a5f1 Removed Reference https://git.kernel.org/stable/c/99c631d0366c1eab8fb188fe66425f4581ebdde4 Removed Reference https://git.kernel.org/stable/c/bf396208418371174869baba9434535cd3288e80 Removed Reference https://git.kernel.org/stable/c/d6a6aa81eac2c9bff66dc6e191179cb69a14426b Removed Reference Type https://git.kernel.org/stable/c/299db777ea0cfa5c407e41b045c24a14c034c27b Types: Patch Removed Reference Type https://git.kernel.org/stable/c/7dd0c858e1909769a4c91842724315ee74f1a5f1 Types: Patch Removed Reference Type https://git.kernel.org/stable/c/99c631d0366c1eab8fb188fe66425f4581ebdde4 Types: Patch Removed Reference Type https://git.kernel.org/stable/c/d6a6aa81eac2c9bff66dc6e191179cb69a14426b Types: Patch -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jun. 17, 2026
Action Type Old Value New Value Added Affected [{'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '0626e6641f6b467447c81dd7678a69c66f7746cf', 'lessThan': 'bf396208418371174869baba9434535cd3288e80', 'versionType': 'git'}, {'status': 'affected', 'version': '0626e6641f6b467447c81dd7678a69c66f7746cf', 'lessThan': '7dd0c858e1909769a4c91842724315ee74f1a5f1', 'versionType': 'git'}, {'status': 'affected', 'version': '0626e6641f6b467447c81dd7678a69c66f7746cf', 'lessThan': '299db777ea0cfa5c407e41b045c24a14c034c27b', 'versionType': 'git'}, {'status': 'affected', 'version': '0626e6641f6b467447c81dd7678a69c66f7746cf', 'lessThan': '99c631d0366c1eab8fb188fe66425f4581ebdde4', 'versionType': 'git'}, {'status': 'affected', 'version': '0626e6641f6b467447c81dd7678a69c66f7746cf', 'lessThan': 'd6a6aa81eac2c9bff66dc6e191179cb69a14426b', 'versionType': 'git'}], 'programFiles': ['fs/smb/server/mgmt/user_config.c', 'fs/smb/server/transport_ipc.c'], 'defaultStatus': 'unaffected'}, {'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '5.15'}, {'status': 'unaffected', 'version': '0', 'lessThan': '5.15', 'versionType': 'semver'}, {'status': 'unaffected', 'version': '6.6.141', 'versionType': 'semver', 'lessThanOrEqual': '6.6.*'}, {'status': 'unaffected', 'version': '6.12.84', 'versionType': 'semver', 'lessThanOrEqual': '6.12.*'}, {'status': 'unaffected', 'version': '6.18.25', 'versionType': 'semver', 'lessThanOrEqual': '6.18.*'}, {'status': 'unaffected', 'version': '7.0.2', 'versionType': 'semver', 'lessThanOrEqual': '7.0.*'}, {'status': 'unaffected', 'version': '7.1', 'versionType': 'original_commit_for_fix', 'lessThanOrEqual': '*'}], 'programFiles': ['fs/smb/server/mgmt/user_config.c', 'fs/smb/server/transport_ipc.c'], 'defaultStatus': 'affected'}] -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 23, 2026
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/bf396208418371174869baba9434535cd3288e80 -
Initial Analysis by [email protected]
May. 06, 2026
Action Type Old Value New Value Added CWE CWE-787 Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.13 up to (excluding) 6.18.25 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.19 up to (excluding) 7.0.2 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.15 up to (excluding) 6.12.84 Added Reference Type kernel.org: https://git.kernel.org/stable/c/299db777ea0cfa5c407e41b045c24a14c034c27b Types: Patch Added Reference Type kernel.org: https://git.kernel.org/stable/c/7dd0c858e1909769a4c91842724315ee74f1a5f1 Types: Patch Added Reference Type kernel.org: https://git.kernel.org/stable/c/99c631d0366c1eab8fb188fe66425f4581ebdde4 Types: Patch Added Reference Type kernel.org: https://git.kernel.org/stable/c/d6a6aa81eac2c9bff66dc6e191179cb69a14426b Types: Patch -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 03, 2026
Action Type Old Value New Value Added CVSS V3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H -
New CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 01, 2026
Action Type Old Value New Value Added Description In the Linux kernel, the following vulnerability has been resolved: ksmbd: validate response sizes in ipc_validate_msg() ipc_validate_msg() computes the expected message size for each response type by adding (or multiplying) attacker-controlled fields from the daemon response to a fixed struct size in unsigned int arithmetic. Three cases can overflow: KSMBD_EVENT_RPC_REQUEST: msg_sz = sizeof(struct ksmbd_rpc_command) + resp->payload_sz; KSMBD_EVENT_SHARE_CONFIG_REQUEST: msg_sz = sizeof(struct ksmbd_share_config_response) + resp->payload_sz; KSMBD_EVENT_LOGIN_REQUEST_EXT: msg_sz = sizeof(struct ksmbd_login_response_ext) + resp->ngroups * sizeof(gid_t); resp->payload_sz is __u32 and resp->ngroups is __s32. Each addition can wrap in unsigned int; the multiplication by sizeof(gid_t) mixes signed and size_t, so a negative ngroups is converted to SIZE_MAX before the multiply. A wrapped value of msg_sz that happens to equal entry->msg_sz bypasses the size check on the next line, and downstream consumers (smb2pdu.c:6742 memcpy using rpc_resp->payload_sz, kmemdup in ksmbd_alloc_user using resp_ext->ngroups) then trust the unverified length. Use check_add_overflow() on the RPC_REQUEST and SHARE_CONFIG_REQUEST paths to detect integer overflow without constraining functional payload size; userspace ksmbd-tools grows NDR responses in 4096-byte chunks for calls like NetShareEnumAll, so a hard transport cap is unworkable on the response side. For LOGIN_REQUEST_EXT, reject resp->ngroups outside the signed [0, NGROUPS_MAX] range up front and report the error from ipc_validate_msg() so it fires at the IPC boundary; with that bound the subsequent multiplication and addition stay well below UINT_MAX. The now-redundant ngroups check and pr_err in ksmbd_alloc_user() are removed. This is the response-side analogue of aab98e2dbd64 ("ksmbd: fix integer overflows on 32 bit systems"), which hardened the request side. Added Reference https://git.kernel.org/stable/c/299db777ea0cfa5c407e41b045c24a14c034c27b Added Reference https://git.kernel.org/stable/c/7dd0c858e1909769a4c91842724315ee74f1a5f1 Added Reference https://git.kernel.org/stable/c/99c631d0366c1eab8fb188fe66425f4581ebdde4 Added Reference https://git.kernel.org/stable/c/d6a6aa81eac2c9bff66dc6e191179cb69a14426b