[asterisk-commits] mjordan: branch certified-11.2 r383979 - in /certified/branches/11.2: ./ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 27 09:38:52 CDT 2013


Author: mjordan
Date: Wed Mar 27 09:38:49 2013
New Revision: 383979

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383979
Log:
AST-2013-002: Prevent denial of service in HTTP server

AST-2012-014, fixed in January of this year, contained a fix for Asterisk's
HTTP server for a remotely-triggered crash. While the fix put in place fixed
the possibility for the crash to be triggered, a denial of service vector still
exists with that solution if an attacker sends one or more HTTP POST requests
with very large Content-Length values. This patch resolves this by capping
the Content-Length at 1024 bytes. Any attempt to send an HTTP POST with
Content-Length greater than this cap will not result in any memory allocation.
The POST will be responded to with an HTTP 413 "Request Entity Too Large"
response.

This issue was reported by Christoph Hebeisen of TELUS Security Labs

(closes issue ASTERISK-20967)
Reported by: Christoph Hebeisen
patches:
  AST-2013-002-1.8.diff uploaded by mmichelson (License 5049)
  AST-2013-002-10.diff uploaded by mmichelson (License 5049)
  AST-2013-002-11.diff uploaded by mmichelson (License 5049)
........

Merged revisions 383978 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    certified/branches/11.2/   (props changed)
    certified/branches/11.2/main/http.c

Propchange: certified/branches/11.2/
------------------------------------------------------------------------------
--- branch-11-merged (original)
+++ branch-11-merged Wed Mar 27 09:38:49 2013
@@ -1,1 +1,1 @@
-/branches/11:378038,378121,378287,378321,378409-378411,378459,378582,378687,378690,378984,379513,379790,380465,380698,380869,380892,380894,380974,381306,381594,381613,381702,381737,382385,382390,382573,382617,383166,383840,383878,383973
+/branches/11:378038,378121,378287,378321,378409-378411,378459,378582,378687,378690,378984,379513,379790,380465,380698,380869,380892,380894,380974,381306,381594,381613,381702,381737,382385,382390,382573,382617,383166,383840,383878,383973,383978

Modified: certified/branches/11.2/main/http.c
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.2/main/http.c?view=diff&rev=383979&r1=383978&r2=383979
==============================================================================
--- certified/branches/11.2/main/http.c (original)
+++ certified/branches/11.2/main/http.c Wed Mar 27 09:38:49 2013
@@ -593,6 +593,8 @@
 	AST_RWLIST_UNLOCK(&uris);
 }
 
+#define MAX_POST_CONTENT 1025
+
 /*
  * get post variables from client Request Entity-Body, if content type is
  * application/x-www-form-urlencoded
@@ -622,6 +624,13 @@
 	}
 
 	if (content_length <= 0) {
+		return NULL;
+	}
+
+	if (content_length > MAX_POST_CONTENT - 1) {
+		ast_log(LOG_WARNING, "Excessively long HTTP content. %d is greater than our max of %d\n",
+				content_length, MAX_POST_CONTENT);
+		ast_http_send(ser, AST_HTTP_POST, 413, "Request Entity Too Large", NULL, NULL, 0, 0);
 		return NULL;
 	}
 




More information about the asterisk-commits mailing list