Bug 960226 (CVE-2013-2054) - CVE-2013-2054 strongSwan: remote buffer overflow in atodn()
Summary: CVE-2013-2054 strongSwan: remote buffer overflow in atodn()
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: CVE-2013-2054
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-06 18:12 UTC by Kurt Seifried
Modified: 2019-09-29 13:04 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-05-07 18:34:06 UTC
Embargoed:


Attachments (Terms of Use)

Description Kurt Seifried 2013-05-06 18:12:23 UTC
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: strongSwan versions 4.0.0 - 4.3.4

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
temporary_cyclic_buffer()

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 kernel_ops 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 local 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


Note You need to log in before you can comment on or make changes to this bug.