[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-52.4.1esr-7.5-1] Bug 24052: Handle redirects by blocking them early



commit a99a3504e931768ce57dd26d3ae784576da7c5ac
Author: Arthur Edelstein <arthuredelstein@xxxxxxxxx>
Date:   Wed Nov 1 02:33:18 2017 -0700

    Bug 24052: Handle redirects by blocking them early
    
    This is the second part of the workaround for
    https://bugzilla.mozilla.org/show_bug.cgi?id=1412081.
---
 netwerk/protocol/http/nsHttpChannel.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
index 0e570e8cb57d..b38be48bf0c9 100644
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -5419,6 +5419,13 @@ nsHttpChannel::AsyncProcessRedirection(uint32_t redirectType)
         return NS_ERROR_CORRUPTED_CONTENT;
     }
 
+    bool isRedirectToFile = false;
+    rv = mRedirectURI->SchemeIs("file", &isRedirectToFile);
+    if (!NS_FAILED(rv) && isRedirectToFile) {
+        LOG(("Attempted to redirect from a remote page to a file:// URI."));
+        return NS_ERROR_FAILURE;
+    }
+
     if (mApplicationCache) {
         // if we are redirected to a different origin check if there is a fallback
         // cache entry to fall back to. we don't care about file strict

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits