summaryrefslogtreecommitdiff
path: root/misc
AgeCommit message (Collapse)Author
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)
2021-06-01Release v2.2.3v2.2.3Florian Bruhin
2021-06-01Windows Uninstaller: Fix silent uninstall (again)bitraid
(cherry picked from commit 74cf64a063a12a08e8979e2145b3cf0394bf2abd)
2021-06-01Windows Installer: Allow elevation when silentbitraid
(cherry picked from commit 78d4a9d41b0f435bf379ec4b06e3cbcb3d30c207)
2021-05-26RIP FreenodeFlorian Bruhin
(cherry picked from commit 7961cf73553847ea265a388b736fffac77dae66a)
2021-05-26Windows Installer: Update minimum OS versionbitraid
(cherry picked from commit 92178e8152e681fac4d95382978e9391b5ca66d5)
2021-05-20Release v2.2.2v2.2.2Florian Bruhin
2021-04-29Release v2.2.1v2.2.1Florian Bruhin
2021-04-28qute-pass: dont run pass twice when otp-onlyafreakk
(cherry picked from commit b04f99bcfce00c72fe7b8e59d76012141a8cb02d)
2021-04-22Update PyInstaller from masterFlorian Bruhin
2021-04-19qute-pass: extract username/pw only when neededafreakk
(cherry picked from commit efcb3798729b6dedbf63baa443837720df63ce29)
2021-04-19address PR commentfrank shin
(cherry picked from commit 49e858e7d44b6e3ba24a388e2bdbffeb88d9adb8)
2021-04-19Check bitwarden CLI tool return code instead of stderr to check for errorfrank shin
(cherry picked from commit 909230a8acd0423a85322602453cddad372072d8)
2021-04-19requirements: Fully remove python_version marker for adblockFlorian Bruhin
See https://github.com/ArniDagur/python-adblock/issues/28 Follow-up to de4fff386646b305890998b4dff660fe3127026f (cherry picked from commit ffdee8534d69d5f39d49d617b9f47fc4b7b7d86a) Also updates adblock from 3b76a0d4b9613b74b104caec28ecda1445f084a5
2021-04-13Release v2.2.0v2.2.0Florian Bruhin
2021-04-12Update dependenciesqutebrowser bot
2021-04-05Update dependenciesqutebrowser bot
2021-04-01Release v2.1.1Florian Bruhin
2021-04-01Revert "Fix gopass mime format for qute-pass userscript"Florian Bruhin
This reverts commit 3284ec900e42b279bc3bc40593d7356ab1e3f9b0. Not needed as most gopass versions do this when stdout is a pipe, but it interfers with reading the username from the secret. See the discussion in #6323 for more detail, and #5972 for the original PR.
2021-03-29ci: Install coverage[toml] in bleeding-edge depsFlorian Bruhin
needed because pytest-cov requires coverage[toml]
2021-03-29Update dependenciesqutebrowser bot
2021-03-23Merge remote-tracking branch 'origin/pr/6263'Florian Bruhin
2021-03-23Output valid HTMLRijnder Wever
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2021-03-22Merge pull request #6318 from qutebrowser/update-dependenciesFlorian Bruhin
Update dependencies
2021-03-22Avoid pytest-icdiff in bleeding envFlorian Bruhin
See https://github.com/hjwp/pytest-icdiff/pull/20
2021-03-22Update dependenciesqutebrowser bot
2021-03-18qute-pass userscript: Add -o flag to gopass otp invocation so the metadata ↵s3lph
arount the OTP token is omitted
2021-03-17tox: Add a bleeding environmentFlorian Bruhin
See #6298
2021-03-17Revive requirements-tests-gitFlorian Bruhin
See #6298
2021-03-15Merge pull request #6279 from irimi1/keepassxc-userscript-url-fixFlorian Bruhin
userscripts: keepassxc: Fix broken link
2021-03-15tests: Don't download TLD listFlorian Bruhin
2021-03-15Update dependenciesqutebrowser bot
2021-03-14userscripts: keepassxc: Fix broken linkManuel Groß
2021-03-12tox: Force PyQt 5.15.3 for PyInstallerFlorian Bruhin
See #6269
2021-03-12Release v2.1.0v2.1.0Florian Bruhin
2021-03-11[readability-js] Add article metadata on top of the pagerien333
2021-03-11Merge remote-tracking branch 'origin/pr/6241'Florian Bruhin
2021-03-11Merge remote-tracking branch 'origin/pr/6243'Florian Bruhin
2021-03-11Update requirements for PyQt 5.15.4Florian Bruhin
2021-03-08Use HTML5 meta tagrien333
2021-03-08userscripts/readability-js: fixup of 55fdae8rnhmjoj
The mozilla/readability library doesn't output a body by default. So, let's add one in the header and plug the result in.
2021-03-08userscripts/readability: add unique body classrnhmjoj
Until per-domains stylesheets are implemented, there is no way to apply style to the readability page only. With this patch, you can just use the global setting `content.user_stylesheets` by writing a more specific CSS selector. For example: body.qute-readability { font-family: Libertinus; font-size: 1.2em; text-align: justify; } will change the font and text alignment of the readability page, without altering the style of other websites.
2021-03-08Update dependenciesqutebrowser bot
2021-03-05Remove blank line in cheatsheetFlorian Bruhin
2021-03-03Fix license URLFlorian Bruhin
2021-03-03Merge remote-tracking branch 'origin/pr/6056'Florian Bruhin
2021-03-02Revert "requirements: Pin coverage to 5.4 on Python 3.10"Florian Bruhin
This reverts commit 43ff51fe7b47a7f534b9d88545364d2c84e6e6d6. Now fixed upstream.
2021-03-01requirements: Pin coverage to 5.4 on Python 3.10Florian Bruhin
See https://github.com/nedbat/coveragepy/issues/1129
2021-03-01requirements: Document more special commentsFlorian Bruhin
2021-03-01Update dependenciesqutebrowser bot