Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r5095 - trunk/src/http

Anonymous User
February 27, 2013 12:40PM
Author: vbart
Date: 2013-02-27 17:38:54 +0000 (Wed, 27 Feb 2013)
New Revision: 5095
URL: http://trac.nginx.org/nginx/changeset/5095/nginx

Log:
SNI: reset to default server if requested host was not found.

Not only this is consistent with a case without SNI, but this also
prevents abusing configurations that assume that the $host variable
is limited to one of the configured names for a server.

An example of potentially unsafe configuration:

server {
listen 443 ssl default_server;
...
}

server {
listen 443;
server_name example.com;

location / {
proxy_pass http://$host;
}
}

Note: it is possible to negotiate "example.com" by SNI, and to request
arbitrary host name that does not exist in the configuration above.


Modified:
trunk/src/http/ngx_http_request.c

Modified: trunk/src/http/ngx_http_request.c
===================================================================
--- trunk/src/http/ngx_http_request.c 2013-02-27 17:33:59 UTC (rev 5094)
+++ trunk/src/http/ngx_http_request.c 2013-02-27 17:38:54 UTC (rev 5095)
@@ -1869,6 +1869,17 @@
return NGX_ERROR;
}

+#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+
+ if (hc->ssl_servername) {
+ if (rc == NGX_DECLINED) {
+ cscf = hc->addr_conf->default_server;
+ rc = NGX_OK;
+ }
+ }
+
+#endif
+
if (rc == NGX_DECLINED) {
return NGX_OK;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r5095 - trunk/src/http

Anonymous User 740 February 27, 2013 12:40PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 266
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready