mod_proxy_balancer: Prevent CSRF attacks against the balancer-manager
interface. [Joe Orton]
+ *) mod_proxy: Make all proxy modules nocanon aware and do not add the
+ query string again in this case. PR 44803.
+ [Jim Jagielski, Ruediger Pluem]
+
*) mod_unique_id: Fix timestamp value in UNIQUE_ID.
PR 37064 [Kobayashi <kobayashi firstserver.co.jp>]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_proxy_http, mod_proxy_ajp, mod_proxy_balancer: Make modules nocanon aware
- and do not add the query string again in this case. PR 44803
- [Jim Jagielski, Ruediger Pluem]
- Trunk version of patch:
- http://svn.apache.org/viewvc?rev=649169&view=rev
- http://svn.apache.org/viewvc?rev=649239&view=rev
- http://svn.apache.org/viewvc?rev=649840&view=rev
- http://svn.apache.org/viewvc?rev=649922&view=rev
- http://svn.apache.org/viewvc?rev=650026&view=rev
- http://svn.apache.org/viewvc?rev=661452&view=rev
- http://svn.apache.org/viewvc?rev=661459&view=rev
- Backport version for 2.2.x of patch:
- Trunk version of patch works
- Rollup-patch for 2.2 available at:
- http://people.apache.org/~jim/patches/nocanon-patch-2.2.txt
- +1: rpluem, jim, jfclere
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
*/
static int proxy_ajp_canon(request_rec *r, char *url)
{
- char *host, *path, *search, sport[7];
+ char *host, *path, sport[7];
+ char *search = NULL;
const char *err;
apr_port_t port = AJP13_DEF_PORT;
}
/*
- * now parse path/search args, according to rfc1738
- *
- * N.B. if this isn't a true proxy request, then the URL _path_
- * has already been decoded. True proxy requests have
- * r->uri == r->unparsed_uri, and no others have that property.
+ * now parse path/search args, according to rfc1738:
+ * process the path. With proxy-noncanon set (by
+ * mod_proxy) we use the raw, unparsed uri
*/
- if (r->uri == r->unparsed_uri) {
- search = strchr(url, '?');
- if (search != NULL)
- *(search++) = '\0';
+ if (apr_table_get(r->notes, "proxy-nocanon")) {
+ path = url; /* this is the raw path */
}
- else
+ else {
+ path = ap_proxy_canonenc(r->pool, url, strlen(url), enc_path, 0,
+ r->proxyreq);
search = r->args;
-
- /* process path */
- path = ap_proxy_canonenc(r->pool, url, strlen(url), enc_path, 0,
- r->proxyreq);
+ }
if (path == NULL)
return HTTP_BAD_REQUEST;
static int proxy_balancer_canon(request_rec *r, char *url)
{
- char *host, *path, *search;
+ char *host, *path;
+ char *search = NULL;
const char *err;
apr_port_t port = 0;
url, err);
return HTTP_BAD_REQUEST;
}
- /* now parse path/search args, according to rfc1738 */
- /* N.B. if this isn't a true proxy request, then the URL _path_
- * has already been decoded. True proxy requests have r->uri
- * == r->unparsed_uri, and no others have that property.
+ /*
+ * now parse path/search args, according to rfc1738:
+ * process the path. With proxy-noncanon set (by
+ * mod_proxy) we use the raw, unparsed uri
*/
- if (r->uri == r->unparsed_uri) {
- search = strchr(url, '?');
- if (search != NULL)
- *(search++) = '\0';
+ if (apr_table_get(r->notes, "proxy-nocanon")) {
+ path = url; /* this is the raw path */
}
- else
+ else {
+ path = ap_proxy_canonenc(r->pool, url, strlen(url), enc_path, 0,
+ r->proxyreq);
search = r->args;
-
- /* process path */
- path = ap_proxy_canonenc(r->pool, url, strlen(url), enc_path, 0, r->proxyreq);
+ }
if (path == NULL)
return HTTP_BAD_REQUEST;
*/
static int proxy_http_canon(request_rec *r, char *url)
{
- char *host, *path, *search, sport[7];
+ char *host, *path, sport[7];
+ char *search = NULL;
const char *err;
const char *scheme;
apr_port_t port, def_port;
return HTTP_BAD_REQUEST;
}
- /* now parse path/search args, according to rfc1738 */
- /* N.B. if this isn't a true proxy request, then the URL _path_
- * has already been decoded. True proxy requests have r->uri
- * == r->unparsed_uri, and no others have that property.
- */
- if (r->uri == r->unparsed_uri) {
- search = strchr(url, '?');
- if (search != NULL)
- *(search++) = '\0';
- }
- else
- search = r->args;
-
- /* process path */
- /* In a reverse proxy, our URL has been processed, so canonicalise
+ /*
+ * now parse path/search args, according to rfc1738:
+ * process the path.
+ *
+ * In a reverse proxy, our URL has been processed, so canonicalise
* unless proxy-nocanon is set to say it's raw
* In a forward proxy, we have and MUST NOT MANGLE the original.
*/
else {
path = ap_proxy_canonenc(r->pool, url, strlen(url),
enc_path, 0, r->proxyreq);
+ search = r->args;
}
break;
case PROXYREQ_PROXY: