Strip Cookie headers on cross-origin redirect

Cookie and Cookie2 headers were forwarded to the new host when following
a cross-origin redirect, even though Host, Proxy-Authorization, and
Authorization were already stripped. Add them to the removal list so
session cookies are not leaked to a different origin.
This commit is contained in:
yhirose committed 2026-07-12 10:45:36 -04:00
1 parent 62d899feac
commit 0c1cc8c986
2 files changed
+86 -2

No files matched your search

+2 -2
View File
@@ -13557,8 +13557,8 @@ inline bool ClientImpl::create_redirect_client(
// Clean up request headers that are host/client specific
// Remove headers that should not be carried over to new host
auto headers_to_remove =
std::vector<std::string>{"Host", "Proxy-Authorization", "Authorization"};
auto headers_to_remove = std::vector<std::string>{
"Host", "Proxy-Authorization", "Authorization", "Cookie", "Cookie2"};
for (const auto &header_name : headers_to_remove) {
auto it = req.headers.find(header_name);