Nextcloud version 25.0.7 Ubuntu 20.04.6 Apache v ersion2.4.41-4ubuntu3.14 PHP version 7.4
Good day! I am using LDAP and SAML apps in my nextcloud instance, and I faced the problem of bypass SAML authentication in browser.
Steps to replicate it:
Open https://<instance_name>/remote.php/dav/files/<user_name>
Enter correct credentials
Delete <user_name> from URL
Step by step delete from url files/ ; dav/ ; remote.php
Cheers, you are logged in without SAML.
In case of my IDP, providing 2fa with SAML auth, such a bypass is a vulnerability.
Does anyone know, how it can be fixed without app password for dav clients?
When you enter correct credentials in browser opening https://<instance_name>/remote.php/dav/files/, there is a page, telling: This is the WebDAV interface. It can only be accessed by WebDAV clients such as the Next cloud desktop sync client. Probably, there is a possibility to convert this message to an error for browsers?
Do you mean enter the app password? I believe this is expected as the app password isn’t scoped in any way except for filesystem access. You could always log in via the app password from https://<instance_name>/index.php/login?direct=1
I cannot login with browser to WebDav. This is expected. I am presented with a creds pop up. I enters my Creds, and is sent to an “internal server error”. Trying to browse to anything (deleting part of url) I am redirected to login page.
You cannot use SAML with WebDAV. It is not support by the devices using DAV to access filesystems. It only supports username-password.
But I cannot bypass it to gain access to anything.
I don’t believe there is an easy way to change existing users and it requires modifying the DB. New users created by the SAML plugin will have the user_saml backend automatically
That’s all that i could get with occ config:list user_saml:
“user_saml”: {
“enabled”: “yes”,
“general-require_provisioned_account”: “1”,
“general-use_saml_auth_for_desktop”: “1”,
“installed_version”: “5.2.0”,
“type”: “saml”,
“types”: “authentication”
}
Do you need something more specific?