{"api_version":"1","generated_at":"2026-11-30T18:46:13+00:00","cve":"CVE-2026-139129","urls":{"html":"https://cve.report/CVE-2026-139129","api":"https://cve.report/api/cve/CVE-2026-139129.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-139129","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-139129"},"summary":{"title":"xattr: always invoke cap_convert_nscap() for security.capability writes","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nxattr: always invoke cap_convert_nscap() for security.capability writes\n\nCommit 8db6c34f1dbc (\"Introduce v3 namespaced file capabilities\") changed\ncap_inode_setxattr() to return 0 unconditionally for XATTR_NAME_CAPS\n(\"security.capability\") and moved capability validation into\ncap_convert_nscap(), but placed the call inside the \"if (size)\" block in\nsetxattr(). Commit 7c03e2cda4a5 (\"vfs: move cap_convert_nscap() call into\nvfs_setxattr()\") preserved that \"size &&\" condition in vfs_setxattr():\n\n\tif (size && strcmp(name, XATTR_NAME_CAPS) == 0) {\n\t\terror = cap_convert_nscap(idmap, dentry, &value, size);\n\t\t...\n\t}\n\nFor security.* extended attributes, xattr_permission() skips\ninode_permission(MAY_WRITE) and leaves permission checks to the security\nmodule, while cap_inode_setxattr() returns 0 for XATTR_NAME_CAPS assuming\ncap_convert_nscap() has already validated the write. Because\n__vfs_setxattr() treats size == 0 as an empty attribute write (setting\nvalue = \"\") rather than a removal, calling setxattr(2) on\n\"security.capability\" with size == 0 bypasses cap_convert_nscap() and\nallows an unprivileged caller without CAP_SETFCAP or write permission on\nthe target inode to write a 0-byte security.capability xattr (or\noverwrite an existing one).\n\nWhen that binary is subsequently executed, get_vfs_caps_from_disk() reads\nthe 0-byte security.capability xattr and fails the\nsize < sizeof(magic_etc) check with -EINVAL, causing execve(2) to fail\nwith -EINVAL.\n\nAlways invoke cap_convert_nscap() when strcmp(name, XATTR_NAME_CAPS) == 0\nregardless of size, so that 0-byte writes hit the existing !*ivalue /\n!validheader() checks in cap_convert_nscap() and are rejected with\n-EINVAL.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:18:27","updated_at":"2026-11-30 14:18:27"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/a0d86d8e7297fb51b924642fe256b4a8d70ff7c7","name":"https://git.kernel.org/stable/c/a0d86d8e7297fb51b924642fe256b4a8d70ff7c7","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/3a0260fc82412405c00491efe2287650bcbfb373","name":"https://git.kernel.org/stable/c/3a0260fc82412405c00491efe2287650bcbfb373","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/136fbb8cba5236655a4e0be62b96a8f3bb4f3568","name":"https://git.kernel.org/stable/c/136fbb8cba5236655a4e0be62b96a8f3bb4f3568","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/0f4a9e682f7fa5becc3af7204606d9bf4780e425","name":"https://git.kernel.org/stable/c/0f4a9e682f7fa5becc3af7204606d9bf4780e425","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/95d264a93340840b52d54ccf321dc7e4875d88b4","name":"https://git.kernel.org/stable/c/95d264a93340840b52d54ccf321dc7e4875d88b4","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-139129","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139129","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8db6c34f1dbc8e06aa016a9b829b06902c3e1340 95d264a93340840b52d54ccf321dc7e4875d88b4 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8db6c34f1dbc8e06aa016a9b829b06902c3e1340 a0d86d8e7297fb51b924642fe256b4a8d70ff7c7 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8db6c34f1dbc8e06aa016a9b829b06902c3e1340 136fbb8cba5236655a4e0be62b96a8f3bb4f3568 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8db6c34f1dbc8e06aa016a9b829b06902c3e1340 3a0260fc82412405c00491efe2287650bcbfb373 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8db6c34f1dbc8e06aa016a9b829b06902c3e1340 0f4a9e682f7fa5becc3af7204606d9bf4780e425 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 4.14","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 4.14 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.163 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.119 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.65 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.6 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["fs/xattr.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"95d264a93340840b52d54ccf321dc7e4875d88b4","status":"affected","version":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","versionType":"git"},{"lessThan":"a0d86d8e7297fb51b924642fe256b4a8d70ff7c7","status":"affected","version":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","versionType":"git"},{"lessThan":"136fbb8cba5236655a4e0be62b96a8f3bb4f3568","status":"affected","version":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","versionType":"git"},{"lessThan":"3a0260fc82412405c00491efe2287650bcbfb373","status":"affected","version":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","versionType":"git"},{"lessThan":"0f4a9e682f7fa5becc3af7204606d9bf4780e425","status":"affected","version":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["fs/xattr.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"4.14"},{"lessThan":"4.14","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.163","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.119","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.65","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.6","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.163","versionStartIncluding":"4.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.119","versionStartIncluding":"4.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.65","versionStartIncluding":"4.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.6","versionStartIncluding":"4.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"4.14","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nxattr: always invoke cap_convert_nscap() for security.capability writes\n\nCommit 8db6c34f1dbc (\"Introduce v3 namespaced file capabilities\") changed\ncap_inode_setxattr() to return 0 unconditionally for XATTR_NAME_CAPS\n(\"security.capability\") and moved capability validation into\ncap_convert_nscap(), but placed the call inside the \"if (size)\" block in\nsetxattr(). Commit 7c03e2cda4a5 (\"vfs: move cap_convert_nscap() call into\nvfs_setxattr()\") preserved that \"size &&\" condition in vfs_setxattr():\n\n\tif (size && strcmp(name, XATTR_NAME_CAPS) == 0) {\n\t\terror = cap_convert_nscap(idmap, dentry, &value, size);\n\t\t...\n\t}\n\nFor security.* extended attributes, xattr_permission() skips\ninode_permission(MAY_WRITE) and leaves permission checks to the security\nmodule, while cap_inode_setxattr() returns 0 for XATTR_NAME_CAPS assuming\ncap_convert_nscap() has already validated the write. Because\n__vfs_setxattr() treats size == 0 as an empty attribute write (setting\nvalue = \"\") rather than a removal, calling setxattr(2) on\n\"security.capability\" with size == 0 bypasses cap_convert_nscap() and\nallows an unprivileged caller without CAP_SETFCAP or write permission on\nthe target inode to write a 0-byte security.capability xattr (or\noverwrite an existing one).\n\nWhen that binary is subsequently executed, get_vfs_caps_from_disk() reads\nthe 0-byte security.capability xattr and fails the\nsize < sizeof(magic_etc) check with -EINVAL, causing execve(2) to fail\nwith -EINVAL.\n\nAlways invoke cap_convert_nscap() when strcmp(name, XATTR_NAME_CAPS) == 0\nregardless of size, so that 0-byte writes hit the existing !*ivalue /\n!validheader() checks in cap_convert_nscap() and are rejected with\n-EINVAL."}],"providerMetadata":{"dateUpdated":"2026-11-30T13:31:50.995Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/95d264a93340840b52d54ccf321dc7e4875d88b4"},{"url":"https://git.kernel.org/stable/c/a0d86d8e7297fb51b924642fe256b4a8d70ff7c7"},{"url":"https://git.kernel.org/stable/c/136fbb8cba5236655a4e0be62b96a8f3bb4f3568"},{"url":"https://git.kernel.org/stable/c/3a0260fc82412405c00491efe2287650bcbfb373"},{"url":"https://git.kernel.org/stable/c/0f4a9e682f7fa5becc3af7204606d9bf4780e425"}],"title":"xattr: always invoke cap_convert_nscap() for security.capability writes","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-139129","datePublished":"2026-11-30T13:31:50.995Z","dateReserved":"2026-11-30T13:22:15.915Z","dateUpdated":"2026-11-30T13:31:50.995Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:18:27","lastModifiedDate":"2026-11-30 14:18:27","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"139129","Ordinal":"1","Title":"xattr: always invoke cap_convert_nscap() for security.capability","CVE":"CVE-2026-139129","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"139129","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nxattr: always invoke cap_convert_nscap() for security.capability writes\n\nCommit 8db6c34f1dbc (\"Introduce v3 namespaced file capabilities\") changed\ncap_inode_setxattr() to return 0 unconditionally for XATTR_NAME_CAPS\n(\"security.capability\") and moved capability validation into\ncap_convert_nscap(), but placed the call inside the \"if (size)\" block in\nsetxattr(). Commit 7c03e2cda4a5 (\"vfs: move cap_convert_nscap() call into\nvfs_setxattr()\") preserved that \"size &&\" condition in vfs_setxattr():\n\n\tif (size && strcmp(name, XATTR_NAME_CAPS) == 0) {\n\t\terror = cap_convert_nscap(idmap, dentry, &value, size);\n\t\t...\n\t}\n\nFor security.* extended attributes, xattr_permission() skips\ninode_permission(MAY_WRITE) and leaves permission checks to the security\nmodule, while cap_inode_setxattr() returns 0 for XATTR_NAME_CAPS assuming\ncap_convert_nscap() has already validated the write. Because\n__vfs_setxattr() treats size == 0 as an empty attribute write (setting\nvalue = \"\") rather than a removal, calling setxattr(2) on\n\"security.capability\" with size == 0 bypasses cap_convert_nscap() and\nallows an unprivileged caller without CAP_SETFCAP or write permission on\nthe target inode to write a 0-byte security.capability xattr (or\noverwrite an existing one).\n\nWhen that binary is subsequently executed, get_vfs_caps_from_disk() reads\nthe 0-byte security.capability xattr and fails the\nsize < sizeof(magic_etc) check with -EINVAL, causing execve(2) to fail\nwith -EINVAL.\n\nAlways invoke cap_convert_nscap() when strcmp(name, XATTR_NAME_CAPS) == 0\nregardless of size, so that 0-byte writes hit the existing !*ivalue /\n!validheader() checks in cap_convert_nscap() and are rejected with\n-EINVAL.","Type":"Description","Title":"xattr: always invoke cap_convert_nscap() for security.capability"}]}}}