[tor-commits] [tor-browser/tor-browser-68.1.0esr-9.0-2] Bug 1554805 - Never set firstPartyDomain on origin attributes for moz-extension. r=rpl, Ehsan, tjr

gk at torproject.org gk at torproject.org
Mon Oct 7 13:00:05 UTC 2019


commit 67c1cc525e31d7af3d7ada79211d9edf07b6e07e
Author: Johann Hofmann <jhofmann at mozilla.com>
Date:   Sun Oct 6 15:43:39 2019 +0000

    Bug 1554805 - Never set firstPartyDomain on origin attributes for moz-extension. r=rpl,Ehsan,tjr
    
    Differential Revision: https://phabricator.services.mozilla.com/D47425
    
    --HG--
    extra : moz-landing-system : lando
---
 caps/OriginAttributes.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/caps/OriginAttributes.cpp b/caps/OriginAttributes.cpp
index 7f40e6549310..0737bce36321 100644
--- a/caps/OriginAttributes.cpp
+++ b/caps/OriginAttributes.cpp
@@ -92,6 +92,13 @@ void OriginAttributes::SetFirstPartyDomain(const bool aIsTopLevelDocument,
     return;
   }
 
+  // Add-on principals should never get any first-party domain
+  // attributes in order to guarantee their storage integrity when switching
+  // FPI on and off.
+  if (scheme.EqualsLiteral("moz-extension")) {
+    return;
+  }
+
   nsCOMPtr<nsIPrincipal> blobPrincipal;
   if (dom::BlobURLProtocolHandler::GetBlobURLPrincipal(
           aURI, getter_AddRefs(blobPrincipal))) {



More information about the tor-commits mailing list