tempesta
tempesta copied to clipboard
Wrong cached response with fake host
Scope
There is a possibility to replace original http2 response by response with the same URI from another non http2 vhost. To achieve this need to send request with specific Host
while cache is clear.
Testing
Can be reproduced by the next steps:
- Clear tempesta cache.
- curl -vk https://debian/file.html -H'Host: frontend'
- curl -vk https://debian/file.html
On third step file.html
will be received from frontend
vhost, instead of debian
vhost.
Test config:
listen 443 proto=h2;
listen 80;
srv_group main {
server 127.0.0.1:8080;
}
srv_group front {
server 127.0.0.1:8081;
}
vhost debian {
tls_certificate /etc/tempesta/tfw-root.crt;
tls_certificate_key /etc/tempesta/tfw-root.key;
proxy_pass main;
}
vhost frontend {
proxy_pass front;
}
http_chain {
host == "frontend" -> frontend;
host == "debian" -> debian;
-> block;
}
cache_fulfill * *;
Also need to implement functional test for this issue.
Linked issue #1630
Fixed in #1862