CVE-2026-61579Tunnelblick Improper Link Resolution Before File Access ('Link Following')
NVD
Vulnerability Summary
Summary Tunnelblick installs a root LaunchDaemon, `tunnelblickd`, that runs the helper binary `tunnelblick-helper` as root for any process connecting to a local unix domain socket. Two defects combine into a reliable local privilege escalation from an ordinary user to root. First, the daemon socket is created world readable and writable (`SockPathMode = 438`, which is octal `0666`) and the daemon does not authorize the caller. It reads the peer uid with `getpeereid()` only to label the work, then executes `tunnelblick-helper` as root for that uid. Any local user, including a non admin account or a sandboxed process, can invoke privileged helper subcommands. Second, the routine that secures a private configuration folder runs as root and "normalizes" ownership and permissions by walking the folder. For a symbolic link entry it calls `chown()`, which follows the link, on the link path, so it rewrites the owner of the link target; it also calls `chmod()`, which follows the link, on the target. An attacker who places a symbolic link inside a configuration folder that this routine processes can make root take ownership of, and change the mode of, an arbitrary file. The socket reachable subcommand `revertToShadow` reaches the secure routine (`secureOneFolder(<private config>, isPrivate=YES, callerUid)`) without any administrator authorization. An unprivileged user can therefore make root `chown` an arbitrary root owned file to their own account, then rewrite it, which yields arbitrary code execution as root. This was reproduced end to end on stable 8.0.2: a `root:wheel` file that the unprivileged user could not write was changed to the user's ownership and then written, with no admin password at the trigger step. Affected components `tunnelblick/net.tunnelblick.tunnelblick.tunnelblickd.plist`: `SockPathMode => 438` (octal `0666`). `tunnelblick/tunnelblickd.m`: accept loop calls `getpeereid()` then `runTool(client_euid, ...)` with no admin check. `tunnelblick/sharedRoutines.m`: `checkSetItemOwnership` (around line 646), the `checkSetOwnership` deep loop (around line 725), `checkSetPermissions` (around line 772), and `secureOneFolder` (around line 1195). `tunnelblick/tunnelblick-helper.m`: `revertToShadow` dispatch (around line 3610) and its call to `secureOneFolder(privatePath, YES, gUidOfUser)` (around line 1886). `tunnelblick/defines.h`: `#define TUNNELBLICKD_OPENVPNSTART_HEADER_C "openvpnstart: "`. Details Background `tunnelblickd` runs as root and listens on `/var/run/net.tunnelblick.tunnelblick.tunnelblickd.socket`. The GUI, running as the user, sends requests of the form `"openvpnstart: " + <subcommand> [ "\t" <arg> ] + "\n"`. The daemon executes `tunnelblick-helper <subcommand> <args...>` as root and returns a header `"<status> <stdoutLen> <stderrLen>\n"` followed by the helper output. The daemon (`tunnelblickd`, reachable with no authorization) is distinct from the installer (run through a macOS Authorization dialog). Securing a brand new configuration goes through the admin authorized installer, but `revertToShadow`, which re secures an existing private configuration from its shadow, is exposed through the no authorization daemon socket. Per user shadow copies are stored at `/Library/Application Support/Tunnelblick/Users/<user>/<config>.tblk` and are owned by root. Defect 1: world writable socket, no authorization `net.tunnelblick.tunnelblick.tunnelblickd.plist`: ```xml <key>SockPathMode</key> <integer>438</integer> <key>SockPathName</key> <string>/var/run/net.tunnelblick.tunnelblick.tunnelblickd.socket</string> ``` `tunnelblickd.m` reads the peer uid but never authorizes it before running the helper as root: ```c if ( 0 != getpeereid(filedesc, &client_euid, &client_egid) ) { ... continue; } / no check that client_euid is an admin or the console user / struct passwd pw = getpwuid(client_euid); ... OSStatus status = runTool(client_euid, client_egid, userName, userHome, tunnelblickHelperPath, arguments, ...); / runs tunnelblick-helper as root / ``` Any local user that can write the `0666` socket can have arbitrary `tunnelblick-helper` subcommands executed as root. Defect 2: symlink following `chown` and `chmod` as root In `sharedRoutines.m`, `checkSetItemOwnership` uses `chown()`, which follows symbolic links, when `traverseLink` is YES: ```c if ( traverseLink || ( ! [[atts objectForKey: NSFileType] isEqualToString: NSFileTypeSymbolicLink] ) ) { result = chown([path fileSystemRepresentation], uid, gid); / follows the symlink to the TARGET / } else { result = lchown([path fileSystemRepresentation], uid, gid); / operates on the link itself / } ``` The `checkSetOwnership` deep pass reads the link's own attributes once, then calls `checkSetItemOwnership` twice for a symbolic link. The first call lchowns the link; the second, with `traverseLink:YES`, follows the link and chowns the target: ```c while ( (file = [dirEnum nextObject]) ) { NSString filePath = [path stringByAppendingPathComponent: file]; atts = [[NSFileManager defaultManager] tbFileAttributesAtPath: filePath traverseLink: NO]; / link's own attrs / changedDeep = checkSetItemOwnership(filePath, atts, uid, gid, NO) || changedDeep; / lchown the link / if ( [[atts objectForKey: NSFileType] isEqualToString: NSFileTypeSymbolicLink] ) { changedDeep = checkSetItemOwnership(filePath, atts, uid, gid, YES) || changedDeep; / chown follows to the TARGET / } } ``` `checkSetPermissions` likewise uses `chmod()` rather than `lchmod()` or `fchmodat(..., AT_SYMLINK_NOFOLLOW)`, so it also follows symbolic links to the target. `secureOneFolder` drives both, and for a private configuration the target owner is the caller: ```c BOOL secureOneFolder(NSString path, BOOL isPrivate, uid_t theUser) { ... if ( isPrivate ) { user = theUser; ... group = ADMIN_GROUP_ID; / 80 / } ... BOOL result = checkSetOwnership(path, YES, user, group); / deep, follows symlinks as shown above / result = result && checkSetPermissions(path, folderPerms, YES); ... } ``` Why ownership reliably transfers The deep loop changes ownership through the link only when `checkSetItemOwnership` finds the symbolic link's own `(owner, group)` different from the secure target identity `(theUser, admin)`. Observed behavior: When the symbolic link is delivered through the root owned shadow, its own owner is root (`0:0`), so the comparison against `(theUser, admin)` is clearly unequal, the `traverseLink:YES` branch runs `chown()`, and the target owner is rewritten to the caller. This is the reliable escalation, and it is exactly the state that `revertToShadow` produces, because it copies the root owned shadow back into the private folder before securing. When the symbolic link is instead an attacker owned link processed in place, the same secure pass was observed to follow the link only for `chmod()`, changing the target mode without transferring ownership. Both behaviors are root following an attacker controlled symbolic link; the shadow delivered path is the one that yields full ownership theft, and it is reachable with no admin through `revertToShadow`. No authorization reachability through `revertToShadow` `tunnelblick-helper.m` dispatches `revertToShadow` straight from the socket request and reaches the secure routine as root over the user's private configuration directory: ```c static void revertToShadow (NSString fileName) { if ( gUidOfUser == 0 ) { ... exitOpenvpnstart(188); } / must be a non root caller / NSString privatePath = .../Configurations/<fileName>; NSString shadowPath = .../Users/<user>/<fileName>; / root owned shadow / ... becomeRoot(@"copy config"); [NSFileManager.defaultManager tbCopyPath: shadowPath toPath: privatePath ...]; / symlinks preserved / stopBeingRoot(); ... becomeRoot(@"secure reverted .tblk"); BOOL secured = secureOneFolder(privatePath, YES, gUidOfUser); / root, theUser is the caller / stopBeingRoot(); } ``` Proof of Concept A proof of concept was included in the original report by Nikko Enggaliano but is not being published. Impact An unprivileged local user can run any `tunnelblick-helper` subcommand as root through the unauthenticated, world writable socket, and can make root take ownership of and `chmod` an arbitrary file through a symbolic link processed by `secureOneFolder`, reachable with no admin through `revertToShadow`. By targeting a root controlled file that runs as root, such as a `LaunchDaemon` or `LaunchAgent` plist, an `/etc/sudoers.d` entry, a `periodic` or cron script, or a Tunnelblick root run up or down script, the attacker gains arbitrary code execution as root. The independent `chmod` following primitive can also weaken permissions of sensitive root owned files (information disclosure) or render files inaccessible (denial of service). Remediation Authorize the daemon socket. Set `SockPathMode` to `0600` or `0660` (and restrict to an `admin` group if appropriate), and in `tunnelblickd.m` verify the peer before running the helper as root, for example by requiring `getpeereid()` to return an admin uid or the active console user. Never follow symbolic links when changing ownership or permissions as root. In `checkSetItemOwnership` and `checkSetOwnership`, remove the `traverseLink:YES` second call, use `lchown` only, and skip symbolic link entries in the deep pass. In `checkSetPermissions`, use `fchmodat(fd, name, mode, AT_SYMLINK_NOFOLLOW)` or `lchmod` instead of `chmod`. In `secureOneFolder`, refuse to operate on a configuration directory that contains symbolic links, or open each item with `O_NOFOLLOW` and validate it before modification. Treat the private configuration directory, and anything copied from it into the shadow, as untrusted input. Strip symbolic links when creating the shadow in `tbCopyPath`.
CVSS v3.1 Base Metrics — Score 8.8
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:HAttack VectorLocal
Attack ComplexityLow
Privileges RequiredLow
User InteractionNone
ScopeChanged
ConfidentialityHigh
IntegrityHigh
AvailabilityHigh
Affected & Patched Versions
- Tunnelblick <= 8.0.2, < 9.0beta06
- 8.03, 9.0beta07
What to do
Prioritize this fix. Exploit code is public, so attacks can follow quickly.
- Check whether you run Tunnelblick and which version.
- Update to a patched version listed above, then confirm the new version.
- Review logs and exposed services for signs of earlier compromise.
Timeline
- Oct 30, 2026Published
- Oct 30, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new Tunnelblick CVEsYou are reading CVE-2026-61579. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsExternal References
Data last checked: Nov 25, 2026 14:01 UTC