Commit Graph

22928 Commits

Author SHA1 Message Date
Florian Bruhin ca114a0766 scripts: Fix changelog URLs for real 2021-10-21 18:26:57 +02:00
Florian Bruhin e6e7e95013 scripts: Use new Qt path in build_release 2021-10-21 18:18:36 +02:00
Florian Bruhin 51972fa4e2 Revert "scripts: Remove macOS symlinking"
This reverts commit a0bfb7c824.

It *is* required, just used the wrong path...

gg
2021-10-21 18:18:03 +02:00
Florian Bruhin a8dacd98fb scripts: Remove old -Qt5 PyQt packages 2021-10-21 18:03:21 +02:00
Florian Bruhin 9989bf223f requirements: PyQt 5.15.5 2021-10-21 18:02:49 +02:00
Florian Bruhin 337ad04fd4 utils: Don't require coverage for old PyYAML workaround 2021-10-21 18:02:36 +02:00
Florian Bruhin a0bfb7c824 scripts: Remove macOS symlinking
Seems to be fixed in PyInstaller 4.4? See #6611.
2021-10-21 17:07:53 +02:00
Florian Bruhin 959c388984 tox: Use newest PyQt for pyinstaller
See #6611
2021-10-21 16:51:55 +02:00
Florian Bruhin 8326ea0e9d scripts: Adjust changelog URLs 2021-10-21 16:49:33 +02:00
Florian Bruhin 5fb7d337fa Merge remote-tracking branch 'origin/update-dependencies' 2021-10-21 16:48:37 +02:00
Florian Bruhin 777d82fce4 Update docs 2021-10-21 16:44:20 +02:00
Florian Bruhin c1c0f0f801 Update UA completions 2021-10-21 16:22:24 +02:00
Florian Bruhin 58e64d28c4 Don't register qutebrowserurl: as URL protocol
This was originally intended as a fix for CVE-2021-41146, but it turned out the
same exploit works via e.g. https:// just as well. Still, it makes sense to
remove it.
2021-10-21 16:01:54 +02:00
Florian Bruhin 8f46ba3f6d CVE-2021-41146: Add --untrusted-args to avoid argument injection
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: baee288890 / #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.
2021-10-21 16:01:04 +02:00
qutebrowser bot 07cf1ff356 Update dependencies 2021-10-18 04:19:35 +00:00
Florian Bruhin 1547a48e6f tests: Adjust for PyYAML 6.0 2021-10-14 09:05:25 +02:00
Florian Bruhin 4b86ae07eb
Merge pull request #6737 from qutebrowser/update-dependencies
Update dependencies
2021-10-14 09:05:20 +02:00
Florian Bruhin 82ee43a56a scripts: Update path to flake8 release notes 2021-10-11 14:38:38 +02:00
Florian Bruhin b75786560d scripts: Add cached-property changelog URL 2021-10-11 14:33:00 +02:00
qutebrowser bot a16951ca67 Update dependencies 2021-10-11 04:21:27 +00:00
Florian Bruhin d9dc87d43e doc: Clarify SOCKS auth support 2021-10-09 18:55:30 +02:00
Florian Bruhin 0f38c94197
Merge pull request #6725 from qutebrowser/update-dependencies
Update dependencies
2021-10-04 11:03:49 +02:00
Florian Bruhin 247e77fa10 scripts: Adjust py-filelock changelog URL 2021-10-04 11:02:51 +02:00
qutebrowser bot a58bb22388 Update dependencies 2021-10-04 04:20:38 +00:00
Florian Bruhin efd002dae3 requirements: Revert to pytest-bdd release for bleeding
See https://github.com/pytest-dev/pytest-bdd/issues/447
2021-10-01 14:58:38 +02:00
Florian Bruhin 9e5d8609b1
Merge pull request #6720 from haztecaso/patch-1
Add userscript bitwarden-rofi to the list of userscripts
2021-09-29 18:04:15 +02:00
Adrián Lattes 002db2c6b8
Add userscript bitwarden-rofi 2021-09-29 15:04:18 +02:00
Florian Bruhin 9e4ab225f2
Merge pull request #6711 from mhmdanas/fix-minor-mistakes
Fix a couple of minor mistakes
2021-09-27 20:30:28 +02:00
mhmdanas b7f14d3bfb Fix a couple of minor mistakes 2021-09-27 20:46:22 +03:00
Florian Bruhin 4f7d14849b
Merge pull request #6706 from qutebrowser/update-dependencies
Update dependencies
2021-09-27 07:59:54 +02:00
qutebrowser bot 4ddb008a27 Update dependencies 2021-09-27 04:20:00 +00:00
Florian Bruhin 9683c2cf97 Update changelog
(partially cherry picked from commit 957c8bc312)
2021-09-26 16:26:21 +02:00
Florian Bruhin 7ef6647a38 Add GM_setClipboard
Based on the Greasemonkey implementation:
https://github.com/greasemonkey/greasemonkey/blob/4.11/src/bg/api-provider-source.js#L232-L249

Needed by e.g. this script to work at all:
https://greasyfork.org/en/scripts/394820-mouseover-popup-image-viewer

(cherry picked from commit 1bea826981)
2021-09-26 16:26:21 +02:00
Florian Bruhin b4b7b3699e
Update Nyxt description in README
Closes #6705
2021-09-24 11:40:33 +02:00
Florian Bruhin 1f5e8ca54c
Merge pull request #6697 from qutebrowser/update-dependencies
Update dependencies
2021-09-20 10:59:04 +02:00
qutebrowser bot 7c98cc981d Update dependencies 2021-09-20 08:19:52 +00:00
Florian Bruhin 2b28ab015d Revert "requirements: Use older pluggy"
This reverts commit 41febf9475.

diff_cover now requires pluggy >=1.0.0.
2021-09-20 10:00:18 +02:00
Florian Bruhin 4c1334b3b9
Merge pull request #6682 from qutebrowser/update-dependencies
Update dependencies
2021-09-13 10:08:00 +02:00
qutebrowser bot 9a210fcef4 Update dependencies 2021-09-13 07:40:03 +00:00
Florian Bruhin 3527f21121 scripts: Clean up pylint build files 2021-09-13 09:29:35 +02:00
Florian Bruhin caf6345251 requirements: Test --use-feature=in-tree-build 2021-09-13 08:38:45 +02:00
Florian Bruhin 41febf9475 requirements: Use older pluggy
See https://github.com/Bachmann1234/diff_cover/issues/249
2021-09-13 08:30:52 +02:00
Florian Bruhin 39ff01ca64 Update docs 2021-09-12 09:45:32 +02:00
Florian Bruhin a68aaef320 Update changelog 2021-09-12 08:49:59 +02:00
Nicholas Boyd Isacsson 1892831255 Try to fix :tab-clone --private test 2021-09-10 17:19:11 +02:00
Nicholas Boyd Isacsson 484a80cbb9
Update doc for tab-clone's --private flag
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2021-09-10 16:03:08 +02:00
Nicholas Boyd Isacsson 2e0549fe9f Update test cases for :tab-clone --private 2021-09-10 15:53:54 +02:00
Nicholas Boyd Isacsson daecf903a4 Add --private flag to :tab-clone 2021-09-10 15:49:44 +02:00
Florian Bruhin 9a8d37216c Fix lint 2021-09-08 16:45:37 +02:00
Florian Bruhin 8a61bd635a Improve docs for URL patterns
Closes #6454, see #5069
2021-09-08 16:18:28 +02:00