]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[CRITICAL] cookies: mixing cookies in indirect mode and appsession can crash the...
authorWilly Tarreau <w@1wt.eu>
Wed, 24 Nov 2010 17:31:28 +0000 (18:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 28 Nov 2010 06:06:22 +0000 (07:06 +0100)
Cookies in indirect mode are removed from the cookie header. Three pointers
ought to be updated when appsession cookies are processed next, but were not.
The result is that a memcpy() can be called with a negative value causing the
process to crash. It is not sure whether this can be remotely exploited or not.
(cherry picked from commit c5f3749aa3ccfdebc4992854ea79823d26f66213)

src/proto_http.c

index a65a923e88ef1a76d075af3388a32e85a2d7fe92..5385ffc2301f67992971e27731b408e00a7d99d0 100644 (file)
@@ -6263,6 +6263,11 @@ void manage_client_side_cookies(struct session *t, struct buffer *req)
 
                                if (del_from != NULL) {
                                        int delta = del_hdr_value(req, &del_from, prev);
+                                       if (att_beg >= del_from)
+                                               att_beg += delta;
+                                       if (att_end >= del_from)
+                                               att_end += delta;
+                                       val_beg  += delta;
                                        val_end  += delta;
                                        next     += delta;
                                        hdr_end  += delta;