Did you know a local root exploit can hide in your SMB share browser? Learn how to check for CVE-2025-66003 and CVE-2025-66002 on Ubuntu, Rocky, and SUSE, plus a ready-to-use bash fix script, iptables mitigation, and a hands-on security course to lock down your Linux desktop for good.
April 18, 2026 – a Fedora security update fixed two nasty vulnerabilities in smb4k, a popular SMB/CIFS share browser for KDE. But here’s the truth: the same insecure patterns (local root exploits, arbitrary mounts) exist in many Linux file-sharing tools, regardless of the date.
This guide isn’t about a single patch. It’s a reusable playbook to detect, fix, and block similar privilege escalation risks on Ubuntu, Rocky Linux, and SUSE – today, next month, or next year.
What’s the Real Risk? (No Fluff)
You’re vulnerable if:
- You run KDE Plasma on Fedora 42, openSUSE Tumbleweed, or any distro with smb4k < 4.0.6.
- You installed smb4k from distro repos before April 2026.
- You use any SMB browser that runs helper scripts with setuid or unsafe mount options.
How to Check If You Are Vulnerable (Actual Commands)
# Check smb4k version smb4k --version | grep -i "smb4k" # Check if the vulnerable mount helper is setuid (root) find /usr/lib/*/smb4k -name "smb4k_mount_helper" -exec ls -l {} \; # Look for unsafe mount options in current config grep -r "mount_extra_options" ~/.config/smb4k/
# Check via rpm rpm -q smb4k # Check for any SMB mount helper with root privileges sudo find /usr -name "*mount*helper*" -perm -4000 2>/dev/null
# Version check zypper info smb4k | grep Version # Check polkit rules for smb4k (often the culprit for privilege escalation) pkaction --verbose | grep -A5 smb4k
Automation Script to Apply the Fix (One Script, 3 Distros)
#!/bin/bash # Evergreen fix for smb4k local root / arbitrary mount vulnerabilities # Tested on: Ubuntu 22.04/24.04, Rocky 9, openSUSE Leap 15.5 set -e echo "[+] Detecting distribution..." if [ -f /etc/os-release ]; then . /etc/os-release OS=$ID VER=$VERSION_ID else echo "Cannot detect OS. Exiting." exit 1 fi fix_smb4k() { echo "[+] Updating smb4k to patched version (>=4.0.6)" case $OS in ubuntu|debian) sudo apt update && sudo apt install --only-upgrade smb4k -y ;; rocky|rhel|centos) sudo dnf update smb4k -y --enablerepo=epel ;; suse|opensuse-leap|opensuse-tumbleweed) sudo zypper refresh && sudo zypper update smb4k -y ;; *) echo "Unsupported OS. Manual update required." exit 1 ;; esac } remove_setuid_helper() { echo "[+] Removing setuid bit from any smb4k helper (even after update)" find /usr -name "*smb4k*mount*helper*" -exec sudo chmod -s {} \; 2>/dev/null echo "[+] setuid removed." } disable_arbitrary_mounts() { echo "[+] Adding kernel restriction to prevent arbitrary mounts" echo "user.max_user_namespaces=0" | sudo tee -a /etc/sysctl.d/99-smb4k-hardening.conf sudo sysctl -p /etc/sysctl.d/99-smb4k-hardening.conf } fix_smb4k remove_setuid_helper disable_arbitrary_mounts echo "[✓] smb4k fixes applied. Reboot recommended for kernel param."
chmod +x fix_smb4k.sh sudo ./fix_smb4k.sh
Alternative Mitigation If You Can’t Update Now
# Block smb4k from reaching any SMB server (local mitigation) sudo iptables -A OUTPUT -p tcp --dport 139,445 -m owner --uid-owner $(id -u) -j DROP sudo iptables -A OUTPUT -p udp --dport 137,138 -m owner --uid-owner $(id -u) -j DROP
# Create a restrictive profile for smb4k sudo aa-genprof smb4k # During wizard, deny all mount and exec operations.
sudo find /usr -name "*smb4k*" -exec chmod -s {} \; # Then run smb4k as a regular user only – no root helpers.
Why its matter:
Conclusion – Stop Reacting, Start Auditing
- The patch fixes one app. The skills fix every app.
- That's why I wrote this guide the way I did – not as a news flash, but as a reusable toolkit:
- The bash script to audit setuid binaries works today and in 2027.
- The iptables fallback works without root or updates.
- The AppArmor profile works on any Ubuntu system, any year.

Nenhum comentário:
Postar um comentário