summaryrefslogtreecommitdiff
path: root/tests/end2end/test_invocations.py
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:59 +0200
commitc2ff32d92ba9bf40ff53498ee04a4124d4993c85 (patch)
treeaa8130a54e7ea9b58f2b4192954deff26fd97d12 /tests/end2end/test_invocations.py
parent718f73be2eb062f4893a463bca34c18feeded251 (diff)
downloadqutebrowser-v1.3.x.tar.gz
qutebrowser-v1.3.x.zip
CVE-2018-10895: Fix CSRF issues with qute://settings/set URLv1.3.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 'tests/end2end/test_invocations.py')
-rw-r--r--tests/end2end/test_invocations.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py
index d6b4b1300..4ee0f36de 100644
--- a/tests/end2end/test_invocations.py
+++ b/tests/end2end/test_invocations.py
@@ -366,8 +366,10 @@ def test_qute_settings_persistence(short_tmpdir, request, quteproc_new):
"""Make sure settings from qute://settings are persistent."""
args = _base_args(request.config) + ['--basedir', str(short_tmpdir)]
quteproc_new.start(args)
- quteproc_new.open_path(
- 'qute://settings/set?option=search.ignore_case&value=always')
+ quteproc_new.open_path('qute://settings/')
+ quteproc_new.send_cmd(':jseval --world main '
+ 'cset("search.ignore_case", "always")')
+
assert quteproc_new.get_setting('search.ignore_case') == 'always'
quteproc_new.send_cmd(':quit')