VYPR
High severity8.1NVD Advisory· Published Apr 3, 2026· Updated Apr 27, 2026

CVE-2026-31392

CVE-2026-31392

Description

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

smb: client: fix krb5 mount with username option

Customer reported that some of their krb5 mounts were failing against a single server as the client was trying to mount the shares with wrong credentials. It turned out the client was reusing SMB session from first mount to try mounting the other shares, even though a different username= option had been specified to the other mounts.

By using username mount option along with sec=krb5 to search for principals from keytab is supported by cifs.upcall(8) since cifs-utils-4.8. So fix this by matching username mount option in match_session() even with Kerberos.

For example, the second mount below should fail with -ENOKEY as there is no 'foobar' principal in keytab (/etc/krb5.keytab). The client ends up reusing SMB session from first mount to perform the second one, which is wrong.

$ ktutil
ktutil:  add_entry -password -p testuser -k 1 -e aes256-cts
Password for testuser@ZELDA.TEST:
ktutil:  write_kt /etc/krb5.keytab
ktutil:  quit
$ klist -ke
Keytab name: FILE:/etc/krb5.keytab
KVNO Principal
 ---- ----------------------------------------------------------------
   1 testuser@ZELDA.TEST (aes256-cts-hmac-sha1-96)
$ mount.cifs //w22-root2/scratch /mnt/1 -o sec=krb5,username=testuser
$ mount.cifs //w22-root2/scratch /mnt/2 -o sec=krb5,username=foobar
$ mount -t cifs | grep -Po 'username=\K\w+'
testuser
testuser

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Linux kernel SMB client fails to check username mount option for Kerberos sessions, allowing reuse of wrong credentials.

CVE-2026-31392 describes a vulnerability in the Linux kernel's CIFS/SMB client. The bug resides in the match_session() function, which did not consider the username= mount option when matching existing sessions for Kerberos-authenticated mounts (sec=krb5). As a result, if a user mounts a share with one username, subsequent mounts to the same server with a different username would incorrectly reuse the initial session, using the first username's credentials [1].

To exploit this, an attacker would need the ability to mount a CIFS share with Kerberos authentication and specify a different username. No additional authentication is required beyond the initial mount. The client would then bypass the intended keytab lookup for the second username, effectively ignoring the username= option. The example in the description shows two mounts, one with username=testuser and another with username=foobar, both ending up with the same testuser credentials.

The impact is improper authentication: a user can gain access to a share that should require different credentials (e.g., a non-existent principal), potentially leading to unauthorized data access or privilege escalation. The issue was reported by customers experiencing failed mounts with wrong credentials.

The fix, which adds the username option to the session matching logic for Kerberos, has been applied to the stable Linux kernel branches [1]. Users are advised to update their kernels to include the patched version.

AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

1

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

6

News mentions

0

No linked articles in our index yet.