{"id":"CVE-2025-37947","state":"PUBLISHED","title":"ksmbd: prevent out-of-bounds stream writes by validating *pos","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: prevent out-of-bounds stream writes by validating *pos\n\nksmbd_vfs_stream_write() did not validate whether the write offset\n(*pos) was within the bounds of the existing stream data length (v_len).\nIf *pos was greater than or equal to v_len, this could lead to an\nout-of-bounds memory write.\n\nThis patch adds a check to ensure *pos is less than v_len before\nproceeding. If the condition fails, -EINVAL is returned.","publishedAt":"2025-05-20T16:01:43.788Z","updatedAt":"2026-08-05T11:58:33.808Z","severity":{"score":8.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"7f61da79df86fd140c7768e668ad846bfa7ec8e1","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"04c8a38c60346bb5a7c49b276de7233f703ce9cb","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"d62ba16563a86aae052f96d270b3b6f78fca154c","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"e6356499fd216ed6343ae0363f4c9303f02c5034","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"0ca6df4f40cf4c32487944aaf48319cb6c25accc","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/vfs.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"6.1.139","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.91","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.29","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.14.7","status":"unaffected","lessThanOrEqual":"6.14.*","versionType":"semver"},{"version":"6.15","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/vfs.c"]}],"references":["https://git.kernel.org/stable/c/7f61da79df86fd140c7768e668ad846bfa7ec8e1","https://git.kernel.org/stable/c/04c8a38c60346bb5a7c49b276de7233f703ce9cb","https://git.kernel.org/stable/c/d62ba16563a86aae052f96d270b3b6f78fca154c","https://git.kernel.org/stable/c/e6356499fd216ed6343ae0363f4c9303f02c5034","https://git.kernel.org/stable/c/0ca6df4f40cf4c32487944aaf48319cb6c25accc","https://github.com/doyensec/KSMBD-CVE-2025-37947/blob/main/CVE-2025-37947.c","https://lists.debian.org/debian-lts-announce/2025/08/msg00010.html"],"weaknesses":["CWE-787"],"ingestedAt":"2026-10-29T20:09:03.054Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/37xxx/CVE-2025-37947.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-37947","state":"PUBLISHED","datePublished":"2025-05-20T16:01:43.788Z","dateUpdated":"2026-08-05T11:58:33.808Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T04:51:23.972Z"},"containers":{"cna":{"title":"ksmbd: prevent out-of-bounds stream writes by validating *pos","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: prevent out-of-bounds stream writes by validating *pos\n\nksmbd_vfs_stream_write() did not validate whether the write offset\n(*pos) was within the bounds of the existing stream data length (v_len).\nIf *pos was greater than or equal to v_len, this could lead to an\nout-of-bounds memory write.\n\nThis patch adds a check to ensure *pos is less than v_len before\nproceeding. If the condition fails, -EINVAL is returned."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"7f61da79df86fd140c7768e668ad846bfa7ec8e1","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"04c8a38c60346bb5a7c49b276de7233f703ce9cb","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"d62ba16563a86aae052f96d270b3b6f78fca154c","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"e6356499fd216ed6343ae0363f4c9303f02c5034","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"0ca6df4f40cf4c32487944aaf48319cb6c25accc","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/vfs.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"6.1.139","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.91","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.29","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.14.7","status":"unaffected","lessThanOrEqual":"6.14.*","versionType":"semver"},{"version":"6.15","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/vfs.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/7f61da79df86fd140c7768e668ad846bfa7ec8e1"},{"url":"https://git.kernel.org/stable/c/04c8a38c60346bb5a7c49b276de7233f703ce9cb"},{"url":"https://git.kernel.org/stable/c/d62ba16563a86aae052f96d270b3b6f78fca154c"},{"url":"https://git.kernel.org/stable/c/e6356499fd216ed6343ae0363f4c9303f02c5034"},{"url":"https://git.kernel.org/stable/c/0ca6df4f40cf4c32487944aaf48319cb6c25accc"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":8.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:N - The vulnerable code is in ksmbd, the in-kernel SMB server listening on TCP port 445, reached by sending a crafted SMB2 WRITE request to an alternate data stream; the attacker operates entirely over the network.\nAC:L - The attacker directly controls the write Offset (*pos) and the data payload; setting Offset ≥ stream length deterministically triggers the out-of-bounds write with no race or uncontrolled precondition.\nPR:L - The write path is post-authentication, requiring a valid SMB session, a tree connect to a writable share, and an open stream handle — achievable by any low-privileged authenticated SMB user, matching prior post-auth ksmbd scoring (CVE-2025-22040/22041).\nUI:N - Exploitation requires only that the attacker send SMB2 requests to the server; no action by any local user or victim is needed.\nS:U - The corruption occurs within the kernel's own memory and does not cross into a different security authority such as a VM host or IOMMU domain.\nC:H - The attacker-controlled-offset heap out-of-bounds write corrupts adjacent kernel memory and can be leveraged (e.g., manipulating adjacent objects) to disclose kernel memory, consistent with high confidentiality impact for memory corruption.\nI:H - The bug provides a controlled-offset, controlled-content out-of-bounds heap write, a powerful arbitrary-write primitive enabling kernel memory/control-flow corruption.\nA:H - Writing past the 64 KB buffer at a large attacker-chosen offset corrupts kernel heap/adjacent allocations and reliably causes an oops or panic."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:58:33.808Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.1.139"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.6.91"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.12.29"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.14.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.15"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/doyensec/KSMBD-CVE-2025-37947/blob/main/CVE-2025-37947.c","tags":["exploit"]}],"metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2025-37947","role":"CISA Coordinator","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-10-10T03:55:20.529301Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-787","lang":"en","type":"CWE","description":"CWE-787 Out-of-bounds Write"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-02-26T18:28:05.529Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/08/msg00010.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T19:57:37.368Z"}}]}}}