-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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. |
@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. |
Security through obscurity is no security at all |
@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 |
That doesn't respect my freedom™ to use a better client. |
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. |
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 |
Suspected problematic lines: 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. |
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. |
@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. Closes qbittorrent#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). |
Did someone manage to trigger the bug on 4.5.0? |
I've seen a report of 4.5.0 being vulnerable, yes. |
Also not able to reproduce on 4.5.0 (so far). |
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. |
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. |
@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.
|
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. |
Hi, Leveraging this to disclose sensitive information related to WebUI authentication took me about 10 seconds to figure out. Using |
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. |
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? |
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. |
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: