Vim command injection flaws affect SUSE Linux Micro. Learn to check, patch, and mitigate CVE-2026-33412, CVE-2026-34714, and CVE-2026-34982 using universal bash scripts, iptables, and AppArmor. Includes affiliate resources to master secure Linux administration.
Why this still matters:
Vim is on almost every Linux server and workstation. The class of vulnerabilities described here—command injection via glob() and modeline bypass—has appeared before and will appear again. Learning to detect and fix these issues manually protects you for years.
What happened (in context)
In mid-2026, SUSE released an update for vim to fix three vulnerabilities:
- CVE-2026-33412 – command injection via a newline character in the glob() function.
- CVE-2026-34714 – a specially crafted file can execute arbitrary code.
- CVE-2026-34982 – modeline restrictions bypassed through certain options.
These affect SUSE Linux Micro 6.2 and SUSE Linux Micro Extras 6.2, but the same patterns exist in older or unpatched Vim on Ubuntu, Rocky Linux, AlmaLinux, and Debian.
How to check if you are vulnerable (commands for major distros)
vim --version | head -n 2
echo 'call glob("/tmp/test\nid")' > /tmp/vim-test.vim vim -u NONE -N --noplugin -c "source /tmp/vim-test.vim" -c "q!"
vim --version | grep modeline
#!/bin/bash # Evergreen Vim security fix - works on Debian/Ubuntu, RHEL/Rocky, SUSE set -e echo "Checking Vim version..." VIM_VER=$(vim --version | head -n1 | awk '{print $5}') if [[ "$VIM_VER" > "9.0.2189" ]] || [[ "$VIM_VER" == "9.2.0280" ]]; then echo "Vim version $VIM_VER seems patched. Exiting." exit 0 fi echo "Unpatched Vim $VIM_VER found. Applying update..." if command -v apt &> /dev/null; then # Ubuntu/Debian sudo apt update && sudo apt install --only-upgrade vim -y elif command -v dnf &> /dev/null; then # Rocky/Fedora/RHEL sudo dnf update vim -y elif command -v zypper &> /dev/null; then # SUSE sudo zypper patch --cve=CVE-2026-33412 --cve=CVE-2026-34714 --cve=CVE-2026-34982 else echo "No known package manager. Manual update required." exit 1 fi echo "Fix applied. New version:" vim --version | head -n1
chmod +x fix-vim-cve.sh ./fix-vim-cve.sh
Alternative mitigation if you can’t update now
set nomodeline set modelineexpr set secure
2. Block suspicious Vim temp files with AppArmor
/usr/bin/vim {
# ... existing rules ...
deny /tmp/vim-* w,
deny /var/tmp/vim-* w,
}
3. Use iptables to restrict outbound code execution
sudo iptables -A OUTPUT -m owner --uid-owner $(id -u) -p tcp --dport 80,443 -j REJECT

Nenhum comentário:
Postar um comentário