mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-26 04:57:54 +00:00
Whitelist about:srcdoc as a safe web URL (#2006)
The document I tested (after enabling javascript) was:
<description>
<![CDATA[
<p>Hello</p>
<script>
var iframe = document.createElement("iframe");
iframe.srcdoc = `<!DOCTYPE html><p>Hello World!</p>`;
document.body.appendChild(iframe);
</script>
]]>
</description>
This commit is contained in:
1 file changed
+1
-1
Vendored
+1
-1
@@ -16,7 +16,7 @@
|
||||
BOOL SUWebViewIsSafeURL(NSURL *url, BOOL *isAboutBlankURL)
|
||||
{
|
||||
NSString *scheme = url.scheme;
|
||||
BOOL isAboutBlank = [url.absoluteString isEqualToString:@"about:blank"];
|
||||
BOOL isAboutBlank = [url.absoluteString isEqualToString:@"about:blank"] || [url.absoluteString isEqualToString:@"about:srcdoc"];
|
||||
BOOL whitelistedSafe = isAboutBlank || [@[@"http", @"https", @"macappstore", @"macappstores", @"itms-apps", @"itms-appss"] containsObject:scheme];
|
||||
|
||||
*isAboutBlankURL = isAboutBlank;
|
||||
|
||||
Reference in new issue
Block a user