[go: nahoru, domu]

    Skip Menu | | Logout
Logged in as guest
RT for openssl.org
 
 
#1930: [PATCH] DTLS record buffer limitation bug
X  Ticket metadata  
X  The Basics  
Id: 1930
Status: resolved
Left: 0 min
Priority: 0/0
Queue: OpenSSL-Bugs

X  Custom Fields  
Milestone:
  • (no value)
Subsystem:
  • (no value)
Severity:
  • (no value)
Broken in:
  • (no value)

X  People  
Owner: steve <steve@openssl.org>
Requestors: seggelmann@fh-muenster.de
Cc:
AdminCc:

X  Dates  
Created: Sat May 16 13:31:06 2009
Starts: Not set
Started: Sat May 16 18:19:20 2009
Last Contact: Not set
Due: Not set
Closed: Sat May 16 18:19:20 2009
Updated: Sat May 16 18:19:21 2009 by steve

X  Links  
Depends on:
Depended on by:
Parents:
Children:
Refers to:
Referred to by:

X  Attachments  
dtls-record-buffer-bug-1.0.0.patch

X  More about Robin Seggelmann  
Comments about this user:
No comment entered about this user
This user's 10 highest priority tickets:
Groups this user belongs to:
  • Everyone
  • Unprivileged

X  History Display mode:[Brief headers] [Full headers]
#     Sat May 16 13:31:07 2009  seggelmann@fh-muenster.de - Ticket created    
Subject: [PATCH] DTLS record buffer limitation bug
Date: Fri, 15 May 2009 16:41:10 +0200
To: rt@openssl.org
From: Robin Seggelmann <seggelmann@fh-muenster.de>
Download (untitled)
text/plain 1.4k
Records are buffered if they arrive with a future epoch to be
processed after finishing the corresponding handshake. There is
currently no limitation to this buffer allowing an attacker to perform
a DOS attack with sending records with future epochs until there is no
memory left. This patch adds the pqueue_size() function to detemine
the size of a buffer and limits the record buffer to 100 entries.

Thanks to Daniel Mentz for finding this bug!


--- crypto/pqueue/pqueue.c 2005-12-20 08:03:10.000000000 +0100
+++ crypto/pqueue/pqueue.c 2009-05-15 16:07:33.000000000 +0200
@@ -237,3 +237,17 @@

return ret;
}
+
+int
+pqueue_size(pqueue_s *pq)
+{
+ pitem *item = pq->items;
+ int count = 0;
+
+ while(item != NULL)
+ {
+ count++;
+ item = item->next;
+ }
+ return count;
+}

--- crypto/pqueue/pqueue.h 2005-06-08 00:21:14.000000000 +0200
+++ crypto/pqueue/pqueue.h 2009-05-15 16:07:03.000000000 +0200
@@ -89,5 +89,6 @@
pitem *pqueue_next(piterator *iter);

void pqueue_print(pqueue pq);
+int pqueue_size(pqueue pq);

#endif /* ! HEADER_PQUEUE_H */

--- ssl/d1_pkt.c 2009-04-23 18:32:40.000000000 +0200
+++ ssl/d1_pkt.c 2009-05-15 16:06:23.000000000 +0200
@@ -207,6 +207,10 @@
DTLS1_RECORD_DATA *rdata;
pitem *item;

+ /* Limit the size of the queue to prevent DOS attacks */
+ if (pqueue_size(queue->q) >= 100)
+ return 0;
+
rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA));
item = pitem_new(priority, rdata);
if (rdata == NULL || item == NULL)
Download dtls-record-buffer-bug-1.0.0.patch
application/octet-stream 1k
Download (untitled)
text/plain 1b
#     Sat May 16 18:18:54 2009  steve - Taken    
#     Sat May 16 18:19:20 2009  steve - Status changed from 'new' to 'resolved'    
»|« RT 3.4.5 Copyright 1996-2005 Best Practical Solutions, LLC.
Time to display: 0.461362