[vlc-commits] contrib/sparkle: secure updates
Kornel Lesiński
git at videolan.org
Wed Jan 20 11:58:48 CET 2016
vlc/vlc-2.2 | branch: master | Kornel Lesiński <kornel at geekhood.net> | Wed Jan 20 11:44:39 2016 +0100| [ef9930fcbebdb4ac2d771943ffcb4874ae5ea287] | committer: Felix Paul Kühne
contrib/sparkle: secure updates
Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
(cherry picked from commit f03cb6720e8fcdbaad86893dfcd327baccdf9cac)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=ef9930fcbebdb4ac2d771943ffcb4874ae5ea287
---
contrib/src/sparkle/rules.mak | 2 ++
...directs-to-non-HTTP-URLs-in-release-notes.patch | 20 ++++++++++++++++++++
...lusion-of-local-files-via-file-XML-entiti.patch | 12 ++++++++++++
3 files changed, 34 insertions(+)
diff --git a/contrib/src/sparkle/rules.mak b/contrib/src/sparkle/rules.mak
index 41459ae..0b758a7 100644
--- a/contrib/src/sparkle/rules.mak
+++ b/contrib/src/sparkle/rules.mak
@@ -16,6 +16,8 @@ sparkle: Sparkle-$(SPARKLE_VERSION).zip .sum-sparkle
$(UNPACK)
$(APPLY) $(SRC)/sparkle/sparkle-fix-compilation-on-snowleopard.patch
$(APPLY) $(SRC)/sparkle/sparkle-fix-runtime-exception-on-snowleopard.patch
+ $(APPLY) $(SRC)/sparkle/sparkle-disable-redirects-to-non-HTTP-URLs-in-release-notes.patch
+ $(APPLY) $(SRC)/sparkle/sparkle-prevent-inclusion-of-local-files-via-file-XML-entiti.patch
$(MOVE)
.sparkle: sparkle
diff --git a/contrib/src/sparkle/sparkle-disable-redirects-to-non-HTTP-URLs-in-release-notes.patch b/contrib/src/sparkle/sparkle-disable-redirects-to-non-HTTP-URLs-in-release-notes.patch
new file mode 100644
index 0000000..d3eaf3d
--- /dev/null
+++ b/contrib/src/sparkle/sparkle-disable-redirects-to-non-HTTP-URLs-in-release-notes.patch
@@ -0,0 +1,20 @@
+diff -ru Sparkle-1.6.1/SUUpdateAlert.m Sparkle-1.6.1-fixed/SUUpdateAlert.m
+--- Sparkle-1.6.1/SUUpdateAlert.m 2014-04-26 00:22:59.000000000 +0200
++++ Sparkle-1.6.1-fixed/SUUpdateAlert.m 2016-01-20 11:38:47.000000000 +0100
+@@ -313,6 +313,16 @@
+
+ - (void)webView:sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:frame decisionListener:listener
+ {
++ NSURL *requestURL = request.URL;
++ NSString *scheme = requestURL.scheme;
++ BOOL whitelistedSafe = [@"http" isEqualToString:scheme] || [@"https" isEqualToString:scheme] || [@"about:blank" isEqualToString:requestURL.absoluteString];
++
++ // Do not allow redirects to dangerous protocols such as file://
++ if (!whitelistedSafe) {
++ [listener ignore];
++ return;
++ }
++
+ if (webViewFinishedLoading) {
+ [[NSWorkspace sharedWorkspace] openURL:[request URL]];
+
diff --git a/contrib/src/sparkle/sparkle-prevent-inclusion-of-local-files-via-file-XML-entiti.patch b/contrib/src/sparkle/sparkle-prevent-inclusion-of-local-files-via-file-XML-entiti.patch
new file mode 100644
index 0000000..bcfe595
--- /dev/null
+++ b/contrib/src/sparkle/sparkle-prevent-inclusion-of-local-files-via-file-XML-entiti.patch
@@ -0,0 +1,12 @@
+diff -ru Sparkle-1.6.1/SUAppcast.m Sparkle-1.6.1-fixed/SUAppcast.m
+--- Sparkle-1.6.1/SUAppcast.m 2016-01-20 11:39:11.000000000 +0100
++++ Sparkle-1.6.1-fixed/SUAppcast.m 2016-01-20 11:40:53.000000000 +0100
+@@ -92,7 +92,7 @@
+
+ if (downloadFilename)
+ {
+- NSUInteger options = NSXMLDocumentTidyXML;
++ NSUInteger options = NSXMLDocumentTidyXML | NSXMLNodeLoadExternalEntitiesNever;
+ document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:options error:&error] autorelease];
+
+ [[NSFileManager defaultManager] removeItemAtPath:downloadFilename error:nil];
More information about the vlc-commits
mailing list