Ticket #709 (new defect)

Opened 2 years ago

Last modified 2 years ago

simple vhost default root change incorrectly handled

Reported by: iSteve Assigned to: jan
Priority: normal Milestone:
Component: mod_simple_vhost Version: 1.4.11
Severity: major Keywords:
Cc: Blocking:
Need Feedback:

Description

It appears that if I change simple vhost default host (eg. a specific default host for a specific ip range), the server doesn't serve default host if an invalid vhost was attempted to be reached, unless the default host itself has been accessed at least once before, and the original default host is served instead.

Steps to reproduce are, apparently: a) simple-vhost.server-root = "/srv/www-vhosts/ simple-vhost.default-host = "some.domain.tld" simple-vhost.document-root = "/"

b) $HTTPremoteip? == "192.168.0.0/16" { simple-vhost.default-host = "another.tld" } # the ip range is just sample, obviously

and restart server

c) mkdir -p /srv/www-vhosts/{some.domain.tld,another.tld}

d) from ip within range of 192.168.0.0/16: echo -ne "GET / HTTP/1.0\r\nHost: nonexistent.tld\r\n\r\n" | netcat the.http.server 80

e) This will serve "some.domain.tld" instead of "another.tld"

f) echo -ne "GET / HTTP/1.0\r\nHost: another.tld\r\n\r\n" | netcat the.http.server 80

g) This will properly serve another.tld

h) Repeat d) and it will properly serve another.tld

Attachments


Add/Change #709 (simple vhost default root change incorrectly handled)




Change Properties