1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-14 01:22:37 +03:00
Commit Graph

187 Commits

Author SHA1 Message Date
Rainer Jung
5002fd13e7 Switch preference for headers, Transfer-Encoding
first, Content-Length second.

Addition to r1615289.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1620324 13f79535-47bb-0310-9956-ffa450edef68
2014-08-25 13:44:03 +00:00
Rainer Jung
3535416fc0 PR53420: Proxy responses with error status and
"ProxyErrorOverride On" hang until proxy timeout.

Regression from 2.2. It was introduced by r912063
in order to fix PR41646.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1615289 13f79535-47bb-0310-9956-ffa450edef68
2014-08-02 08:24:35 +00:00
Eric Covener
8cc5e00f9e *) SECURITY: CVE-2013-5704 (cve.mitre.org)
core: HTTP trailers could be used to replace HTTP headers
     late during request processing, potentially undoing or
     otherwise confusing modules that examined or modified
     request headers earlier.  Adds "MergeTrailers" directive to restore
     legacy behavior.  

Submitted By: Edward Lu, Yann Ylavic, Joe Orton, Eric Covener
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610814 13f79535-47bb-0310-9956-ffa450edef68
2014-07-15 19:11:02 +00:00
Joe Orton
bb2749fd6e SECURITY (CVE-2014-0117): Fix a crash in mod_proxy. In a reverse
proxy configuration, a remote attacker could send a carefully crafted
request which could crash a server process, resulting in denial of
service.

Thanks to Marek Kroemeke working with HP's Zero Day Initiative for
reporting this issue.

* server/util.c (ap_parse_token_list_strict): New function.

* modules/proxy/proxy_util.c (find_conn_headers): Use it here.

* modules/proxy/mod_proxy_http.c (ap_proxy_http_process_response):
  Send a 400 for a malformed Connection header.

Submitted by: Edward Lu, breser, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610674 13f79535-47bb-0310-9956-ffa450edef68
2014-07-15 12:27:00 +00:00
Yann Ylavic
f1a9de3123 mod_proxy_http: avoid (unlikely) access to freed memory.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1599486 13f79535-47bb-0310-9956-ffa450edef68
2014-06-03 11:47:11 +00:00
Yann Ylavic
9ba346e885 mod_proxy: Preserve original request headers even if they differ
from the ones to be forwarded to the backend. PR 45387.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588527 13f79535-47bb-0310-9956-ffa450edef68
2014-04-18 17:38:15 +00:00
Jeff Trawick
5512fa1b86 mod_proxy_http: Add detach_backend hook.
The immediate use is for a SSL-related module which works
on the backend proxy connection to be able to "leak" information
into the client r for logging.

This could be useful with other proxy scheme handlers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1586719 13f79535-47bb-0310-9956-ffa450edef68
2014-04-11 17:07:18 +00:00
Christophe Jaillet
e2643b38f9 Use 'apr_table_setn' instead of 'apr_table_set' when possible in order to save memory.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1578760 13f79535-47bb-0310-9956-ffa450edef68
2014-03-18 06:52:08 +00:00
Jeff Trawick
d50ebf12a6 fix spelling
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1575958 13f79535-47bb-0310-9956-ffa450edef68
2014-03-10 14:57:14 +00:00
Yann Ylavic
fb3ff3e754 Redo what was reverted in r1572627.
Don't reuse a SSL backend connection whose SNI differs. PR 55782.
This may happen when ProxyPreserveHost is on and the proxy-worker
handles connections to different Hosts.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572630 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 15:40:01 +00:00
Yann Ylavic
dc560db2e9 Revert r1572606 for the time being since backport would conflict with 2.4.x's proxy_conn_rec.
The uds_path field is at the end of the struct in 2.4.x but not in trunk.
Fix that first, then recommit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572627 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 15:31:58 +00:00
Yann Ylavic
93a607e6f2 Don't reuse a SSL backend connection whose SNI differs. PR 55782.
This may happen when ProxyPreserveHost is on and the proxy-worker
handles connections to different Hosts.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572606 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 14:52:12 +00:00
Yann Ylavic
739dc00ca9 Avoid useless functions calls.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572561 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 13:39:25 +00:00
Yann Ylavic
accfcf7471 Log an error in mod_proxy_http when reading the request body fails.
Follow-up to r1538776 where incomplete bodies are detected and an error returned through the input filters.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1570598 13f79535-47bb-0310-9956-ffa450edef68
2014-02-21 15:08:32 +00:00
Yann Ylavic
ffdab778e2 mod_proxy_http: don't recycle backend connections known to be closed (eg. EOS by close).
This saves a useless ap_is_socket_connected() call when reused.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1568404 13f79535-47bb-0310-9956-ffa450edef68
2014-02-14 17:55:19 +00:00
Jan Kaluža
d9c2352952 Cleanup the bb brigade, because buckets inserted to it can be created from
scpool and this pool can be freed before this brigade.
POSSIBLE (but as yet unconfirmed) fix for crashes seen with threaded servers,
e.g. PR 50335.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1550061 13f79535-47bb-0310-9956-ffa450edef68
2013-12-11 07:27:12 +00:00
Jim Jagielski
bb76893cfb We were not being consistent between http and others
if we added the default port or not during the canonizing
phase... Baseline the http method (don't add unless the
port provided isn't the default).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1542562 13f79535-47bb-0310-9956-ffa450edef68
2013-11-16 20:13:48 +00:00
Joe Orton
817b1ea2c0 * modules/proxy/mod_proxy_http.c (ap_proxy_http_request): Use the same
brigade lifetime for the header brigade as the other brigades.
  POSSIBLE (but as yet unconfirmed) fix for crashes seen with threaded
  servers, e.g. PR 50335; appears correct or at least not harmful.

PR: 50335


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1534321 13f79535-47bb-0310-9956-ffa450edef68
2013-10-21 18:58:26 +00:00
Jim Jagielski
6284650f6d ping tuning via Yann Ylavic <ylavic.dev@gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1530603 13f79535-47bb-0310-9956-ffa450edef68
2013-10-09 13:38:45 +00:00
Jeff Trawick
619866c198 fill in missing message numbers in APLOGNO() invocations
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1524018 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 12:51:08 +00:00
Christophe Jaillet
46d88308c2 Save a few cycles
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1517045 13f79535-47bb-0310-9956-ffa450edef68
2013-08-23 21:19:21 +00:00
Jim Jagielski
357828f9d2 Allow for a simple socket check in addition to the
higher level protocol-level checks for backends...

Not sure if it makes sense to do both or not... Comments?

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1516930 13f79535-47bb-0310-9956-ffa450edef68
2013-08-23 16:48:42 +00:00
Graham Leggett
1ab831fa06 mod_proxy_http: Make the proxy-interim-response environment variable
effective by formally overriding origin server behaviour.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1483027 13f79535-47bb-0310-9956-ffa450edef68
2013-05-15 19:27:10 +00:00
Graham Leggett
9bc9d79079 core: Stop the HTTP_IN filter from attempting to write error buckets
to the output filters, which is bogus in the proxy case. Create a
clean mapping from APR codes to HTTP status codes, and use it where
needed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1482522 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 18:58:06 +00:00
Graham Leggett
d2e6782ea7 mod_proxy, mod_proxy_http: Connection headers must be stripped on the way
in and out, support an optional function to handle this.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1482075 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:11:36 +00:00
Graham Leggett
a7fc0f013e mod_proxy: Ensure network errors detected by the proxy are returned as
504 Gateway Timout as opposed to 502 Bad Gateway, in order to be
compliant with RFC2616 14.9.4 Cache Revalidation and Reload Controls.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1480058 13f79535-47bb-0310-9956-ffa450edef68
2013-05-07 20:27:37 +00:00
Daniel Ruggeri
d31632f33c Add failontimeout to allow server admin to mark balancer member in err if IO timeout occurs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1465839 13f79535-47bb-0310-9956-ffa450edef68
2013-04-09 00:18:42 +00:00
Jeff Trawick
d6c996a553 axe unused variable dconf (since r1453875)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1456124 13f79535-47bb-0310-9956-ffa450edef68
2013-03-13 20:39:34 +00:00
Jim Jagielski
2bea7fb2bf Pull out duplicated code to proxy_util...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1453875 13f79535-47bb-0310-9956-ffa450edef68
2013-03-07 14:06:51 +00:00
Ruediger Pluem
3611dfe9d5 * A limit of zero means unlimited for LimitRequestBody.
PR: 54435
Submitted by: Pavel Mateja <pavel netsafe.cz>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1433988 13f79535-47bb-0310-9956-ffa450edef68
2013-01-16 15:37:16 +00:00
Rainer Jung
4cf751dbb9 Fix closing the back end connection in case of error.
The field "closed" was changed from an int to a bit
field of size one in 2.4.x.
For historical reasons a close instruction was coded
as an increment on the field, which in 2.4.x flips
the field each time. There were mutliple code paths
that would flip it several times for a single error,
so effectively the connection was no longer closed
in these cases.

Especially in the case of an aborted client connection
this lead to a non consumed back end buffer and thus to
response mixup between users.

PR 53727

CVE-2012-3052


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1373955 13f79535-47bb-0310-9956-ffa450edef68
2012-08-16 17:54:50 +00:00
Ruediger Pluem
96cc34efbe * Use the the same hostname for SNI as for the HTTP request when forwarding
to SSL backends.

PR: 53134
Based on a patch from: Michael Weiser <michael weiser.dinsnail.net>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1333969 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 14:02:58 +00:00
Joe Orton
e16536b2cd * modules/proxy/mod_proxy_http.c (ap_proxy_http_process_response):
Treat EAGAIN as an error for a blocking read from the input filter
  stack.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1242798 13f79535-47bb-0310-9956-ffa450edef68
2012-02-10 14:52:25 +00:00
Graham Leggett
cb21a0dbcc Further clarify the naming of the entity that directly connects to us by
calling that entity a client instead of a peer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1214015 13f79535-47bb-0310-9956-ffa450edef68
2011-12-14 01:10:52 +00:00
Graham Leggett
2af2fa44ad Further clarify the naming of the entity that originates the request by
calling that entity a useragent instead of a client.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1214003 13f79535-47bb-0310-9956-ffa450edef68
2011-12-14 00:31:51 +00:00
Graham Leggett
d404b51f31 mod_proxy: Remove ap_proxy_make_fake_req() from the public API.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209916 13f79535-47bb-0310-9956-ffa450edef68
2011-12-03 14:39:51 +00:00
Graham Leggett
3ab3e5ed3e mod_proxy: Remove ap_proxy_date_canon() from the public API.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209812 13f79535-47bb-0310-9956-ffa450edef68
2011-12-03 01:03:08 +00:00
Graham Leggett
e45341af5d mod_proxy: Remove ap_proxy_buckets_lifetime_transform() from the public API.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209811 13f79535-47bb-0310-9956-ffa450edef68
2011-12-03 00:57:19 +00:00
Graham Leggett
9abaf845ca mod_proxy: Remove ap_proxy_liststr(), it duplicates ap_find_token().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209797 13f79535-47bb-0310-9956-ffa450edef68
2011-12-03 00:30:06 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Graham Leggett
394e5594d6 Introduce a per connection "peer_ip" and a per request "client_ip" to
distinguish between the raw IP address of the connection and the effective
IP address of the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206291 13f79535-47bb-0310-9956-ffa450edef68
2011-11-25 19:42:04 +00:00
Graham Leggett
4ee7eea4cf Introduce a per request version of the remote IP address, which can be
optionally modified by a module when the effective IP of the client
is not the same as the real IP of the client (such as a load balancer).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204968 13f79535-47bb-0310-9956-ffa450edef68
2011-11-22 13:10:39 +00:00
Stefan Fritsch
8ec7f5c5bf great proxy logging cleanup:
* remove "proxy:", "FCGI", etc. prefixes and pid which are now
    included in the error log format

  * propagate frontend request's logconfig to backend request
    
  * use ap_log_rerror where possible
    
  * remove obsolete APLOG_NOERRNO


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1203859 13f79535-47bb-0310-9956-ffa450edef68
2011-11-18 21:41:09 +00:00
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Stefan Fritsch
24e349de03 mod_proxy_http, mod_proxy_connect: Add 'proxy-status' and 'proxy-source-port'
request notes for logging

PR: 30195


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1154342 13f79535-47bb-0310-9956-ffa450edef68
2011-08-05 18:35:29 +00:00
Stefan Fritsch
61a0413706 Use APR_STATUS_IS_... in some more cases.
While this is not strictly necessary everywhere, it makes it much easier
to find the problematic cases.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1102124 13f79535-47bb-0310-9956-ffa450edef68
2011-05-11 22:51:46 +00:00
Ruediger Pluem
91960c0b37 * Play safe if the notes table does not contain an SSL_connect_rv key.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1069785 13f79535-47bb-0310-9956-ffa450edef68
2011-02-11 12:50:31 +00:00
Igor Galić
ceb1766d2d Add a patch from Vincent Deffontaines to make the adding of X-forwarded-*
headers configurable: ProxyAddHeaders, defaulting to 'On'.
http://www.mail-archive.com/dev@httpd.apache.org/msg49971.html


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1060795 13f79535-47bb-0310-9956-ffa450edef68
2011-01-19 12:48:17 +00:00
Jim Jagielski
201bbd1ba9 More movement to shared stuff...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1058623 13f79535-47bb-0310-9956-ffa450edef68
2011-01-13 15:58:57 +00:00
Jeff Trawick
62740bfdee fix comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1055605 13f79535-47bb-0310-9956-ffa450edef68
2011-01-05 19:47:45 +00:00