summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-10-21Update docsv1.11.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-05-27Update Qt 5.15 session workaround for lazy_restoreFlorian Bruhin
See #5359 (cherry picked from commit 093a454bf4e386eda8715bc3ea2b217760d5f070)
2020-05-10Check git tree before doing a releaseFlorian Bruhin
See #5426
2020-05-07Release v1.11.1v1.11.1Florian Bruhin
2020-05-07Update changelog from masterFlorian Bruhin
2020-05-02Update changelogFlorian Bruhin
2020-05-02Add test for remembered ignored certificate errorsFlorian Bruhin
This is a continuation of the previous commit for #5403. The tests are split up from the commit itself so that the fix can be backported with less conflicts. See #5403 (cherry picked from commit 45a2be3f9f32f900c0b567998433d43055f722e2)
2020-05-02Security: Remember hosts with ignored cert errors for load statusFlorian Bruhin
Without this change, we only set a flag when a certificate error occurred. However, when the same certificate error then happens a second time (e.g. because of a reload or opening the same URL again), we then colored the URL as success_https (i.e. green) again. See #5403 (cherry picked from commit 021ab572a319ca3db5907a33a59774f502b3b975)
2020-04-27build_release: Separate 32/64-bit pyinstaller envs on WindowsFlorian Bruhin
For some reason, pip fails now when trying to "update" the existing source clone... (cherry picked from commit 14fd4860e4b706cb6af9769e35bdf36f1a9fbce4)
2020-04-27Release v1.11.0v1.11.0Florian Bruhin
2020-04-27scripts: Add --commands to update_versionFlorian Bruhin
2020-04-27Update changelogFlorian Bruhin
2020-04-27Merge remote-tracking branch 'origin/pr/5389'Florian Bruhin
2020-04-27Recompile requirementsFlorian Bruhin
Blacklists pylint/astroid upgrades for now, because of: https://github.com/PyCQA/astroid/issues/772
2020-04-27requirements: Update to flake8 3.8.0a2Florian Bruhin
With --pre, because the last flake8 release is from October 2019 and doesn't support up-to-date pycodestyle releases...
2020-04-27recompile_requirements: Add "#@ pre" markerFlorian Bruhin
2020-04-27Fix indentFlorian Bruhin
...whoops!
2020-04-27Remove extra query for modeJebby
2020-04-27Add stop-gap measure for sessions with Qt 5.15Florian Bruhin
See #5359
2020-04-27Update user_agent completionsFlorian Bruhin
2020-04-27Update _chromium_versionFlorian Bruhin
2020-04-27Update changelogFlorian Bruhin
2020-04-27Update old Qt version warningFlorian Bruhin
See #3839
2020-04-27Don't allow page to be scrolled while hintingJebby
2020-04-23Update changelogFlorian Bruhin
2020-04-23Merge pull request #5234 from sarg/iss-2111Florian Bruhin
Trigger input change event in password_fill.
2020-04-23Merge pull request #5380 from rien333/masterFlorian Bruhin
Add a readability favicon
2020-04-23Add license informationrien333
2020-04-22readability faviconrien333
2020-04-22Merge pull request #5379 from rien333/masterFlorian Bruhin
Open readability page next to original tab
2020-04-22Open readability page next to original tabrien333
2020-04-21tests: Re-add skipping for ListOrValue with keytype intFlorian Bruhin
In d8d9311c2e1fe9c3981febe15774aec8849a2934 we assumed the original check was a mistake - but it wasn't, what we wanted was an additional check instead.
2020-04-21Micro-optimize global eventFilterFlorian Bruhin
Might not make a big difference, but probably worth it, given that this can be called a lot when there are events coming to Qt. Based on a couple of assumptions: - We won't be interested in most events - Very often, events are not going to a QWindow, so we discard them as early as possible. - Very often, it's an event of a type we're not interested in, so we also discard those as early as possible. - "not self._activated" happens rarely. - "if typ not in self._handlers:" is significantly faster than try/except KeyError - try:/except: is only needed around the handler call itself, as we can be reasonably certain the code above won't raise an exception. See #5376
2020-04-21tests: Try to stabilize inserting_text_into_a_text_field_with_undoFlorian Bruhin
2020-04-21tests: Fix check for ListOrValueFlorian Bruhin
We use ListOrValue with functools.partial, so we will need to check for that. Additionally, this can yield different results for any value type, not just ints. Fixes a possible hypothesis test failure: https://travis-ci.org/github/qutebrowser/qutebrowser/jobs/677590734
2020-04-21Merge pull request #5369 from qutebrowser/pyup-scheduled-update-2020-04-20Florian Bruhin
Scheduled weekly dependency update for week 16
2020-04-21scripts: Print errors to stderr instead of stdoutFlorian Bruhin
2020-04-21Improve dictcli.py error outputFlorian Bruhin
See #5367
2020-04-21tests: Increase waitExposed timeoutFlorian Bruhin
2020-04-20tests: Adjust warning filter for changed hypothesis warningFlorian Bruhin
See https://github.com/HypothesisWorks/hypothesis/pull/2387 and https://github.com/HypothesisWorks/hypothesis/issues/2370
2020-04-20Fix crash when parsing invalid /etc/os-release filesFlorian Bruhin
2020-04-20Update virtualenv from 20.0.17 to 20.0.18pyup-bot
2020-04-20Update pytest-mock from 3.0.0 to 3.1.0pyup-bot
2020-04-20Update hypothesis from 5.8.3 to 5.10.1pyup-bot
2020-04-20Update sphinx from 3.0.1 to 3.0.2pyup-bot
2020-04-20Update pyqt-builder from 1.3.1 to 1.3.2pyup-bot
2020-04-20Update urllib3 from 1.25.8 to 1.25.9pyup-bot
2020-04-20Update urllib3 from 1.25.8 to 1.25.9pyup-bot
2020-04-20Update urllib3 from 1.25.8 to 1.25.9pyup-bot