See how openswan compares to other vendors in security performance
FreeS/WAN 1.x and 2.x, and other related products including superfreeswan 1.x, openswan 1.x before 1.0.6, openswan 2.x before 2.1.4, and strongSwan before 2.1.3, allows remote attackers to authenticate using spoofed PKCS#7 certificates in which a self-signed certificate identifies an alternate Certificate Authority (CA) and spoofed issuer and subject.
The Internet Key Exchange version 1 (IKEv1) implementation in Openswan 2 (openswan-2) before 2.4.4, and freeswan in SUSE LINUX 9.1 before 2.041.5.4-1.23, allow remote attackers to cause a denial of service via (1) a crafted packet using 3DES with an invalid key length, or (2) unspecified inputs when Aggressive Mode is enabled and the PSK is known, as demonstrated by the PROTOS ISAKMP Test Suite for IKEv1.
Stack-based buffer overflow in the getinternaladdresses function in the pluto application for Openswan 1.x before 1.0.9, and Openswan 2.x before 2.3.0, when compiled with XAUTH and PAM enabled, allows remote authenticated attackers to execute arbitrary code.
linux-patch-openswan 2.4.12 allows local users to overwrite arbitrary files via a symlink attack on (a) /tmp/snap##### and (b) /tmp/nightly##### temporary files, related to the (1) maysnap and (2) maytest scripts.
The IPSEC livetest tool in Openswan 2.4.12 and earlier, and 2.6.x through 2.6.16, allows local users to overwrite arbitrary files and execute arbitrary code via a symlink attack on the (1) ipseclive.conn and (2) ipsec.olts.remote.log temporary files. NOTE: in many distributions and the upstream version, this tool has been disabled.
Openswan 2.2.x does not properly restrict permissions for (1) /var/run/starter.pid, related to starter.c in the IPsec starter, and (2) /var/lock/subsys/ipsec, which allows local users to kill arbitrary processes by writing a PID to a file, or possibly bypass disk quotas by writing arbitrary data to a file, as demonstrated by files with 0666 permissions, a different vulnerability than CVE-2011-1784.
Paul Wouters reports:
An audit of code from The Libreswan Project revealed a remote buffer overflow in the atodn() function used by both libreswan, openswan, and older versions of strongswan and superfreeswan when called from atoid()
Vulnerable versions: Openswan versions 1.x to 2.6.38
Vulnerability information: When enabling Opportunistic Encryption ("OE") using oe=yes (default is 'no') the IKE daemon pluto requests DNS TXT records to obtain public RSA keys of itself and its peers. These records can contain an IPsec gateway specification containing an fully qualified hostname which is passed to a function atoid().
When X.509 support was added to FreeS/WAN, ASN.1 parsing was added to the function atoid() which converts an ASCII ID representation into an internal struct id representation using a static buffer via the function temporarycyclicbuffer()
While DNS TXT records cannot contain ASN.1 representations, the code mistakenly checked for such interpretation if the DNS TXT FQDN contained an '=' symbol. Since DNS TXT buffers can be larger than what the ASN.1 parsing code expected, parsing such a record can trigger a buffer overflow leading to remote execution of code, specifically when overflowing into the struct kernelops which is a table of function pointers.
Exploitation: This exploit can only be triggered when the ipsec.conf configuration file enables Opportunistic Encryption via the option 'oe=yes'. If this option is not present, it defaults to 'no'.
Configurations that enable "OE" without preconfiguring their own public RSA key in DNS will be under severe connectivity problems leaving the machine with 30 second delay for each outgoing connection - a deployment scenario that is extremely unlikely to appear in the wild.
In the unlikely event that machines are configured as such, this vulnerability can only be exploited by a remote attacker controlling the reverse DNS entry for the IP address of the targetted host. If the machine is properly configured for OE, an attacker only needs to trigger a connection to an IP address for which they control the reverse DNS zone where they can place the malicious DNS record.
Credits: This vulnerability was found by Florian Weimer of the Red Hat Product Security Team (https://access.redhat.com/security/team/)
The Openswan's IPSEC livetest tool is prone to symlink attacks.
Affected file: /usr/libexec/ipsec/livetest
Relevant part of the code:
39 wget -o /dev/null -O /tmp/ipseclive.conn "http://192.168.0.1/olts/?leftid=$leftid&$leftrsasigkey&version=$version" 40 41 sh < /tmp/ipseclive.conn 42 ipsec eroute.pl 43 leftid=echo $leftid | sed "s/@//" 44 ipsec whack --delete --name olts-$leftid >> /tmp/ipsec.olts.local.log 45 wget -o /dev/null -O /tmp/ipsec.olts.remote.log "http://192.168.0.1/olts/log.php?leftid=$leftid"
A malicious user could precreate symlink to each of the files (tmp/ipseclive.conn, /tmp/ipsec.olts.remote.log), which could allow him to destroy the target of the symlink via running the " # ipsec livetest" command by the superuser of the host.
References:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=496374