{"id":"CVE-2026-31712","aliases":["CVE-2026-31712"],"related":[],"kind":"vulnerability","state":"published","title":"ksmbd: require minimum ACE size in smb_check_perm_dacl()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: require minimum ACE size in smb_check_perm_dacl()\n\nBoth ACE-walk loops in smb_check_perm_dacl() only guard against an\nunder-sized remaining buffer, not against an ACE whose declared\n`ace->size` is smaller than the struct it claims to describe:\n\n  if (offsetof(struct smb_ace, access_req) > aces_size)\n      break;\n  ace_size = le16_to_cpu(ace->size);\n  if (ace_size > aces_size)\n      break;\n\nThe first check only requires the 4-byte ACE header to be in bounds;\nit does not require access_req (4 bytes at offset 4) to be readable.\nAn attacker who has set a crafted DACL on a file they own can declare\nace->size == 4 with aces_size == 4, pass both checks, and then\n\n  granted |= le32_to_cpu(ace->access_req);               /* upper loop */\n  compare_sids(&sid, &ace->sid);                         /* lower loop */\n\nreads access_req at offset 4 (OOB by up to 4 bytes) and ace->sid at\noffset 8 (OOB by up to CIFS_SID_BASE_SIZE + SID_MAX_SUB_AUTHORITIES\n* 4 bytes).\n\nTighten both loops to require\n\n  ace_size >= offsetof(struct smb_ace, sid) + CIFS_SID_BASE_SIZE\n\nwhich is the smallest valid on-wire ACE layout (4-byte header +\n4-byte access_req + 8-byte sid base with zero sub-auths).  Also\nreject ACEs whose sid.num_subauth exceeds SID_MAX_SUB_AUTHORITIES\nbefore letting compare_sids() dereference sub_auth[] entries.\n\nparse_sec_desc() already enforces an equivalent check (lines 441-448);\nsmb_check_perm_dacl() simply grew weaker validation over time.\n\nReachability: authenticated SMB client with permission to set an ACL\non a file.  On a subsequent CREATE against that file, the kernel\nwalks the stored DACL via smb_check_perm_dacl() and triggers the\nOOB read.  Not pre-auth, and the OOB read is not reflected to the\nattacker, but KASAN reports and kernel state corruption are\npossible.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: require minimum ACE size in smb_check_perm_dacl()\n\nBoth ACE-walk loops in smb_check_perm_dacl() only guard against an\nunder-sized remaining buffer, not against an ACE whose declared\n`ace->size` is smaller than the struct it claims to describe:\n\n  if (offsetof(struct smb_ace, access_req) > aces_size)\n      break;\n  ace_size = le16_to_cpu(ace->size);\n  if (ace_size > aces_size)\n      break;\n\nThe first check only requires the 4-byte ACE header to be in bounds;\nit does not require access_req (4 bytes at offset 4) to be readable.\nAn attacker who has set a crafted DACL on a file they own can declare\nace->size == 4 with aces_size == 4, pass both checks, and then\n\n  granted |= le32_to_cpu(ace->access_req);               /* upper loop */\n  compare_sids(&sid, &ace->sid);                         /* lower loop */\n\nreads access_req at offset 4 (OOB by up to 4 bytes) and ace->sid at\noffset 8 (OOB by up to CIFS_SID_BASE_SIZE + SID_MAX_SUB_AUTHORITIES\n* 4 bytes).\n\nTighten both loops to require\n\n  ace_size >= offsetof(struct smb_ace, sid) + CIFS_SID_BASE_SIZE\n\nwhich is the smallest valid on-wire ACE layout (4-byte header +\n4-byte access_req + 8-byte sid base with zero sub-auths).  Also\nreject ACEs whose sid.num_subauth exceeds SID_MAX_SUB_AUTHORITIES\nbefore letting compare_sids() dereference sub_auth[] entries.\n\nparse_sec_desc() already enforces an equivalent check (lines 441-448);\nsmb_check_perm_dacl() simply grew weaker validation over time.\n\nReachability: authenticated SMB client with permission to set an ACL\non a file.  On a subsequent CREATE against that file, the kernel\nwalks the stored DACL via smb_check_perm_dacl() and triggers the\nOOB read.  Not pre-auth, and the OOB read is not reflected to the\nattacker, but KASAN reports and kernel state corruption are\npossible.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad:\n\nksmbd: requerir tamaño mínimo de ACE en smb_check_perm_dacl()\n\nAmbos bucles de recorrido de ACE en smb_check_perm_dacl() solo protegen contra un búfer restante de tamaño insuficiente, no contra un ACE cuyo ’ace  ->  size’ declarado es más pequeño que la estructura que afirma describir:\n\n  if (offsetof(struct smb_ace, access_req) > aces_size)\n      break;\n  ace_size = le16_to_cpu(ace  ->  size);\n  if (ace_size > aces_size)\n      break;\n\nLa primera comprobación solo requiere que el encabezado ACE de 4 bytes esté dentro de los límites; no requiere que access_req (4 bytes en el desplazamiento 4) sea legible. Un atacante que ha establecido un DACL manipulado en un archivo de su propiedad puede declarar ace  ->  size == 4 con aces_size == 4, pasar ambas comprobaciones y luego\n\n  granted |= le32_to_cpu(ace  ->  access_req);               /* upper loop */\n  compare_sids(&sid, &ace  ->  sid);                         /* lower loop */\n\nlee access_req en el desplazamiento 4 (fuera de límites por hasta 4 bytes) y ace  ->  sid en el desplazamiento 8 (fuera de límites por hasta CIFS_SID_BASE_SIZE + SID_MAX_SUB_AUTHORITIES * 4 bytes).\n\nAjustar ambos bucles para requerir\n\n  ace_size >= offsetof(struct smb_ace, sid) + CIFS_SID_BASE_SIZE\n\nque es el diseño de ACE en la red más pequeño y válido (encabezado de 4 bytes + access_req de 4 bytes + base sid de 8 bytes con cero sub-autoridades). También rechazar ACEs cuyo sid.num_subauth excede SID_MAX_SUB_AUTHORITIES antes de permitir que compare_sids() desreferencie las entradas de sub_auth[].\n\nparse_sec_desc() ya aplica una comprobación equivalente (líneas 441-448); smb_check_perm_dacl() simplemente desarrolló una validación más débil con el tiempo.\n\nAlcanzabilidad: cliente SMB autenticado con permiso para establecer una ACL en un archivo. En un CREATE posterior contra ese archivo, el kernel recorre el DACL almacenado a través de smb_check_perm_dacl() y desencadena la lectura fuera de límites (OOB). No es pre-autenticación, y la lectura fuera de límites (OOB) no se refleja al atacante, pero los informes de KASAN y la corrupción del estado del kernel son posibles.","source":"nvd"}],"published":"2026-05-01T13:56:08.583Z","modified":"2026-11-11T21:10:00.200Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","score":8.3,"rating":"HIGH"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"type":"git","introduced":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","fixed":"282cbbb476b9f35793452bc461934af4c7eca169","status":"affected"},{"type":"git","introduced":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","fixed":"f20adc4ef7428bc485ee83fd1a592252fb87718b","status":"affected"},{"type":"git","introduced":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","fixed":"325d4ac11f526cb8964cff14548ccf02d8c756d8","status":"affected"},{"type":"git","introduced":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","fixed":"95e5aa3c3261da8c95b27d7aecf8ee39b9f86a4c","status":"affected"},{"type":"git","introduced":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","fixed":"90089584b2e25c4510b7b987387b4405f0673ece","status":"affected"},{"type":"git","introduced":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","fixed":"151b1799861fde38087c08f613abc2843ef597b0","status":"affected"},{"type":"git","introduced":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","fixed":"d07b26f39246a82399661936dd0c853983cfade7","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.15","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.15","status":"unaffected"},{"type":"semver","introduced":"5.15.210","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.176","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.140","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.84","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.25","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.0.2","lastAffected":"7.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.15","fixed":"6.12.84"},{"status":"affected","introduced":"6.13","fixed":"6.18.25"},{"status":"affected","introduced":"6.19","fixed":"7.0.2"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/282cbbb476b9f35793452bc461934af4c7eca169","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f20adc4ef7428bc485ee83fd1a592252fb87718b","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/325d4ac11f526cb8964cff14548ccf02d8c756d8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/95e5aa3c3261da8c95b27d7aecf8ee39b9f86a4c","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/90089584b2e25c4510b7b987387b4405f0673ece","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/151b1799861fde38087c08f613abc2843ef597b0","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d07b26f39246a82399661936dd0c853983cfade7","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-784472.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31712","url":"https://www.cve.org/CVERecord?id=CVE-2026-31712","licence":"CVE Terms of Use","modified":"2026-10-15T01:18:08.369Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31712","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31712","licence":"Public domain","modified":"2026-11-11T21:10:00.200Z"}],"updatedAt":"2026-11-25T22:59:20.344Z","epss":{"score":0.00329,"percentile":0.28027,"date":"2026-12-01T12:00:22.000Z"}}