SecuFocus
Under the hood

Smb4K: the “.” share that slipped past the root mount helper

In Smb4K, an SMB share named “.” was enough to make the root-privileged mount helper accept a mount point that was no longer the intended leaf. Fixed in 4.0.8 on 6 November 2026, and tracked at NVD as CVE-2026-138340.

Bureau Linux sombre : liste de partages SMB dont une entrée réduite à un point, terminal ouvert derrière sur une demande de mot de passe

Generated image · SecuFocus

At a glance

Key points

Smb4K's mount helper builds the mount point from the share name, a value that comes from the server. Up to 4.0.7, a “.” component slipped through the filter, and the security check worked on canonicalised paths. Version 4.0.8 rejects the bare dot, tests the raw path with lstat() and refuses symbolic links.

“.”: a share name that points at no new folder

Smb4K is KDE's SMB share browser. It does not mount anything itself: it hands the job to a separate program, the mount helper, started through KAuth and reachable over D-Bus as org.kde.smb4k.mounthelper. That helper runs with full root privileges, which explains the care taken over what it agrees to mount.

The helper builds the mount point under a fixed prefix followed by the caller's login name: /run/smb4k/<user>/<host>/<share> when /run exists, /var/run/smb4k/… otherwise. The last element comes from the SMB server, so from a machine the user does not always control.

A “.” path component creates nothing. Appended to a directory, it means that directory itself: to the kernel, /run/smb4k/alice/server/. and /run/smb4k/alice/server are the same folder. Before 4.0.8, createMountPoint() rejected an empty component, a component containing “..” and a component containing a path separator; a bare dot went through.

What the 4.0.8 commit changes

The fix is commit ed15d7cd7664bf83a4c8f4f56ecf77b392843552 in the KDE Smb4K repository, authored by Alexander Reinholdt, with the message “Backported from master: Do not allow mounting of shares named '.' and when the mount point is a symlink”. It touches helpers/smb4kmounthelper.cpp, and the 4.0.8 ChangeLog repeats it word for word.

Three changes in that file. createMountPoint() now rejects a path component equal to “.”, next to the checks already in place. The path is no longer built from dir.canonicalPath() but from dir.path(), and the function returns dir.path() instead of dir.canonicalPath().

isMountPointAllowed() changes method. No more comparison between two canonicalised paths: an lstat() on the mount point, a refusal if the call fails or if the entry is a symbolic link (S_ISLNK true), then a prefix test on the raw path, mountPrefix() followed by the caller's login name.

The same commit adds an isMountPointAllowed() call inside mount(), right after the mount point is created, and replaces QDir(mountPoint).canonicalPath() with mountPoint in unmount() and removeMountPoint(). The helper now works on the path it built, not on a form resolved afterwards.

Why a root helper cannot trust a canonicalised path

Canonicalising a path means reducing it to a single form: dots disappear, “..” segments are resolved, symbolic links are followed. Two differently written paths can therefore end up as the same string, and a check made on the canonical form no longer says which path was requested.

For a program mounting on someone else's behalf, the question is not only “where does this lead” but “is this the leaf that user is allowed to occupy”. The old test compared the canonical path of the mount point with the canonical path of the user's directory. The new one compares the raw path with the expected prefix, and refuses any symbolic link before mounting.

One practical consequence: the prefix is no longer resolved. The helper relies on /run/smb4k, or /var/run/smb4k when /run does not exist, and creates the tree itself. That is a shape check, not a security boundary on its own; NVD classifies the flaw as CWE-22, path traversal.

What the attacker needs

The published vector sets two conditions. AV:L, the attack starts on the local machine; PR:L, it needs only low privileges, because an ordinary user triggering a mount is what sets the root helper in motion. On the server side, the attacker needs a share whose name they choose: the very definition of an SMB server under their control.

The score is 6.5 (MEDIUM), vector CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L. High complexity, no user interaction from the victim, high impact on confidentiality and integrity, low on availability. It comes from cve@mitre.org, not from NVD.

The official description is a single sentence: “KDE Smb4K before 4.0.8 mishandles '.' as the name of a share, a different vulnerability than CVE-2025-66003”. NVD gives no exploitation scenario, and neither does the commit: it fixes a validation, it does not demonstrate an attack.

Aim for 4.0.8, and check the installed version

The target version is 4.0.8, dated 6 November 2026 in the ChangeLog; 4.0.7 was dated 4 September 2026. The same batch of fixes carries one unrelated item: the cruid option is back in the helper's whitelist, after a regression affecting mounts made with a Kerberos ticket (BUG 528097). If your Kerberos mounts broke after an update, the installed version is the first thing to look at.

Two neighbouring CVEs should not be mixed up. CVE-2026-138341 covers another defect: “In KDE Smb4K before 4.0.7, the mount helper allows mounting shares with an SMB protocol version before 2.1 (e.g., version 1)”, CWE-424, score 7.0 (HIGH), fixed in 4.0.7. The link between them is stated: that flaw exists because the fix for CVE-2025-66003 was incomplete.

Your distribution's repository is not the installed version. On the Debian side, the security tracker lists smb4k 4.0.0-1+deb13u1 in trixie, and 4.0.8-1 in forky and sid: a stable branch can therefore stay behind. Check the package actually present (dpkg -l smb4k, or the version the application reports) before considering the machine up to date.

What the sources do not say

Three caveats. The commit cites no CVE identifier: the link to CVE-2026-138340 comes from the NVD entry, not from the repository. The symbolic-link half of the fix has no CVE of its own known today, and nothing suggests it will be handled separately. Finally, the NVD entry has been at status “Received” since 29 November 2026: NVD analysis is not finished and the published score is the CNA's.

None of the sources consulted describes observed exploitation. On shared machines that mount SMB shares with Smb4K, the measure is unchanged: move to 4.0.8 and check what the machine actually runs, rather than what its repository offers.

Check and explore

Sources for this article

Numbers connect each reference to the passages that use it. Dates show when the documentation was consulted.

This article draws on the sources above. The exercises are for you to try on your devices; SecuFocus does not present them as tests carried out by its editorial team. Interfaces and features can change. Method and corrections.

Cite this article

Keep this reference with the article when you save or share it.