1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

304 Commits

Author SHA1 Message Date
Joe Orton
b5c7491d67 Security fix for CVE-2009-1890:
* modules/proxy/mod_proxy_http.c (stream_reqbody_cl): Specify the base
  passed to apr_strtoff, and validate the Content-Length in the same
  way the HTTP_IN filter does.  If the number of bytes streamed
  exceeds the expected body length, bail out of the loop.

Thanks to: Toadie <toadie643 gmail.com> for reporting and diagnosis of
	this issue.
Submitted by: niq, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@790587 13f79535-47bb-0310-9956-ffa450edef68
2009-07-02 13:41:18 +00:00
Nick Kew
10177a507c mod_proxy_http: fix case sensitivity checking transfer encoding
PR 47383 [Ryuzo Yamamoto]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@785661 13f79535-47bb-0310-9956-ffa450edef68
2009-06-17 15:21:21 +00:00
Nick Kew
fd4393f664 Fix IPv6 literal addresses passed to a proxied backend.
PR 47177
Patch by Carlos Garcia Braschi


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@778531 13f79535-47bb-0310-9956-ffa450edef68
2009-05-25 23:19:16 +00:00
Ruediger Pluem
e468a9fae6 * Add SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN directives to enable
stricter checking of remote server certificates.

  (docs/manual/mod/mod_ssl.xml)
    Documentation of SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN.

  (modules/proxy/mod_proxy_http.c)
    Set the hostname of the request URL as note on the connection.

  (modules/ssl/ssl_private.h)
    Add proxy_ssl_check_peer_expire and proxy_ssl_check_peer_cn fields to
    the SSLSrvConfigRec.

  (modules/ssl/ssl_engine_config.c)
    Directives stuff for SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN.

  (modules/ssl/ssl_engine_io.c)
    Check whether the remote servers certificate is expired / if there is a
    mismatch between the requested hostanme and the remote server certificates
    CN field.
    Be able to parse ASN1 times.

  (modules/ssl/mod_ssl.c)
    Directives stuff for SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@760866 13f79535-47bb-0310-9956-ffa450edef68
2009-04-01 12:07:47 +00:00
Eric Covener
5c8ab974a1 use ap_log_rerror instead of r->server per niq's comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733219 13f79535-47bb-0310-9956-ffa450edef68
2009-01-10 01:35:50 +00:00
Eric Covener
f63b5a4dbd pass a server_rec to ap_log_error on two interim response messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733127 13f79535-47bb-0310-9956-ffa450edef68
2009-01-09 19:31:48 +00:00
Ruediger Pluem
4a3c945b14 * Rip out the old flushing approach for solving lifetime issues between the
backend connection bucket allocator and front end connection bucket allocator.
  Instead copy the buckets from the backend over to ones that have been created
  using the front end bucket allocator. For metabucket this is done by recreating
  them, for data buckets this is done by reading them and putting the read data
  in a transient bucket.

PR: 45792


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@712375 13f79535-47bb-0310-9956-ffa450edef68
2008-11-08 11:09:38 +00:00
Jim Jagielski
cd7a438a43 Remove potential for memory leak... allocate on this
request which is now viable due to connection pooling.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@707163 13f79535-47bb-0310-9956-ffa450edef68
2008-10-22 19:13:57 +00:00
Jim Jagielski
14bb7079df For timeouts, behave as before and not drop.
From Adam Woodworth <mirkperl gmail.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@697362 13f79535-47bb-0310-9956-ffa450edef68
2008-09-20 13:44:26 +00:00
Jeff Trawick
3b01067886 comment tweak
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@685191 13f79535-47bb-0310-9956-ffa450edef68
2008-08-12 15:40:48 +00:00
Ruediger Pluem
0afe61c5bd * Introduce environment variable proxy-initial-not-pooled to avoid reusing
pooled connections if the client connection is an initial connection.
  This avoids the "proxy: error reading status line from remote server"
  error caused by the race condition that the backend server closed the
  connection after the connection check on our side and before our data
  reached the backend. Yes, this downgrades performance, especially with
  HTTP/1.0 clients. Hence it is configurable and off by default.

PR: 37770


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@684351 13f79535-47bb-0310-9956-ffa450edef68
2008-08-09 21:33:09 +00:00
Jim Jagielski
6806faa3d4 move back to inner loop... fails otherwise
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@666180 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 16:14:47 +00:00
Jim Jagielski
33f7a2ac3b Patch for CVE-2008-2364...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@666154 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 15:30:00 +00:00
Ruediger Pluem
b0269d681d * Do this later as we might leave the function anyway without the need for this.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@661508 13f79535-47bb-0310-9956-ffa450edef68
2008-05-29 22:23:19 +00:00
Ruediger Pluem
b6f1efd3b2 * According to RFC 2616 8.2.3 we are not allowed to forward an
Expect: 100-continue to an HTTP/1.0 server. Instead we MUST return
  a HTTP_EXPECTATION_FAILED.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@661506 13f79535-47bb-0310-9956-ffa450edef68
2008-05-29 22:19:17 +00:00
Ruediger Pluem
2948128ebb * mod_proxy_http.c
Ensure that the EOC bucket is inserted BEFORE an EOS bucket in bb as
   some resource filters like mod_deflate pass everything up to the EOS
   down the chain immediately and sent the remainder of the brigade later
   (or even never). But in this case the ap_http_header_filter does not
   get out of our way soon enough.

   http_filters.c
   Remove all data buckets that are in a brigade after an EOC bucket
   was seen, as an EOC bucket tells us that no (further) resource
   and protocol data should go out to the client. OTOH meta buckets
   are still welcome as they might trigger needed actions down in
   the chain (e.g. in network filters like SSL).
   Remark 1: It is needed to dump ALL data buckets in the brigade
             since an filter in between might have inserted data
             buckets BEFORE the EOC bucket sent by the original
             sender and we do NOT want this data to be sent.
   Remark 2: Dumping all data buckets here does not necessarily mean
             that no further data is send to the client as:
             1. Network filters like SSL can still be triggered via
                meta buckets to talk with the client e.g. for a
                clean shutdown.
             2. There could be still data that was buffered before
                down in the chain that gets flushed by a FLUSH or an
                EOS bucket.

PR: 37770


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@660726 13f79535-47bb-0310-9956-ffa450edef68
2008-05-27 21:40:48 +00:00
Graham Leggett
cd0452cf82 Remove extra cruft that ended up in a commit.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@654978 13f79535-47bb-0310-9956-ffa450edef68
2008-05-09 23:41:10 +00:00
Graham Leggett
1d1c483317 core, mod_proxy: If a kept_body is present, it becomes safe for
subrequests to support message bodies. Make sure that safety
checks within the core and within the proxy are not triggered
when kept_body is present. This makes it possible to embed
proxied POST requests within mod_include.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@654968 13f79535-47bb-0310-9956-ffa450edef68
2008-05-09 22:40:01 +00:00
Jean-Frederic Clere
334a396c0e Typo.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@650026 13f79535-47bb-0310-9956-ffa450edef68
2008-04-21 06:50:36 +00:00
Jim Jagielski
b86ddabbef Set at init time, and combine comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649922 13f79535-47bb-0310-9956-ffa450edef68
2008-04-20 14:23:25 +00:00
Ruediger Pluem
990f2aafc4 * Do not add the query string again in the case that we are using the
unparsed uri.

PR: 44803


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649840 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 18:48:05 +00:00
Jim Jagielski
aa2cf4597d handle ? in cases where nocanon is in effect
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649239 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 19:20:16 +00:00
Ruediger Pluem
389a94500d * In the case that we fail to read the response line from the backend and if
we are a reverse proxy request shutdown the connection WITHOUT ANY response
  to trigger a retry by the client if allowed (as for idempotent requests).
  BUT currently we should not do this if the request is the first request on
  a keepalive connection as browsers like seamonkey only display an empty page
  in this case and do not do a retry.

Related to PR 37770



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645813 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 09:49:13 +00:00
Ruediger Pluem
0eed857a74 * Fix comment. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@617653 13f79535-47bb-0310-9956-ffa450edef68
2008-02-01 21:21:01 +00:00
Ruediger Pluem
cbb2178f26 * Fix processing of chunked responses if Connection: Transfer-Encoding is
set in the response of the proxied system.

PR: 44311


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@616517 13f79535-47bb-0310-9956-ffa450edef68
2008-01-29 20:55:38 +00:00
Eric Covener
8ea9fdcbc0 *) mod_proxy_http: Return HTTP status codes instead of apr_status_t
values for errors encountered while forwarding the request body
     PR 44165 [Eric Covener]

See also PR 31759 / r448711



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@611292 13f79535-47bb-0310-9956-ffa450edef68
2008-01-11 20:30:23 +00:00
Ruediger Pluem
bd49c01685 * Enable the proxy to keep connections persistent in the HTTPS case.
Basicly the persistence is created by keeping the conn_rec structure
  created for our backend connection (whether http or https) in the connection
  pool. This required to adjust scoreboard.c in a way that its functions can
  properly deal with a NULL scoreboard handle by ignoring the call or returning
  an error code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@602542 13f79535-47bb-0310-9956-ffa450edef68
2007-12-08 20:10:29 +00:00
Nick Kew
c94140fb01 Add option not to send&clear response headers in ap_send_interim_response.
We'll need this option to fix PR#43711, and ap_send_interim_response
is fortunately too new an API to have made it into anything stable.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@588806 13f79535-47bb-0310-9956-ffa450edef68
2007-10-26 23:56:06 +00:00
Nick Kew
785b0379d6 mod_proxy: add "nocanon" keyword to ProxyPass, to suppress
URI-canonicalisation in a reverse proxy.
PR 41798


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@588791 13f79535-47bb-0310-9956-ffa450edef68
2007-10-26 23:07:22 +00:00
Joe Orton
8ecbe56eef * modules/proxy/mod_proxy_http.c (ap_proxy_http_register_hook): Fix
apr_pool_cleanup_register() invocation added in r583202, which was
  causing every apr_proc_create() call to segfault.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@583813 13f79535-47bb-0310-9956-ffa450edef68
2007-10-11 13:02:35 +00:00
Jim Jagielski
854e85d642 (forward) proxy should not be verifying/checking for
valid chars in a URI... pass through.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@583803 13f79535-47bb-0310-9956-ffa450edef68
2007-10-11 12:38:14 +00:00
Jim Jagielski
2349488a44 Abstract out "verification of valid encoding" via
ap_proxy_isvalidenc(). Now we can use it in other
proxy protocols.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@583466 13f79535-47bb-0310-9956-ffa450edef68
2007-10-10 13:16:56 +00:00
Nick Kew
781cb3ce13 missing include!
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@583205 13f79535-47bb-0310-9956-ffa450edef68
2007-10-09 15:59:32 +00:00
Nick Kew
2b9aea3964 mod_proxy_http: Don't unescape/escape forward proxied URLs. Just check them.
PR 42592

also add fix to PR42572 to CHANGES (from r563487/r563489)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@583002 13f79535-47bb-0310-9956-ffa450edef68
2007-10-08 23:47:35 +00:00
Nick Kew
88ae472365 Purge tabs in r582631
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@582655 13f79535-47bb-0310-9956-ffa450edef68
2007-10-07 17:29:40 +00:00
Nick Kew
335f9ca193 mod_proxy_http: Correctly forward unexpected interim (HTTP 1xx) responses.
PR 16518


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@582631 13f79535-47bb-0310-9956-ffa450edef68
2007-10-07 13:43:26 +00:00
Nick Kew
1664984479 No change, but they won't let me have foo
(and ... this is the module with a function addit_dammit !!!)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@581030 13f79535-47bb-0310-9956-ffa450edef68
2007-10-01 18:08:13 +00:00
Nick Kew
b0c37384b3 Proxy: remove Warning headers with wrong date
PR 16138


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580782 13f79535-47bb-0310-9956-ffa450edef68
2007-09-30 20:44:06 +00:00
Nick Kew
1508572821 Fix typo in header name "Trailer"
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580465 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 19:23:27 +00:00
Nick Kew
19769d87d7 Fix processing of Connection headers in proxy
PR 43509


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580457 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 18:50:57 +00:00
Nick Kew
54f22c4dc4 Fix adding out Via header in proxy response
PR 19439


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580060 13f79535-47bb-0310-9956-ffa450edef68
2007-09-27 15:21:12 +00:00
Nick Kew
c27e86e49c Strip hop-by-hop headers in proxy response
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580044 13f79535-47bb-0310-9956-ffa450edef68
2007-09-27 14:53:40 +00:00
Nick Kew
e2e15c26f5 Formatting. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580019 13f79535-47bb-0310-9956-ffa450edef68
2007-09-27 14:20:21 +00:00
Jean-Frederic Clere
8a7f22fc54 Remove tabs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@577349 13f79535-47bb-0310-9956-ffa450edef68
2007-09-19 16:40:26 +00:00
Nick Kew
8be6dff87c Propagate Proxy-Authorization header correctly
PR 25947
RFC2616 tells us:
  (1) If we haven't authenticated, we must pass the header on.
  (2) If we have authenticated, we MAY pass it on.
I've made the latter case configurable by ENV(Proxy-Chain-Auth).

Also, Proxy-Authenticate is a response header, and doesn't belong
in a check of request headers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@574021 13f79535-47bb-0310-9956-ffa450edef68
2007-09-09 15:38:08 +00:00
Nick Kew
19d52e6884 Fix proxy-sendchunk(s|ed) problem
PR 43183


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@572000 13f79535-47bb-0310-9956-ffa450edef68
2007-09-02 15:10:29 +00:00
Nick Kew
c004da0231 proxy_http: don't wait for response body in a HEAD
PR 41644 [Stuart Children]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@571002 13f79535-47bb-0310-9956-ffa450edef68
2007-08-30 00:44:24 +00:00
Jean-Frederic Clere
988dc93196 create the brigate outside ap_proxygetline and reuse it.
correct the overflow handling. (returning APR_ENOSPC was
changing the behaviour).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@561778 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 12:20:34 +00:00
Jean-Frederic Clere
cd6a6923c2 Improve traces in ap_proxy_http_process_response().
That will help to investigate PR 37770. (errors from backend :-)).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@549420 13f79535-47bb-0310-9956-ffa450edef68
2007-06-21 08:01:30 +00:00
Jeff Trawick
8b9efbf9ca HTTP proxy ProxyErrorOverride: Leave 1xx and 3xx responses alone. Only
processing of error responses (4xx, 5xx) will be altered.

PR: 39245

This is based on a patch submitted by Bart van der Schans <schans hippo.nl>
and tweaked slightly by me based on discussions on dev@ since April 2006.
I think rpleum was the first to mention the 1xx issue.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@527969 13f79535-47bb-0310-9956-ffa450edef68
2007-04-12 15:07:11 +00:00