Compare commits

..
4 Commits
Author SHA1 Message Date
Kornel Lesiński 2a693e62bf v1.13.1 2016-02-04 23:57:25 +00:00
Kornel Lesiński eb3d962526 Merge branch '1.11.x' into 1.13.0
* 1.11.x:
  Prevent inclusion of local files via file:// XML entities
  Disable redirects to non-HTTP URLs in release notes webview
2016-02-04 23:56:40 +00:00
Kornel Lesiński a6e9c8aff6 Prevent inclusion of local files via file:// XML entities 2016-01-29 14:52:55 +00:00
Kornel Lesiński 70f6929ac7 Disable redirects to non-HTTP URLs in release notes webview 2016-01-29 14:52:55 +00:00
3 changed files with 12 additions and 3 deletions

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
SPARKLE_VERSION_MAJOR = 1
SPARKLE_VERSION_MINOR = 13
SPARKLE_VERSION_PATCH = 0
SPARKLE_VERSION_PATCH = 1
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION)
+1 -1
View File
@@ -102,7 +102,7 @@
if (self.downloadFilename)
{
NSUInteger options = 0;
options = NSXMLNodeLoadExternalEntitiesSameOriginOnly;
options = NSXMLNodeLoadExternalEntitiesNever; // Prevent inclusion from file://
document = [[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:self.downloadFilename] options:options error:&error];
[[NSFileManager defaultManager] removeItemAtPath:self.downloadFilename error:nil];
+10 -1
View File
@@ -262,8 +262,17 @@
- (void)webView:(WebView *)__unused sender decidePolicyForNavigationAction:(NSDictionary *)__unused actionInformation request:(NSURLRequest *)request frame:(WebFrame *)__unused frame decisionListener:(id<WebPolicyDecisionListener>)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 (self.webViewFinishedLoading) {
NSURL *requestURL = request.URL;
if (requestURL) {
[[NSWorkspace sharedWorkspace] openURL:requestURL];
}