Closed yupthatguy closed 1 year ago
Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!
My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!
If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+
⚠️ This issue respects the following points: ⚠️
Bug description
I disabled (did not remove) brute force months ago in favor of fail2ban. Now, my webdav logins are being recorded as webdav login failures and causing -disabled & removed- bruteforce application to disable my primary user account. Yes, the ip address is whitelisted in fail2ban.
I have to manually enter phpmyadmin and clear my local ip from
oc_bruteforce_attempts
table in the db in order to regain access. using theocc security:bruteforce:reset ip_address
to reset brute force had no effect... until -after- I reinstalled bruteforce and whitelisted my IP (note this failed to solve the problem).NC bruteforce ignores the whitelist values, so I tried completely removing bruteforce from the server. Net results is now
occ security:bruteforce:reset ip_address
does respond...The only way to keep my primary user account functional is to run a cron job to remove my IP from
oc_bruteforce_attempts
& re-enable my user every minute. (An obvious waste of resources)Things that I have tried:
1.) I installed, verified whitelist of my IPs (problem persisted), then completely removed the brute force app, still problem persists as oc_bruteforce_attempts table is still in db 2.) I completely deactivated ModSec, for the specific virtualhost of my nextcloud instance, bug not ModSec related, problem persisted 3.) I re-created the problem with ethernet cable and/or wifi connections 4.) I added my ip address as a trusted domain, problem persists 5.) I added my ip as a truested proxy, problem persists. 6.) I disconnected all sync clients, and only accessed via web nextcloud via Chromium browser, the problem persists. 7.) I accessed redis-cli and used “flushall” , problem persists
Steps to reproduce
1.) Fresh install NC23 Upgrade to NC via updater scirpt while bruteforce app is disabled, but not removed 2.) Overview = All checks passed 3.) Clean Apache2 error log (only modsec errors blocking internet bots, no errors related to my IP) 4.) disconnect all sync devices, only log in via web GUI.
FYI, NC was installed via Virtualmin script and updated by the NC updater script
Expected behavior
I don't expected the bruteforce app that has been disabled and now removed to randomly start banning a whitelisted and safe IP address that has been working for almost 2 months.
Installation method
Other
Operating system
Debian/Ubuntu
PHP engine version
PHP 7.4
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
When I install and remove bruteforce I get these errors:
INSTALL adminuser@admin:~$ tail -f ncerrors/error.log
{"reqId":"YpMCxvoqLJ-wmESL8mCLSAAAAAY","level":3,"time":"May 29, 2022 05:21:20","remoteAddr":"XXX.XXX.XXX.XXX","user":"fathertime","app":"core","method":"GET","url":"/index.php/core/preview.png?file=/Documents/China%20Life/Clients/Akira/DO%20NOT%20DELETE/Case%20Profile.ods&c=29f2b3c96ef1882f44cf320e064dafaa&x=150&y=150","message":"OC_Image::fixOrientation(): No image loaded","userAgent":"Mozilla/5.0 (Linux) mirall/3.5.1 (build 10305) (Nextcloud, ubuntu-5.13.0-44-generic ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"24.0.1.1"} {"reqId":"xh35HKcSk4DDFZ5idcsL","level":3,"time":"May 29, 2022 05:21:31","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"count(): Parameter must be an array or an object that implements Countable at /home/adminuser/public_html/lib/private/Memcache/Redis.php#81","userAgent":"--","version":"24.0.1.1","exception":{"Exception":"Error","Message":"count(): Parameter must be an array or an object that implements Countable at /home/adminuser/public_html/lib/private/Memcache/Redis.php#81","Code":0,"Trace":[{"function":"onError","class":"OC\Log\ErrorHandler","type":"::"},{"file":"/home/adminuser/public_html/lib/private/Memcache/Redis.php","line":81,"function":"count"},{"file":"/home/adminuser/public_html/lib/private/App/AppManager.php","line":451,"function":"clear","class":"OC\Memcache\Redis","type":"->"},{"file":"/home/adminuser/public_html/lib/private/App/AppManager.php","line":326,"function":"clearAppsCache","class":"OC\App\AppManager","type":"->"},{"file":"/home/adminuser/public_html/lib/private/legacy/OC_App.php","line":455,"function":"enableApp","class":"OC\App\AppManager","type":"->"},{"file":"/home/adminuser/public_html/core/Command/App/Install.php","line":97,"function":"enable","class":"OC_App","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\Core\Command\App\Install","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\Component\Console\Command\Command","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\Component\Console\Application","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\Component\Console\Application","type":"->"},{"file":"/home/adminuser/public_html/lib/private/Console/Application.php","line":211,"function":"run","class":"Symfony\Component\Console\Application","type":"->"},{"file":"/home/adminuser/public_html/console.php","line":99,"function":"run","class":"OC\Console\Application","type":"->"},{"file":"/home/adminuser/public_html/occ","line":11,"args":["/home/adminuser/public_html/console.php"],"function":"require_once"}],"File":"/home/adminuser/public_html/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
Remove adminuser@admin:~$ tail -f ncerrors/error.log
{"reqId":"YpMDPcg0DsQBibgpMkpk7QAAAAU","level":3,"time":"May 29, 2022 05:23:09","remoteAddr":"XXX.XXX.XXX.XXX","user":"fathertime","app":"no app in context","method":"PROPFIND","url":"/remote.php/dav/files/fathertime/","message":"User disabled","userAgent":"Mozilla/5.0 (Linux) mirall/3.5.1 (build 10305) (Nextcloud, ubuntu-5.13.0-44-generic ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"24.0.1.1","exception":{"Exception":"OC\User\LoginException","Message":"User disabled","Code":0,"Trace":[{"file":"/home/adminuser/public_html/lib/private/User/Session.php","line":654,"function":"completeLogin","class":"OC\User\Session","type":"->","args":[" sensitive parameters replaced "]},{"file":"/home/adminuser/public_html/lib/private/User/Session.php","line":353,"function":"loginWithToken","class":"OC\User\Session","type":"->","args":[" sensitive parameters replaced "]},{"file":"/home/adminuser/public_html/lib/private/User/Session.php","line":450,"function":"login","class":"OC\User\Session","type":"->","args":[" sensitive parameters replaced "]},{"file":"/home/adminuser/public_html/apps/dav/lib/Connector/Sabre/Auth.php","line":129,"function":"logClientIn","class":"OC\User\Session","type":"->","args":[" sensitive parameters replaced "]},{"file":"/home/adminuser/public_html/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php","line":103,"function":"validateUserPass","class":"OCA\DAV\Connector\Sabre\Auth","type":"->","args":[" sensitive parameters replaced "]},{"file":"/home/adminuser/public_html/apps/dav/lib/Connector/Sabre/Auth.php","line":251,"function":"check","class":"Sabre\DAV\Auth\Backend\AbstractBasic","type":"->"},{"file":"/home/adminuser/public_html/apps/dav/lib/Connector/Sabre/Auth.php","line":154,"function":"auth","class":"OCA\DAV\Connector\Sabre\Auth","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":180,"function":"check","class":"OCA\DAV\Connector\Sabre\Auth","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":135,"function":"check","class":"Sabre\DAV\Auth\Plugin","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMethod","class":"Sabre\DAV\Auth\Plugin","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/sabre/dav/lib/DAV/Server.php","line":456,"function":"emit","class":"Sabre\DAV\Server","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\DAV\Server","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\DAV\Server","type":"->"},{"file":"/home/adminuser/public_html/apps/dav/lib/Server.php","line":352,"function":"exec","class":"Sabre\DAV\Server","type":"->"},{"file":"/home/adminuser/public_html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\DAV\Server","type":"->"},{"file":"/home/adminuser/public_html/remote.php","line":166,"args":["/home/adminuser/public_html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/home/adminuser/public_html/lib/private/User/Session.php","Line":370,"CustomMessage":"--"}} {"reqId":"YpMDPcg0DsQBibgpMkpk7QAAAAU","level":4,"time":"May 29, 2022 05:23:09","remoteAddr":"XXX.XXX.XXX.XXX","user":"fathertime","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/fathertime/","message":"OC\User\LoginException: User disabled","userAgent":"Mozilla/5.0 (Linux) mirall/3.5.1 (build 10305) (Nextcloud, ubuntu-5.13.0-44-generic ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"24.0.1.1","exception":{"Exception":"Sabre\DAV\Exception\ServiceUnavailable","Message":"OC\User\LoginException: User disabled","Code":0,"Trace":[{"file":"/home/adminuser/public_html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":180,"function":"check","class":"OCA\DAV\Connector\Sabre\Auth","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":135,"function":"check","class":"Sabre\DAV\Auth\Plugin","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMethod","class":"Sabre\DAV\Auth\Plugin","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/sabre/dav/lib/DAV/Server.php","line":456,"function":"emit","class":"Sabre\DAV\Server","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\DAV\Server","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\DAV\Server","type":"->"},{"file":"/home/adminuser/public_html/apps/dav/lib/Server.php","line":352,"function":"exec","class":"Sabre\DAV\Server","type":"->"},{"file":"/home/adminuser/public_html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\DAV\Server","type":"->"},{"file":"/home/adminuser/public_html/remote.php","line":166,"args":["/home/adminuser/public_html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/home/adminuser/public_html/apps/dav/lib/Connector/Sabre/Auth.php","Line":161,"CustomMessage":"--"}} {"reqId":"D6Uce0DpwkCXBHNlJ16Z","level":3,"time":"May 29, 2022 05:23:10","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"count(): Parameter must be an array or an object that implements Countable at /home/adminuser/public_html/lib/private/Memcache/Redis.php#81","userAgent":"--","version":"24.0.1.1","exception":{"Exception":"Error","Message":"count(): Parameter must be an array or an object that implements Countable at /home/adminuser/public_html/lib/private/Memcache/Redis.php#81","Code":0,"Trace":[{"function":"onError","class":"OC\Log\ErrorHandler","type":"::"},{"file":"/home/adminuser/public_html/lib/private/Memcache/Redis.php","line":81,"function":"count"},{"file":"/home/adminuser/public_html/lib/private/App/AppManager.php","line":451,"function":"clear","class":"OC\Memcache\Redis","type":"->"},{"file":"/home/adminuser/public_html/lib/private/App/AppManager.php","line":413,"function":"clearAppsCache","class":"OC\App\AppManager","type":"->"},{"file":"/home/adminuser/public_html/core/Command/App/Remove.php","line":99,"function":"disableApp","class":"OC\App\AppManager","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\Core\Command\App\Remove","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\Component\Console\Command\Command","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\Component\Console\Application","type":"->"},{"file":"/home/adminuser/public_html/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\Component\Console\Application","type":"->"},{"file":"/home/adminuser/public_html/lib/private/Console/Application.php","line":211,"function":"run","class":"Symfony\Component\Console\Application","type":"->"},{"file":"/home/adminuser/public_html/console.php","line":99,"function":"run","class":"OC\Console\Application","type":"->"},{"file":"/home/adminuser/public_html/occ","line":11,"args":["/home/adminuser/public_html/console.php"],"function":"require_once"}],"File":"/home/adminuser/public_html/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}