From e2c9660b3a1e1816c513cd88e0808fec7c94288c Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Wed, 5 Sep 2012 00:04:58 +0200 Subject: [PATCH] Limit data: for main content to images --- midori/midori-view.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/midori/midori-view.c b/midori/midori-view.c index 41c6ba4b..36065f35 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -952,6 +952,13 @@ midori_view_web_view_navigation_decision_cb (WebKitWebView* web_view return TRUE; } } + else if (g_str_has_prefix (uri, "data:image/")) + { + /* For security reasons, main content served as data: is limited to images + http://lcamtuf.coredump.cx/switch/ */ + webkit_web_policy_decision_ignore (decision); + return TRUE; + } #ifdef HAVE_GCR else if (/* view->special && */ !strncmp (uri, "https", 5)) {