Stop worrying about the next strongSwan CVE. Learn how to check for DoS vulnerabilities (CVE-2026-35328 to 35334), apply the fix with a ready-to-use bash script, and set up iptables fallbacks. Includes practical commands for Ubuntu and a book recommendation to master binary analysis.
What happened ?
In April 2026, Ubuntu released USN-8196-2 fixing seven DoS and potential RCE vulnerabilities in strongSwan (CVE-2026-35328 through CVE-2026-35334). Attackers could crash your VPN daemon remotely using malformed TLS extensions, PKCS#7 containers, EAP-SIM attributes, or RSA decryption tricks.
But here’s the thing: similar bugs appear every few months. Instead of just patching today, you need a repeatable process to check, fix, and fallback – without panic.
How to check if you are vulnerable (Ubuntu commands)
# Check your strongSwan version ipsec version # Compare against vulnerable versions: # Ubuntu 26.04 LTS: strongSwan < 5.9.8-3ubuntu2.1 # Ubuntu 24.04 LTS: strongSwan < 5.9.8-3ubuntu1.2 # Ubuntu 22.04 LTS: strongSwan < 5.9.5-3ubuntu2.4 # Automatically test if your system needs the patch dpkg -l | grep strongswan | awk '{print $3}'
systemctl status strongswan-starter ss -tulpn | grep 500 # IKE port ss -tulpn | grep 4500 # NAT-T port
Automation script to apply the fix (Ubuntu bash)
#!/bin/bash # strongSwan DoS vulnerability patcher (CVE-2026-35328 to 35334) # Compatible with Ubuntu 22.04, 24.04, 26.04 set -e echo "[+] Checking current strongSwan version..." CURRENT_VER=$(ipsec version | head -1 | awk '{print $3}') echo " Found: $CURRENT_VER" # Backup configs before update BACKUP_DIR="/root/strongswan-backup-$(date +%Y%m%d)" mkdir -p $BACKUP_DIR cp -r /etc/strongswan/ $BACKUP_DIR/ 2>/dev/null || true echo "[+] Configs backed up to $BACKUP_DIR" # Update package list and install patched version echo "[+] Applying security update..." apt update apt install --only-upgrade strongswan strongswan-starter strongswan-charon -y # Verify fix applied NEW_VER=$(ipsec version | head -1 | awk '{print $3}') echo "[+] Updated from $CURRENT_VER to $NEW_VER" # Restart service systemctl restart strongswan-starter systemctl status strongswan-starter --no-pager echo "[+] Patch complete. Check logs: journalctl -u strongswan-starter -n 20"
Why this script matters for the future:
# Block TLS-based strongSwan control port (if you use strongSwan with TLS) iptables -A INPUT -p tcp --dport 443 -m string --string "supported_versions" --algo bm -j DROP # Save rules iptables-save > /etc/iptables/rules.v4
# Rate-limit RADIUS and EAP packets to prevent flood iptables -A INPUT -p udp --dport 1812 -m limit --limit 10/s -j ACCEPT iptables -A INPUT -p udp --dport 1812 -j DROP
/usr/lib/ipsec/charon {
deny /tmp/* rw,
deny /proc/sys/** r,
}

Nenhum comentário:
Postar um comentário