New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web UI - apparent path traversal vulnerability#18618
Comments
This is an important find, but you really should have disclosed this privately to the developer before going public with it (their contact info is in the README), especially considering this works without any authentication. Posting it here has it in the clear for attackers to potentially exploit before the necessary fixes are available. |
dgw commented Feb 26, 2023
@notdatabase If you have ideas for a good process, I suggest using GitHub's option to "suggest a security policy" at https://github.com/qbittorrent/qBittorrent/security/policy to improve things for future disclosures. |
sserdda-liamE commented Feb 26, 2023
Security through obscurity is no security at all |
nmcc1212 commented Feb 26, 2023
@sserdda-liamE thats not what he's saying, what he's saying is to disclose it responsibly. common practice is to report vulnerabilities like this privately so they can't be used by a malicious actor, then if nothing happens after a few months then disclose it publically. this is not the way to do |
sserdda-liamE commented Feb 26, 2023
That doesn't respect my freedom™ to use a better client. |
anthonyryan1 commented Feb 26, 2023
Well, since this is worked on publicly I'll chime in with my preliminary findings so far:
I'm going to start bisecting this, but it'll be slower while I figure out how to build this for Windows. I don't think I've ever compiled anything on Windows. |
nmcc1212 commented Feb 26, 2023
someone might want to start a CVE? |
I cannot reproduce on a Win10 21H2 VM, with a fresh install of qbit 4.5.1. After launching qbit, the only config setting I changed is enabling the webUI. Is there some specific config setting that is needed to trigger this? EDIT: ah nvm, I can trigger it. Looks like some versions of
EDIT2: curl has a |
anthonyryan1 commented Feb 26, 2023
Suspected problematic lines: https://github.com/qbittorrent/qBittorrent/blob/release-4.5.1/src/webui/webapplication.cpp#L154-L156 Error on path traversal, ignoring windows line separators. I checked git blame, that line looks really old. So I suspect there may have been another layer offering protection that broke. But we should likely add support for windows separators there for defence in depth in addition to whatever bisect eventually turns up. |
This will prevent the webserver from serving files outside of the webui folder. Closesqbittorrent#18618
Thanks for this. It gave me a head start on where to look. Everyone take a look at PR #18625. I think I have fixed it. Once the CI finishes, there are build artifacts for Windows. You can download them, run them and test if it fixes the problem. |
winterqt commented Feb 27, 2023
@sledgehammer999 As this problematic condition has been present since at least 2015 (going through the blame), do you have any clue what could have caused this to just start happening in 4.5.0? |
This will prevent the webserver from serving files outside of the webui folder. Closesqbittorrent#18618
@winterqt I am not at all familiar with the webui code. I was able to produce the PR due to the comment above me, which pointed me to the correct direction (IMO). |
DrunkenSeafarer commented Feb 27, 2023
Did someone manage to trigger the bug on 4.5.0? |
winterqt commented Feb 27, 2023
I've seen a report of 4.5.0 being vulnerable, yes. |
anthonyryan1 commented Feb 27, 2023
Also not able to reproduce on 4.5.0 (so far). |
w1kl4s commented Feb 27, 2023
65611cd looks like the offending commit - didn't check, only by looking at changelog between 4.5.0 (which supposedly is not affected) and 4.5.1 |
At a glance, I'm unsure how that would affect path normalization/stripping for the controllers -- that looks like it just defines how paths will be returned, unrelated to how they're parsed. Who knows, though, I've barely touched this codebase. |
notdatabase commented Feb 27, 2023
At least from my side, looks like this build does indeed fix it. |
I am able to reproduce this with 4.5.0, but not 4.4.5, so I don't believe the offending commit is in 4.5.1.
|
Is there a URL to grab the windows build artifacts from CI, where I can just throw in a commit hash? I could probably figure out where the commit was introduced more quickly. It's taking me ages to setup a Windows build environment, between install times and lack of familiarity. |
DrunkenSeafarer commented Feb 27, 2023
@anthonyryan1 Unfortunately GitHub Actions only seems to store the uploads for 3 months, so this is not going to be useful for you. I've already tested with the oldest commit from the |
This is an important find, but you really should have disclosed this privately to the developer before going public with it Mea culpa - I’m new at this. In retrospect I realise I should not have disclosed this publicly. Note also that I took no pleasure in logging this. Sincere apologies. Cheers. |
MiTereKun commented Feb 27, 2023
I use remote access with a 10 character, auto-generating password for every session. By the way, utorrent also had something similar, the web interface in the client, it seems, will never become 100% bladeless |
Seems the exploit only affect Windows builds, I'm updating the issue label. |
gnremy commented Feb 27, 2023
Hi, Leveraging this to disclose sensitive information related to WebUI authentication took me about 10 seconds to figure out. Using |
gnremy commented Feb 27, 2023
It appears that the maintainer is already active in this issue, but I went ahead and emailed the contact provided in the README to notify them and close the loop via proper channels. |
@notdatabase issues 就是用来汇报问题的。 |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as off-topic.
This comment was marked as off-topic.
Perhaps devs could consider including tips on both the issue templates and the readme. Additionally, devs could require any vulnerabilities to be reported via private email. I have personally experienced the effectiveness and professionalism of the devs through the private disclosure and bugfix process. |
superclarkk commented Mar 3, 2023
This was a serious concern, but I'm glad it's fixed. Can someone confirm whether it was possible for remote peers/seeds to access files, or does it mostly relate to the local network? |
xavery commented Mar 4, 2023
This only affects WebUI, so it depends on whether you expose the WebUI port to the Internet, what kind of authentication you use, any proxies, etc. |
New drama: qBittorrent (responsible disclosure) qbittorrent/qBittorrent#18618
qBittorrent & operating system versions
qBitTorrent version: 4.5.1 (latest stable as of today).
Operating System: Windows 10, version 22H2. x64 architecture.
What is the problem?
I ran a Nessus vulnerability scan on a machine running qBitTorrent and found that the Web UI can be used to access arbitrary files on the host's filesystem - unauthenticated - via what appears to be a path traversal vulnerability.
Have done some searches on your bug tracker for an existing bug report - and can't find one, some am raising this. Note that this is my first open source bug report - so apologies if I've missed anything. Please let me know if there's anything you need from me.
Steps to reproduce
If you were on my network, you'd do the following:
Expected result: a 403 or 404 response
Actual result: the win.ini file from the remote machine is displayed
Have attached a screenshot where I create a file on the remote machine then retrieve that file unauthenticated from my laptop.
Additional context
Log(s) & preferences file(s)
No response
The text was updated successfully, but these errors were encountered: