Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/main/url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,17 @@ gint main_url_handler(const gchar *url, gboolean clicked)
g_free(passage);

g_string_free(tmpstr, TRUE);
} else if (clicked)
xiphos_open_default(url);
} else if (clicked) {
/* Only allow http:// and https:// URIs through the system
* URI handler. Bible/commentary/dictionary module content
* is rendered HTML that is not otherwise sanitized, so an
* attacker-controlled module could embed a link with a
* dangerous scheme (file://, etc.) to disclose local files
* or otherwise abuse the system's default URI handler. */
if (g_str_has_prefix(url, "http://") ||
g_str_has_prefix(url, "https://"))
xiphos_open_default(url);
}

#undef HAS_URL_PARAM

Expand Down