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:07:18 +0200
commitc3361c31b370140f323e481dd455450b1e74c099 (patch)
treec6c93cd74b78610a2610789c6ce907b7e39c5056 /qutebrowser/html/settings.html
parent404c276774e689032b0e2c6381bb308c182778de (diff)
downloadqutebrowser-v1.2.x.tar.gz
qutebrowser-v1.2.x.zip
CVE-2018-10895: Fix CSRF issues with qute://settings/set URLv1.2.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 62b424a59..d4ff4ce34 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);