-
-
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
Data folder accessible if "Satisfy Any" is set #6449
Comments
Sorry for double post then. At least the malicious setting has been identified here, which is also present on #6281 . As first fast reaction I think an adjustment of the related admin manual part would be good, as many users seem to use But of course it would be great, if e.g. €: As there is a certain use case (apache folder authentication) for |
cc @nextcloud/security |
Just played around a bit:
So as conclusion: So as far as I could test it, fix would be to adjust /data/.htaccess to meet the example above and keep the |
Any news about this? I still see here and there users with this settings, that definitely don't need it and might expose their data with it. @ |
I upgraded from 13.0.6.1 to 14.0.0 and suddenly NC warned me that .htaccess didn't work and my data would be exposed which indeed it was. Removing |
I see the same: When I upgrade nextcloud, it replaces my .htaccess file in the data folder with the following:
However, this makes the data folder world readable, probably because of some setting in apache that I did in order for caldav/carddav to work (using the guide).
The .htaccess file that works for me is the following:
i.e. with the if statements commented out. System:
I have my installation at The main problem is that I had this security issue solved, but the upgrade just threw me back, and I only noticed it by chance. |
Strange, this is not 100% the same. The
However, it seems that
What definitely need to be changed:
|
@MichaIng what is the status here? |
@skjnldsv As long as you did not setup any web authentication outside of Nextcloud, that is you have to enter credentials to access e.g. the webroot itself, simply never add If you have an authentication setup, that includes the Nextcloud dir, so you would need to enter the webserver credentials once, the Nextcloud credentials again, to login (which breaks clients then), for now I would add Rather then adding some workaround for this security issue to the docs, I would like to see the This is still a major security issue, since I found many users adding Ah but note that all of this is only an issue if your data dir is inside the webserver webroot, so e.g. Just checked the docs,
|
Thanks! :) |
As long as Nextcloud does rewrite a functioning .htaccess file to one that leaves the full installation world readable, I think it is fair to say that it is a Nextcloud issue. Or what do you mean by "just a config issue"? What is nextcloud without a proper config? This might only affect a few of us, maybe with a particular distro or whatnot, but I think the severity of the issue requires some extra things to be checked during update. |
It affects everyone with an Apache webserver (regardless of distro),
Nope nothing needs to be checked, the I will open a PR when I find this |
Data htaccess: Lines 541 to 558 in 3a0e4a1
Root htaccess ? Lines 1 to 14 in 2e36069
|
@skjnldsv Root access is this one: https://github.com/nextcloud/server/blob/master/.htaccess PR up: #16792 |
Just to confirm, the new
|
sorry for bumping this old issue, but i came across it via a random search and found an error in the syntax! @MichaIng in the 9th last line of the last message the |
Yes there was this typo indeed which has been fixed here: a98f8b5 |
Hi, I know this post is kinda old, but I really need help, I cant get the error message to disappear. My apache2 config of the directory with the nextcloud installation looks like this: And my .htaccess file in /nextcloud/data looks like this: How can I fix this? |
First of all there are some issues with your configs:
Remove the following, doesn't and probably didn't ever had any effect and has been removed from the Nextcloud docs as well in the meantime: nextcloud/documentation#1800
And since you do not actually use different vhosts with different names, it makes sense to move But that alone doesn't explain that your data can be accessed directly. Where is it located? Just in Which OS and Apache version do you use ( Is there a |
Hello, AccessFileName .htaccess is existing in the config. I use Ubuntu 21.10 and Apache/2.4.48 (Ubuntu) And yes its located in /var/www/cloud.domain.yt/data |
And this URL works in browser access works/does not redirect you to the login/default page?
or
|
Nope it just shows a blank page |
Strange, so it is accessible while You need to go though all loaded Apache2 configurations, there must be something which block Apache2 from using it. E.g. to check for all cases of the grep -r 'AccessFileName' /etc/apache2 And to check for read permissions of that file: ls -l /var/www/cloud.domain.yt/data/.htaccess And to check for Apache2 error messages: journalctl -u apache2
cat /var/log/apache2/error.log |
root@v3179:~# grep -r 'AccessFileName' /etc/apache2 -rw-r--r-- 1 www-data www-data 542 Nov 8 19:38 /var/www/cloud.domain.yt/data/.htaccess journalctl and cat: https://paste.deko.yt/view/d5add159 |
Can you show the whole line of this log? Looks like the |
When I add random invalid lines, this error comes in data/index.html Internal Server Error Please contact the server administrator at my.name@domain.yt to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. Apache/2.4.48 (Ubuntu) Server at cloud.domain.yt Port 80 No new errors in the error.log https://paste.deko.yt/view/9589e71a Also something I recognized. Since some days, nextcloud also says phpimagick is missing, but its literally installed and enabled. It just came from one to the other night. |
So the a2enmod authz_core |
root@v3179: |
Okay, then I'm basically out of ideas. The config file is parsed and this module is enabled, then access should be blocked:
Even if
While it would be interesting to have this debugged, probably on a more specialised Apache or webserver forum, StackExchange or so where more experts are attracted, an alternative for you now would be to move your Nextcloud userdata to a different location outside of the webroot: https://help.nextcloud.com/t/howto-change-move-data-directory-after-installation/17170 |
I just hope a Nextcloud Dev sees my problem and can help me here. If not, I probably need to find an alternative to nextcloud (tho I cant really find one except owncloud) |
Likely not on a closed issue which has been addressed already. And furthermore it's not a Nextcloud issue but one with the webserver or its configuration. |
So I can do pretty much nothing else then have this security issue? Because I already did everything, that should make the .htaccess file working. |
At least I am out of ideas, as long as you leave the data directory inside the webroot. Moving it away is to too hard, following the linked HowTo, and solves all related security issues most reliable. And else, as said, at best you ask for help on a more specialised forum related to webservers and/or Apache2 in particular. |
Rewards are always welcome thou, but it is not me that fell above this: https://help.nextcloud.com/t/htaccess-warning-while-configuration-should-be-ok/20280/17?u=michaing
Steps to reproduce
.htaccess
files are used as expected to prevent access to data folder.Satisfy Any
to nextcloud vhost/config file as mentioned in admin manual as necessary in some cases: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#additional-apache-configurationsExpected behaviour
Access should be forbidden.
Actual behaviour
Access works very well.
/data/index.html
is still possible.Server configuration
Operating system: Raspbian/Debian Stretch
Web server: Apache/2.4.25
Database: MariaDB 10.1
PHP version: 7.0.19-1
Nextcloud version: 12.0.2
Updated from an older Nextcloud/ownCloud or fresh install: updated
Where did you install Nextcloud from: downloads.nextcloud.com
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: Opera 49 + Edge 40.15 were tested.
Operating system:
Logs
Web server error log
none
Nextcloud log (data/nextcloud.log)
none
Browser log
nene
The text was updated successfully, but these errors were encountered: