CIFSwitch Linux Flaw Can Let Local Users Gain Root on Some Systems
A newly disclosed Linux local privilege escalation flaw called CIFSwitch can allow a low-privileged local user to gain root access on some Linux systems. The issue affects the interaction between the Linux kernel CIFS client and the root-privileged cifs.upcall helper provided by cifs-utils.
A public write-up from Asim Manizada explains that the attack works by forging cifs.spnego key descriptions that should only come from the kernel’s CIFS subsystem. In vulnerable setups, a local user can trigger request-key handling in a way that launches cifs.upcall as root with attacker-controlled fields.
Access content across the globe at the highest speed rate.
70% of our readers choose Private Internet Access
70% of our readers choose ExpressVPN
Browse the web from multiple devices with industry-standard security protocols.
Faster dedicated servers for specific actions (currently at summer discounts)
In an oss-security disclosure, Manizada said the CVE assignment was still pending. That makes the name CIFSwitch the clearest public identifier for now, although Linux distributions may track the fix under their own advisories until a CVE appears.
What CIFSwitch Targets
CIFS, also known through the SMB family of network file-sharing protocols, lets Linux systems mount Windows-style file shares. The kernel handles the filesystem side, while userspace tools help with tasks the kernel should not perform directly.
The cifs.upcall manual page describes cifs.upcall as a userspace helper for the Linux CIFS client filesystem. It normally runs when the kernel calls request-key for a specific key type, including cifs.spnego, which supports Kerberos session key handling.
CIFSwitch abuses trust across that boundary. The kernel and helper expected cifs.spnego descriptions to carry trusted kernel-generated fields, such as pid, uid, creduid, and upcall_target. The flaw appears when unprivileged userspace supplies forged versions of those fields.
How the Root Access Chain Works
| Step | What Happens | Why It Matters |
|---|---|---|
| Forged request | A local user creates a crafted cifs.spnego request. | The request can reach the normal request-key flow. |
| Root helper launch | The request-key rule starts cifs.upcall as root. | The helper receives attacker-controlled fields. |
| Namespace switch | The attacker supplies pid and upcall_target values. | The helper can enter a namespace controlled by the attacker. |
| NSS lookup | The helper performs account lookup before dropping privileges. | A malicious NSS setup can load attacker-controlled code as root. |
| Privilege gain | The exploit can write privileged configuration or execute root-level code. | The attacker can gain root access on affected systems. |
The exploit path depends on a subtle timing and trust issue. cifs.upcall treats fields inside the key description as if they came from kernel CIFS, but a local attacker can make a similar request from userspace.
The CIFSwitch write-up says the forged pid and upcall_target fields become especially important because upcall_target=app can make the helper switch into the namespaces of the supplied process. If that namespace contains attacker-controlled NSS configuration and a malicious libnss module, the root helper can load it before it drops privileges.
Why Not Every Linux System Is Exposed
CIFSwitch is serious, but it is not universal. Successful exploitation requires several conditions to line up on the same machine.
The system needs a vulnerable kernel, cifs-utils with the relevant cifs.upcall behavior, the default cifs.spnego request-key rule, and permission for unprivileged users to create user and mount namespaces. AppArmor, SELinux, or other Linux Security Module policies can also block the chain on some distributions.
The Openwall mailing list post lists several tested distributions that were exploitable under stock settings and others that became exploitable after cifs-utils was installed or security policies were relaxed. Fedora and several newer enterprise builds appeared blocked by default policy in the researcher’s testing.
Patch Adds a Kernel-Side Trust Check
The upstream fix changes how the cifs.spnego key type accepts descriptions. Instead of allowing userspace-created descriptions to pass through, the kernel now checks whether the request comes from the CIFS client’s private SPNEGO credentials.
The upstream Linux kernel patch is titled “smb: client: reject userspace cifs.spnego descriptions.” The patch adds a vet_description hook and rejects cifs.spnego descriptions unless CIFS itself makes the request through its private credential path.
The commit explains the core risk plainly: cifs.spnego descriptions contain authority-bearing fields, and cifs.upcall treats those fields as kernel-originating inputs. The fix blocks userspace from creating keys of that type through request_key or add_key in the vulnerable trust path.
Public PoC Raises the Urgency for Defenders
Manizada also released a proof-of-concept tool to help defenders, maintainers, and authorized security teams validate exposure and patches. That means attackers can study the bug too, so administrators should not delay kernel updates.
The CIFSwitch GitHub repository says the PoC is meant for lawful, authorized testing on systems that testers own or have explicit permission to assess. It also notes that the PoC builds helper components, including a fake NSS library used to validate whether the vulnerable chain can reach privileged execution.
Security teams should avoid running public exploit code on production systems. Use isolated test environments or vendor-provided detection and patch validation methods when possible.
Who Should Prioritize the Fix
- Linux desktop fleets where local users can create namespaces.
- Servers that allow shell access for multiple users.
- Developer workstations with cifs-utils installed.
- Cloud images or lab systems with relaxed SELinux or AppArmor policies.
- Systems that use CIFS or SMB mounts with Kerberos authentication.
- Shared Linux systems where one compromised account could become a full host compromise.
Administrators should first check for vendor kernel updates. Distribution backports may carry the fix without changing the visible upstream kernel version, so package changelogs and vendor advisories matter more than version numbers alone.
Teams should also review whether cifs-utils is needed. If the system does not mount CIFS or SMB shares, removing the package or preventing the CIFS module from loading can reduce the attack surface.
Mitigation Options Before Patching
The most reliable fix is to install a patched kernel from the system vendor. Temporary controls can reduce risk, but they should not replace the update.
- Apply distribution kernel updates that include the CIFSwitch fix.
- Remove cifs-utils on systems that do not need CIFS mounts.
- Block the CIFS kernel module from loading when CIFS is unused and the module is not built in.
- Override the default cifs.spnego request-key rule if Kerberos CIFS support is not required.
- Disable unprivileged user namespaces where workloads do not need them.
- Keep SELinux or AppArmor enforcing, and avoid relaxing namespace-related protections without review.
The manual page also shows why request-key configuration matters. cifs.upcall is designed to be called through request-key rules for cifs.spnego, so changing those rules can be a useful defense-in-depth step on systems that do not need Kerberos-backed CIFS mounts.
What Security Teams Should Monitor
CIFSwitch is a local bug, so detection depends on host-level visibility. Security teams should watch for unusual request-key activity involving cifs.spnego, unexpected cifs.upcall execution, namespace creation by untrusted users, and suspicious NSS library loading from non-standard locations.
The PoC repository also helps defenders understand the observable chain without needing to guess at every artifact. Signals around request-key, cifs.upcall, namespace switching, and NSS module loading should receive priority in endpoint detection rules.
Because public exploit details now exist, organizations should treat exposed multi-user Linux systems as priority patch targets. The highest-risk systems are those where cifs-utils is present, unprivileged namespaces remain enabled, and local users can run code without strong confinement.
FAQ
CIFSwitch is a Linux local privilege escalation flaw involving the kernel CIFS client and the cifs-utils cifs.upcall helper. It can let a low-privileged local user gain root access on systems where several kernel, userspace, namespace, and security policy conditions align.
The public oss-security disclosure said the CVE assignment was still pending at the time of disclosure. Until a CVE is assigned, CIFSwitch remains the clearest public name for tracking the issue.
CIFSwitch is a local privilege escalation issue. An attacker needs local code execution or access to a low-privileged account before using the bug to attempt root access.
Systems are at risk when they have a vulnerable kernel, affected cifs-utils behavior, the default cifs.spnego request-key rule, unprivileged namespace creation enabled, and SELinux or AppArmor policies that do not block the exploit path.
Administrators should install vendor kernel updates that include the CIFSwitch fix. Temporary mitigations include removing cifs-utils where unused, blocking the CIFS module when possible, overriding the cifs.spnego request-key rule where Kerberos CIFS is not required, and disabling unprivileged user namespaces where workloads allow it.
Read our disclosure page to find out how can you help VPNCentral sustain the editorial team Read more
User forum
0 messages