Dev.to Security 🔐 Cybersecurity 👁 0 📖 4 min read

CVE-2026-62336: CVE-2026-62336: Local Privilege Escalation via Symlink Following in qbee-agent

CVE-2026-62336: Local Privilege Escalation via Symlink Following in qbee-agent Vulnerability ID: CVE-2026-62336 CVSS Score: 8.5 Published: 2026-11-17 CVE-2026-62336 (GHSA-xhv5-8fpq-g7hf) is a high-severity local pri

CVE-2026-62336: Local Privilege Escalation via Symlink Following in qbee-agent

Vulnerability ID: CVE-2026-62336
CVSS Score: 8.5
Published: 2026-11-17

CVE-2026-62336 (GHSA-xhv5-8fpq-g7hf) is a high-severity local privilege escalation, arbitrary file overwrite, and denial-of-service vulnerability in qbee-agent, the client daemon for the qbee.io IoT device management platform. Prior to version 2026.27, the root-privileged agent failed to validate path components against symbolic links during directory creation and file opening operations in app/configuration/file_manager.go. Local unprivileged users can exploit this flaw by planting symlinks in user-controlled configuration paths or predictable temporary staging locations, causing the daemon to overwrite, truncate, or change ownership of sensitive root-owned system files.

TL;DR

An improper link resolution flaw (CWE-59) in qbee-agent prior to version 2026.27 allows local unprivileged attackers to escalate privileges to root or corrupt system files by planting symbolic links in managed directories (such as ~/.ssh) or predictable temporary staging paths (/tmp/.bundle.raucb.part).

⚠️ Exploit Status: POC

Technical Details

  • CVE ID: CVE-2026-62336 (GHSA-xhv5-8fpq-g7hf)
  • Weakness: CWE-59 (Improper Link Resolution Before File Access)
  • Attack Vector: Local (Unprivileged User / Symlink Planting)
  • CVSS v4.0: 8.5 High (CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N)
  • EPSS Score: 0.10% (0.84th Percentile)
  • Impact: Local Privilege Escalation to root, Arbitrary File Overwrite, Denial of Service
  • Exploit Status: Proof-of-Concept Available (Unit Test Reproducer)
  • CISA KEV Status: Not Listed

Affected Systems

  • qbee-io/qbee-agent
  • qbee-agent: < 2026.27 (Fixed in: 2026.27)

Code Analysis

Commit: 0fdf8e4

Enforce syscall.O_NOFOLLOW in createFile and validate ancestor directories with os.Lstat in makeDirectories to prevent CWE-59 symlink traversal.

diff --git a/app/configuration/file_manager.go b/app/configuration/file_manager.go
index acf2b210..d3fca838 100644
--- a/app/configuration/file_manager.go
+++ b/app/configuration/file_manager.go
@@ -491,13 +491,18 @@ func calculateTemplateDigest(src string, params map[string]string) (string, erro
 }

 // createFile under provided path and with provided uid and gid.
+//
+// The agent typically runs as root, so all path resolution here must refuse
+// to follow attacker-controlled symlinks (CWE-59). makeDirectories rejects
+// symlinked intermediate components; O_NOFOLLOW rejects a symlinked final
+// component so we never open, truncate, or chown an attacker-chosen target.
 func createFile(path string, fileCreateData *fileCreateData, permission os.FileMode, truncate bool) (*os.File, error) {
    var err error
    if err = makeDirectories(path, fileManagerDefaultDirectoryPermission, fileCreateData.uid, fileCreateData.gid); err != nil {
        return nil, err
    }

-   openFlags := os.O_RDWR | os.O_CREATE
+   openFlags := os.O_RDWR | os.O_CREATE | syscall.O_NOFOLLOW

    if truncate {
        openFlags = openFlags | os.O_TRUNC
@@ -608,6 +613,10 @@ func determineFileCreateData(dst string) (*fileCreateData, error) {
 }

 // makeDirectories checks if all directories for the dst file exist, if not, create them with provided owner and group.
+//
+// All ancestor components are inspected with os.Lstat so that a symlinked
+// directory (e.g. an attacker's ~/.ssh pointing at /root/.ssh) is rejected
+// rather than transparently traversed by the kernel (CWE-59).
 func makeDirectories(dst string, permissions os.FileMode, uid, gid int) error {
    if dst == "/" {
        return nil
@@ -615,13 +624,14 @@ func makeDirectories(dst string, permissions os.FileMode, uid, gid int) error {

    dirPath := filepath.Dir(dst)

-   dirInfo, err := os.Stat(dirPath)
-   if errors.Is(err, os.ErrNotExist) {
-       // ensure parent exists
-       if err = makeDirectories(dirPath, permissions, uid, gid); err != nil {
-           return err
-       }
+   // Always validate / materialize ancestors first so that symlinks higher
+   // up the path are caught even when dirPath itself already exists.
+   if err := makeDirectories(dirPath, permissions, uid, gid); err != nil {
+       return err
+   }

+   dirInfo, err := os.Lstat(dirPath)
+   if errors.Is(err, os.ErrNotExist) {
        if err = os.Mkdir(dirPath, permissions); err != nil {
            return fmt.Errorf("cannot create directorty %s: %w", dirPath, err)
        }
@@ -637,6 +647,10 @@ func makeDirectories(dst string, permissions os.FileMode, uid, gid int) error {
        return fmt.Errorf("cannot create directory %s: %w", dirPath, err)
    }

+   if dirInfo.Mode()&os.ModeSymlink != 0 {
+       return fmt.Errorf("refusing to traverse symlinked path component %s", dirPath)
+   }
+
    if !dirInfo.IsDir() {
        return fmt.Errorf("cannot create directory, %s is a file", dirPath)
    }

Exploit Details

  • GitHub: Official patch commit containing Go unit test reproducers (Test_createFile_doesNotFollowSymlinks) demonstrating both the ~/.ssh intermediate symlink and /tmp/.bundle.raucb.part staging attacks.

Mitigation Strategies

  • Upgrade qbee-agent to version 2026.27 or later across all managed IoT endpoints.
  • Enable Linux kernel symlink, hardlink, FIFO, and regular file restrictions via sysctl to mitigate predictable /tmp staging attacks.
  • Audit and restrict qbee-agent SSH Keys and File Distribution configurations that target directories writable by non-root users.
  • Monitor system logs and auditd events for unauthorized symbolic link creation inside user home directories and /tmp.

Remediation Steps:

  1. Update the qbee-agent package on all affected devices to release 2026.27 (commit 0fdf8e411de5d0c142ae2590cf1c54bdfc2e529a).
  2. Verify that fs.protected_symlinks=1 and fs.protected_hardlinks=1 are active via 'sysctl -a' on all managed Linux hosts.
  3. Inspect existing user home directories (e.g., 'find /home -maxdepth 3 -type l -ls') and /tmp for anomalous symbolic links pointing to /root or /etc.
  4. Restart the qbee-agent service and verify in the agent logs that configuration synchronization completes without symlink traversal errors.

References

Read the full report for CVE-2026-62336 on our website for more details including interactive diagrams and full exploit analysis.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.