zoulasc / racoon2

The Racoon2 project is a joint effort which provides an implementation of key management system for IPsec. The implementation is called Racoon2, a successor of Racoon, which was developed by the KAME project. It supports IKEv1, IKEv2, and KINK protocols. It works on FreeBSD, NetBSD, Linux, and Mac OS X. Racoon2 is provided under a BSD-style license. To support various environments that use IPsec, we will develop various functions.
Other
22 stars 11 forks source link

Patching security vulnerabilities #3

Open zmudc opened 4 years ago

zmudc commented 4 years ago

@zmudc: Look here, maybe code to integrate?

Originally posted by @Neustradamus in https://github.com/zoulasc/racoon2/issues/2#issuecomment-572844117

After reviewing the past history of the ipsec-tools package and what has been patched by the Linux distributions mentioned above, at the very least we need to check if any security vulnerabilities that have been patched in ipsec-tools and racoon apply to racoon2. One such vulnerability is CVE-2016-10396, which was patched in racoon at:

https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=51682

zmudc commented 4 years ago

Inspecting the most recent patches of src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag on cvsweb.netbsd.org, which is where many of the patches to fix CVE-2016-10396 were applied, reveals that handling fragmentation properly is not a trivial task and this is something to put on the TODO list. The code for handling fragmented packets in racoon2 is something like fifteen years old and certainly should be evaluated and tested.

zoulasc commented 4 years ago

I added it in TODO.

zmudc commented 4 years ago

Yes, examination of the racoon2 code reveals that correct code for handling fragmentation is not present in racoon2. In fact, racoon2 currently fails to compile with ENABLE_FRAG set in sbin/iked/config.h. This means that racoon2 is not vulnerable to the security flaw referenced in CVE-2016-10396. Good. It also means we need to add the fragmentation feature because it might be needed to establish a connection whenever there is a router between the peers that drops fragmented packets, especially in scenarios where larger messages are needed. This problem is most likely to occur when certificates are exchanged between the peers for authentication, because certificates are sent in larger messages that are more likely to be fragmented at the IP layer.

Neustradamus commented 1 year ago

@zoulasc: Have you progressed on it?