CVE-2026-139129: xattr: always invoke cap_convert_nscap() for security.capability writes

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

xattr: always invoke capconvertnscap() for security.capability writes

Commit 8db6c34f1dbc ("Introduce v3 namespaced file capabilities") changed capinodesetxattr() to return 0 unconditionally for XATTRNAMECAPS ("security.capability") and moved capability validation into capconvertnscap(), but placed the call inside the "if (size)" block in setxattr(). Commit 7c03e2cda4a5 ("vfs: move capconvertnscap() call into vfssetxattr()") preserved that "size &&" condition in vfssetxattr():

if (size && strcmp(name, XATTRNAMECAPS) == 0) { error = capconvertnscap(idmap, dentry, &value, size); ... }

For security. extended attributes, xattrpermission() skips inodepermission(MAYWRITE) and leaves permission checks to the security module, while capinodesetxattr() returns 0 for XATTRNAMECAPS assuming capconvertnscap() has already validated the write. Because vfssetxattr() treats size == 0 as an empty attribute write (setting value = "") rather than a removal, calling setxattr(2) on "security.capability" with size == 0 bypasses capconvertnscap() and allows an unprivileged caller without CAPSETFCAP or write permission on the target inode to write a 0-byte security.capability xattr (or overwrite an existing one).

When that binary is subsequently executed, getvfscapsfromdisk() reads the 0-byte security.capability xattr and fails the size < sizeof(magicetc) check with -EINVAL, causing execve(2) to fail with -EINVAL.

Always invoke capconvertnscap() when strcmp(name, XATTRNAMECAPS) == 0 regardless of size, so that 0-byte writes hit the existing !ivalue / !validheader() checks in capconvertnscap() and are rejected with -EINVAL.

Affected Software

9 affected componentsFixes available
Linux Linux kernel
linux/kernel>=4.14.0<6.6.163
6.6.163
linux/kernel>=6.7.0<6.12.119
6.12.119
linux/kernel>=6.13.0<6.18.65
6.18.65
linux/kernel>=6.19.0<7.3.6
7.3.6
debian/linux*
debian/linux*
debian/linux<7.3.6-1
7.3.6-1
debian/linux<=6.1.176-1, <=6.1.192-3, <=6.12.117-1, <=6.12.118-1
7.3.6-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.6.163
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.119
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.65
  4. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.6
  5. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 7.3.6-1
  6. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch xattr: always invoke cap_convert_nscap() for security.capability writes

Event History

Nov 30, 2026
CVE Published
via MITRE·01:31 PM
Data Sourced
via MITRE·01:31 PM
Description
Data Sourced
via OSV·01:31 PM
DescriptionAffected Software
Data Sourced
via NVD·02:18 PM
Description

Frequently Asked Questions

1

What does an attacker need to trigger the issue?

A local unprivileged caller must invoke setxattr(2) on the security.capability extended attribute with a size of zero. The flawed path can bypass cap_convert_nscap() validation, including the expected CAP_SETFCAP check.

2

Is this triggered by removing the capability attribute?

No. In this path, a zero-size security.capability write is treated as setting an empty attribute value rather than removing the attribute. That distinction is what allows the validation call to be skipped.

3

Why do normal extended-attribute permission checks not prevent this?

For security.* attributes, xattr_permission() skips inode_permission(MAY_WRITE) and defers checks to the security module. For security.capability, cap_inode_setxattr() returns success on the assumption that cap_convert_nscap() has already validated the write.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203