From ec146a98282db88441e05a56337f149539d4cd79 Mon Sep 17 00:00:00 2001 From: Sam Deane Date: Wed, 10 Feb 2016 10:08:43 +0000 Subject: [PATCH] Applied patch @ a6e9c8aff644f0cf5314c9f10e039c34cd350561 from the main Sparkle tree, to prevent inclusion from a file in the appcast. (this is still not foolproof - a man in the middle attack could do plenty of mischief with the wrong http/https url) --- SUAppcast.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SUAppcast.m b/SUAppcast.m index 0f2ec0ad..a6524951 100644 --- a/SUAppcast.m +++ b/SUAppcast.m @@ -99,8 +99,7 @@ // In order to avoid including external entities when parsing the appcast (a potential security vulnerability; see https://github.com/andymatuschak/Sparkle/issues/169), we ask NSXMLDocument to "tidy" the XML first. This happens to remove these external entities; it wouldn't be a future-proof approach, but it worked in these historical versions of OS X, and we have a more rigorous approach for 10.7+. options = NSXMLDocumentTidyXML; } else { - // In 10.7 and later, there's a real option for the behavior we desire. - options = NSXMLNodeLoadExternalEntitiesSameOriginOnly; + options = NSXMLNodeLoadExternalEntitiesNever; // Prevent inclusion from file:// } document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:options error:&error] autorelease];