{"id":"CVE-2025-21640","state":"PUBLISHED","title":"sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nsctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy\n\nAs mentioned in a previous commit of this series, using the 'net'\nstructure via 'current' is not recommended for different reasons:\n\n- Inconsistency: getting info from the reader's/writer's netns vs only\n  from the opener's netns.\n\n- current->nsproxy can be NULL in some cases, resulting in an 'Oops'\n  (null-ptr-deref), e.g. when the current task is exiting, as spotted by\n  syzbot [1] using acct(2).\n\nThe 'net' structure can be obtained from the table->data using\ncontainer_of().\n\nNote that table->data could also be used directly, as this is the only\nmember needed from the 'net' structure, but that would increase the size\nof this fix, to use '*data' everywhere 'net->sctp.sctp_hmac_alg' is\nused.","publishedAt":"2025-01-19T10:17:57.593Z","updatedAt":"2026-10-15T21:51:51.964Z","severity":{"score":7.1,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"5599b212d2f4466e1832a94e9932684aaa364587","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"03ca51faba2b017bf6c90e139434c4117d0afcdc","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"86ddf8118123cb58a0fb8724cad6979c4069065b","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"3cd0659deb9c03535fd61839e91d4d4d3e51ac71","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"ad673e514b2793b8d5902f6ba6ab7e890dea23d5","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"f0bb3935470684306e4e04793a20ac4c4b08de0b","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"ea62dd1383913b5999f3d16ae99d411f41b528d4","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/sctp/sysctl.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.8","versionType":"semver"},{"version":"5.4.292","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.234","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.177","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.125","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.72","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.10","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/sctp/sysctl.c"]}],"references":["https://git.kernel.org/stable/c/5599b212d2f4466e1832a94e9932684aaa364587","https://git.kernel.org/stable/c/03ca51faba2b017bf6c90e139434c4117d0afcdc","https://git.kernel.org/stable/c/86ddf8118123cb58a0fb8724cad6979c4069065b","https://git.kernel.org/stable/c/3cd0659deb9c03535fd61839e91d4d4d3e51ac71","https://git.kernel.org/stable/c/ad673e514b2793b8d5902f6ba6ab7e890dea23d5","https://git.kernel.org/stable/c/f0bb3935470684306e4e04793a20ac4c4b08de0b","https://git.kernel.org/stable/c/ea62dd1383913b5999f3d16ae99d411f41b528d4","https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html","https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html","https://cert-portal.siemens.com/productcert/html/ssa-265688.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:08:39.238Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/21xxx/CVE-2025-21640.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-21640","state":"PUBLISHED","datePublished":"2025-01-19T10:17:57.593Z","dateUpdated":"2026-10-15T21:51:51.964Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T08:45:45.727Z"},"containers":{"cna":{"title":"sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nsctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy\n\nAs mentioned in a previous commit of this series, using the 'net'\nstructure via 'current' is not recommended for different reasons:\n\n- Inconsistency: getting info from the reader's/writer's netns vs only\n  from the opener's netns.\n\n- current->nsproxy can be NULL in some cases, resulting in an 'Oops'\n  (null-ptr-deref), e.g. when the current task is exiting, as spotted by\n  syzbot [1] using acct(2).\n\nThe 'net' structure can be obtained from the table->data using\ncontainer_of().\n\nNote that table->data could also be used directly, as this is the only\nmember needed from the 'net' structure, but that would increase the size\nof this fix, to use '*data' everywhere 'net->sctp.sctp_hmac_alg' is\nused."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"5599b212d2f4466e1832a94e9932684aaa364587","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"03ca51faba2b017bf6c90e139434c4117d0afcdc","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"86ddf8118123cb58a0fb8724cad6979c4069065b","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"3cd0659deb9c03535fd61839e91d4d4d3e51ac71","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"ad673e514b2793b8d5902f6ba6ab7e890dea23d5","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"f0bb3935470684306e4e04793a20ac4c4b08de0b","versionType":"git"},{"version":"3c68198e75111a905ac2412be12bf7b29099729b","status":"affected","lessThan":"ea62dd1383913b5999f3d16ae99d411f41b528d4","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/sctp/sysctl.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.8","versionType":"semver"},{"version":"5.4.292","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.234","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.177","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.125","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.72","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.10","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/sctp/sysctl.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/5599b212d2f4466e1832a94e9932684aaa364587"},{"url":"https://git.kernel.org/stable/c/03ca51faba2b017bf6c90e139434c4117d0afcdc"},{"url":"https://git.kernel.org/stable/c/86ddf8118123cb58a0fb8724cad6979c4069065b"},{"url":"https://git.kernel.org/stable/c/3cd0659deb9c03535fd61839e91d4d4d3e51ac71"},{"url":"https://git.kernel.org/stable/c/ad673e514b2793b8d5902f6ba6ab7e890dea23d5"},{"url":"https://git.kernel.org/stable/c/f0bb3935470684306e4e04793a20ac4c4b08de0b"},{"url":"https://git.kernel.org/stable/c/ea62dd1383913b5999f3d16ae99d411f41b528d4"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","baseScore":7.1,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The buggy handler is only reachable through local interfaces — a write/read on /proc/sys/net/sctp/cookie_hmac_alg or an acct(2)-pinned file — never from received network data. No remote peer input reaches proc_sctp_do_hmac_alg().\nAC:L - Both paths are deterministic and fully attacker-controlled: the netns-confusion write is a plain unshare + SCM_RIGHTS + write(2) sequence with no race, and the acct(2) NULL deref triggers reliably every time the pidns reaper exits. No memory-layout or timing conditions outside the attacker's control.\nPR:L - The cross-namespace path needs only an unprivileged local user, since unprivileged user namespaces (default-enabled on Ubuntu/Debian/Fedora/Android) make the caller owner of the new userns and thus CAP_NET_ADMIN-equivalent over its netns, letting it drive a write that lands in init_net. Only the secondary acct(2) oops path additionally needs CAP_SYS_PACCT.\nUI:N - The attacker performs every step itself — unshare, open, fd passing, write, or acct(2) plus process exit. No victim action or cooperation is involved.\nS:U - The vulnerable component and the impacted resource are both the kernel under the same security authority; per kernel CNA convention namespace/privilege boundary crossings within the kernel are scored Unchanged rather than as a Changed-scope escape.\nC:N - The read path always returns the reader's own netns value, so no data crosses a security boundary, and the NULL dereference discloses no memory contents. There is no read primitive or information leak.\nI:H - An unprivileged user can make the handler write the initial network namespace's sctp_hmac_alg; setting it to \"none\" leaves sp->hmac NULL so sctp_unpack_cookie() jumps to no_hmac and skips signature verification entirely, disabling SCTP state-cookie authentication host-wide and enabling blind association spoofing. That is a serious loss of integrity for a security-relevant global setting.\nA:H - With current->nsproxy NULL during task exit the handler dereferences a NULL pointer, producing a kernel Oops (syzbot-confirmed) — a full panic on panic_on_oops systems and at minimum a task killed in the middle of do_exit with namespaces already torn down."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:53:19.350Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.8","versionEndExcluding":"5.4.292"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.8","versionEndExcluding":"5.10.234"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.8","versionEndExcluding":"5.15.177"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.8","versionEndExcluding":"6.1.125"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.8","versionEndExcluding":"6.6.72"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.8","versionEndExcluding":"6.12.10"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.8","versionEndExcluding":"6.13"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T20:58:23.595Z"}},{"affected":[{"vendor":"Siemens","product":"SIMATIC S7-1500 TM MFP - GNU/Linux subsystem","defaultStatus":"unknown","versions":[{"version":"0","status":"affected","lessThan":"*","versionType":"custom"}]}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html"}],"providerMetadata":{"shortName":"siemens-SADP","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","dateUpdated":"2026-10-15T01:02:43.506Z"},"x_adpType":"supplier"},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2025-21640","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2026-10-15T21:42:36.380698Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-15T21:51:51.964Z"}}]}}}