<< | Thread Index | >> ]    [ << | Date Index | >> ]

Subject: WARNING: CIPE 1.5.0 and pre-1.5.0 is broken
From: Olaf Titz <olaf,AT,bigred,DOT,inka,DOT,de>
Date: Sun, 11 Feb 2001 03:16:02 +0100

The CIPE 1.5.0 package which recently appeared on my Web pages and all
its prerelease snapshots contain a serious bug which can potentially
be exploited for attacks. Please do not use vanilla 1.5.0. If you are
using 1.5.0 or any of the snapshots after the 1.4 release, please
apply the appended patch, which also corrects the "tokxts" bug
described in the companion message.

An 1.5.1 release will soon be prepared which corrects this and other problems.

Olaf

Index: cipe/sock.c
===================================================================
RCS file: /home/olaf/common-home/CVSrepos/security/cipe-linux/cipe/sock.c,v
retrieving revision 1.33
diff -u -r1.33 sock.c
--- cipe/sock.c 2000/12/21 10:23:35     1.33
+++ cipe/sock.c 2001/02/11 00:10:37
@@ -284,6 +284,16 @@
                          length));
        skb_pull(n, blockSize);
        /* XX not sure about TW_CTRL handling... */
+        switch (*n->data) {
+            /* Restrict what can be received unencrypted. */
+        case CT_DUMMY: case CT_DEBUG: case CT_CONFREQ: case CT_CONF:
+            break;
+        default:
+            printk(KERN_WARNING
+                   "%s: got disallowed unencrypted control %02x\n",
+                   c->dev->name, *n->data);
+            goto error;
+        }
 #ifdef LINUX_21
        get_fast_time(&n->stamp);
 #endif
@@ -313,7 +323,7 @@
        case TW_NEWKEY:
            /* return it as key exchange block - proper UDP datagram */
            dprintk(DEB_INP, (KERN_DEBUG "TW_NEWKEY data=%p len=" FLEN
-                              "length=%d\n", n->data, n->len, length));
+                              " length=%d\n", n->data, n->len, length));
 #ifdef LINUX_21
            get_fast_time(&n->stamp);
 #endif
@@ -665,7 +675,7 @@
 */
 void cipe_fakenkey(struct cipe *c, char typ)
 {
-    int len=sizeof(struct udphdr)+1;
+    int len=sizeof(struct udphdr)+KEYXCHGBLKMIN;
     struct sk_buff *skb=alloc_skb(len, GFP_ATOMIC);

     if (!skb) {
@@ -701,6 +712,8 @@
        Since we generate only NK_RREQ and NK_REQ it's effectively
        one _bit_... */
     skb->data[sizeof(struct udphdr)]=typ;
+    (*(__u32 *)(skb->data+sizeof(struct udphdr)+KEYXCHGTSPOS))=
+        htonl(CURRENT_TIME); /* even need timestamp */

     if (sock_queue_rcv_skb(c->sock, skb)<0) {
         printk(KERN_WARNING "%s: cipe_fakenkey: enqueuing failed\n",
Index: cipe/ciped.c
===================================================================
RCS file: /home/olaf/common-home/CVSrepos/security/cipe-linux/cipe/ciped.c,v
retrieving revision 1.49
diff -u -r1.49 ciped.c
--- cipe/ciped.c        2001/01/04 23:04:38     1.49
+++ cipe/ciped.c        2001/02/08 19:36:18
@@ -716,7 +716,7 @@

     #define kx_typ       (LM->kxbuf[0])
     #define kx_nkind_key (LM->kxbuf+1)
-    #define kx_ts        (*(time_t *)(LM->kxbuf+KEYXCHGTSPOS))
+    #define kx_ts        ntohl(*(time_t *)(LM->kxbuf+KEYXCHGTSPOS))
 #ifdef VER_CRC32
     #define get_kx_nkind_crc(x) memcpy((x), LM->kxbuf+1+userKeySize, 4)
     #define put_kx_nkind_crc(x) memcpy(LM->kxbuf+1+userKeySize, (x), 4)
@@ -747,7 +747,7 @@
         return 0;
     }
     if (OI(tokxts) && (abs(time(0)-kx_ts)>OI(tokxts))) {
-        dprintf(("KX: timestamp error\n"));
+        Log(LOG_NOTICE, "KX: timestamp error");
         return 0;
     }
     switch(kx_typ) {

=== end of patch ===





<< | Thread Index | >> ]    [ << | Date Index | >> ]