summaryrefslogtreecommitdiff
path: root/qutebrowser/html/settings.html
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2018-07-09 23:38:47 +0200
committerFlorian Bruhin <git@the-compiler.org>2018-07-11 17:06:40 +0200
commitff686ff7f395d83e5ac48507ecfae0b0e97a61ef (patch)
tree10465c0cea2939fe9458254968fda49a3e004132 /qutebrowser/html/settings.html
parent8486efa940d8349176237dec47a5fbd8694e0375 (diff)
downloadqutebrowser-v1.1.x.tar.gz
qutebrowser-v1.1.x.zip
CVE-2018-10895: Fix CSRF issues with qute://settings/set URLv1.1.x
In ffc29ee043ae7336d9b9dcc029a05bf7a3f994e8 (part of v1.0.0), a qute://settings/set URL was added to change settings. Contrary to what I apparently believed at the time, it *is* possible for websites to access `qute://*` URLs (i.e., neither QtWebKit nor QtWebEngine prohibit such requests, other than the usual cross-origin rules). In other words, this means a website can e.g. have an `<img>` tag which loads a `qute://settings/set` URL, which then sets `editor.command` to a bash script. The result of that is arbitrary code execution. Fixes #4060 See #2332 (cherry picked from commit 43e58ac865ff862c2008c510fc5f7627e10b4660)
Diffstat (limited to 'qutebrowser/html/settings.html')
-rw-r--r--qutebrowser/html/settings.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/qutebrowser/html/settings.html b/qutebrowser/html/settings.html
index b370c0d91..e44cf9a7f 100644
--- a/qutebrowser/html/settings.html
+++ b/qutebrowser/html/settings.html
@@ -3,7 +3,8 @@
{% block script %}
var cset = function(option, value) {
// FIXME:conf we might want some error handling here?
- var url = "qute://settings/set?option=" + encodeURIComponent(option);
+ var url = "qute://user:{{csrf_token}}@settings/set"
+ url += "?option=" + encodeURIComponent(option);
url += "&value=" + encodeURIComponent(value);
var xhr = new XMLHttpRequest();
xhr.open("GET", url);