summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-10-21Update docsv1.12.xFlorian Bruhin
(cherry picked from commit 41b05f954882313131a75ccbc53c1e373a915d38)
2021-10-21CVE-2021-41146: Add --untrusted-args to avoid argument injectionFlorian Bruhin
On Windows, if an application is registered as an URL handler like this: HKEY_CLASSES_ROOT https URL Protocol = "" [...] shell open command (Default) = ".../qutebrowser.exe" "%1" one would think that Windows takes care of making sure URLs can't inject arguments by containing a quote. However, this is not the case, as stated by the Microsoft docs: https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa767914(v=vs.85) Security Warning: Applications that handle URI schemes must consider how to respond to malicious data. Because handler applications can receive data from untrusted sources, the URI and other parameter values passed to the application may contain malicious data that attempts to exploit the handling application. and As noted above, the string that is passed to a pluggable protocol handler might be broken across multiple parameters. Malicious parties could use additional quote or backslash characters to pass additional command line parameters. For this reason, pluggable protocol handlers should assume that any parameters on the command line could come from malicious parties, and carefully validate them. Applications that could initiate dangerous actions based on external data must first confirm those actions with the user. In addition, handling applications should be tested with URIs that are overly long or contain unexpected (or undesirable) character sequences. Indeed it's trivial to pass a command to qutebrowser this way - given how trivial the exploit is to recreate given the information above, here's a PoC: https:x" ":spawn calc (or qutebrowserurl: instead of https: if qutebrowser isn't registered as a default browser) Some applications do escape the quote characters before calling qutebrowser - but others, like Outlook Desktop or .url files, do not. As a fix, we add an --untrusted-args flag and some early validation of the raw sys.argv, before parsing any arguments or e.g. creating a QApplication (which might already allow injecting Qt flags there). We assume that there's no way for an attacker to inject flags *before* the %1 placeholder in the registry, and add --untrusted-args as the last argument of the registry entry. This way, it'd still be possible for users to customize their invocation flags without having to remove --untrusted-args. After --untrusted-args, however, we have some rather strict checks: - There should be zero or one arguments, but not two (or more) - Any argument may not start with - (flag) or : (qutebrowser command) We also add the --untrusted-args flag to the Linux .desktop file, though it should not be needed there, as the specification there is sane: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables Implementations must take care not to expand field codes into multiple arguments unless explicitly instructed by this specification. This means that name fields, filenames and other replacements that can contain spaces must be passed as a single argument to the executable program after expansion. There is no comparable mechanism on macOS, which opens the application without arguments and then sends an "open" event to it: https://doc.qt.io/qt-5/qfileopenevent.html This issue was introduced in qutebrowser v1.7.0 which started registering it as URL handler: baee2888907b260881d5831c68500941937261a0 / #4086 This is by no means an issue isolated to qutebrowser. Many other projects have had similar trouble with Windows' rather unexpected behavior: Electron / Exodus Bitcoin wallet: - http://web.archive.org/web/20190702112128/https://medium.com/0xcc/electrons-bug-shellexecute-to-blame-cacb433d0d62 - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000006 - https://medium.com/hackernoon/exploiting-electron-rce-in-exodus-wallet-d9e6db13c374 IE/Firefox: - https://bugzilla.mozilla.org/show_bug.cgi?id=384384 - https://bugzilla.mozilla.org/show_bug.cgi?id=1572838 Others: - http://web.archive.org/web/20210930203632/https://www.vdoo.com/blog/exploiting-custom-protocol-handlers-in-windows - https://parsiya.net/blog/2021-03-17-attack-surface-analysis-part-2-custom-protocol-handlers/ - etc. etc. See CVE-2021-41146 / GHSA-vw27-fwjf-5qxm: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41146 https://github.com/qutebrowser/qutebrowser/security/advisories/GHSA-vw27-fwjf-5qxm Thanks to Ping Fan (Zetta) Ke of Valkyrie-X Security Research Group (VXRL/@vxresearch) for finding and responsibly disclosing this issue. (cherry picked from commit 8f46ba3f6dc7b18375f7aa63c48a1fe461190430) # Conflicts: # qutebrowser/qutebrowser.py # tests/unit/test_qutebrowser.py
2020-06-01Release v1.12.0v1.12.0Florian Bruhin
2020-06-01AppVeyor: Go back to Qt 5.14Florian Bruhin
See https://github.com/qutebrowser/qutebrowser/issues/5237#issuecomment-636845641
2020-06-01tests: Ignore QHttpNetworkConnection warningFlorian Bruhin
See https://github.com/qutebrowser/qutebrowser/issues/5390#issuecomment-634062762
2020-06-01tests: Ignore new Qt 5.15 Chromium error on AppVeyorFlorian Bruhin
See https://github.com/qutebrowser/qutebrowser/issues/5237#issuecomment-636845641
2020-06-01Revert "AppVeyor: Go back to Qt 5.14"Florian Bruhin
This reverts commit 56404bc52c80f1ed01a53770e0ba66e1647fc34c.
2020-06-01AppVeyor: Go back to Qt 5.14Florian Bruhin
See https://github.com/qutebrowser/qutebrowser/issues/5237#issuecomment-636845641
2020-06-01Add test for utils.libgl_workaround()Florian Bruhin
2020-06-01Rename version.version() to version_info()Florian Bruhin
To get a less generic name.
2020-06-01Fix lintFlorian Bruhin
2020-06-01Mark only-active-window test as flakyFlorian Bruhin
2020-06-01Recompile requirementsFlorian Bruhin
2020-06-01ci: Switch to Qt 5.15Florian Bruhin
2020-06-01backendproblem: Suggest to disable WebGL with older OpenGL versionsFlorian Bruhin
Also make it a bit clearer that using QtWebKit isn't the preferred solution to those problems. Fixes #5313
2020-05-29backendproblem: Deduplicate textFlorian Bruhin
2020-05-29Refactor how we get OpenGL infoFlorian Bruhin
This allows us to get the version string in addition to the vendor. We also show that version string in the version info output. See #5313
2020-05-29Remove unused import in utils.messageFlorian Bruhin
Not needed anymore since 16d98a4137762dfb2731d8bc185549de721d3ca6 - for some odd reason, the pylint failure only came up on CI now, and I don't see it locally...
2020-05-29Add site-specific quirk for Google DriveFlorian Bruhin
Fixes #5472 See #4805, #4810
2020-05-28tests: Don't use ";;" for caret testsFlorian Bruhin
If we chain two commands, the end2end test code will still only wait for "command called: *" once. This causes all future waits to be "shifted" by one, which can cause flaky tests on Windows. All other usages of command chaining in tests actually *need* the second command to run as soon as possible after the original one. However, for the caret tests, we only need to run two commands, see 2b0870084b9185b8f8a12639d238c12b202d3284. Because pytest-bdd doesn't allow us to re-use "Given" steps, and "Background:" only accepts "Given", let's add a second "Given" step as an ugly but acceptable hack. See https://github.com/pytest-dev/pytest-bdd/issues/157 See https://github.com/qutebrowser/qutebrowser/issues/5390#issuecomment-622885572
2020-05-27Revert "Corrected "c.tabs.possition" typo"Florian Bruhin
This reverts commit ef3a4b00f0de7a2a2f5f013faa9e3df09611d60e. Reverts #5469. That misspelling is intentional (see context).
2020-05-27Merge remote-tracking branch 'origin/pr/5290'Florian Bruhin
2020-05-27Make test_configinit work again with all platformsFlorian Bruhin
2020-05-27configdata: Remove double spaces after periodsFlorian Bruhin
See #5394
2020-05-27tests: Ensure consistency for configdata float valuesFlorian Bruhin
See #5394
2020-05-27Merge pull request #5469 from chaorace/patch-1Florian Bruhin
Corrected "c.tabs.possition" typo
2020-05-27Corrected "c.tabs.possition" typoChristopher Crockett
possition -> position
2020-05-27Add dark mode settingsFlorian Bruhin
Closes #5394 See #2377
2020-05-27configtypes: Add alias for "Union[None, usertypes.Unset]"Florian Bruhin
2020-05-27configtypes: Fix handling of Unset in _Numeric with boundsFlorian Bruhin
2020-05-27fix error in asciidoc2html.py scriptJulin S
2020-05-26Add filename if QtOSError is used with QFileDeviceFlorian Bruhin
If we have a filename available, let's add it to the error message. This also effectively reverts 00747be9d3790534e8b32464605d1b5b6c2d6627 since that's not needed anymore (Qt 5.7 is the oldest supported release).
2020-05-26Update completions for content.headers.user_agentFlorian Bruhin
2020-05-26Update Qt 5.15 session workaround for lazy_restoreFlorian Bruhin
See #5359
2020-05-26Fix indentFlorian Bruhin
2020-05-26Log exception traceback for init errorsFlorian Bruhin
Also improve error handling in test_err_windows
2020-05-26tests: Try increasing file_updated timeoutFlorian Bruhin
See https://github.com/qutebrowser/qutebrowser/issues/5390#issuecomment-631066927
2020-05-26tests: Return early in hypothesis test for List configtypeFlorian Bruhin
See https://github.com/qutebrowser/qutebrowser/issues/5390#issuecomment-622881094
2020-05-26tests: Improve IDs in test_configtypesFlorian Bruhin
2020-05-26Merge pull request #5465 from qutebrowser/pyup-scheduled-update-2020-05-25Florian Bruhin
Scheduled weekly dependency update for week 21
2020-05-25Update virtualenv from 20.0.20 to 20.0.21pyup-bot
2020-05-25Update tox from 3.15.0 to 3.15.1pyup-bot
2020-05-25Update pytest-cov from 2.8.1 to 2.9.0pyup-bot
2020-05-25Update hypothesis from 5.14.0 to 5.15.1pyup-bot
2020-05-25Update flake8 from 3.8.1 to 3.8.2pyup-bot
2020-05-25Update six from 1.14.0 to 1.15.0pyup-bot
2020-05-25Update six from 1.14.0 to 1.15.0pyup-bot
2020-05-25Update six from 1.14.0 to 1.15.0pyup-bot
2020-05-25Update six from 1.14.0 to 1.15.0pyup-bot
2020-05-25Update six from 1.14.0 to 1.15.0pyup-bot