-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Security Measures for "Login flow v2" ? #21698
Comments
server/core/Db/LoginFlowV2Mapper.php Line 35 in 5bf3d1b
|
Well if a user does this:
You lost already anyway. Sure we can improve the message, but on a technical level this is not an issue. |
@nickvergessen nextcloud presents the perfect login page under the correct domain |
Yeah, which is why we should extend the description a bit: #21706 |
I mean in theory we could show 5 digit code. or something. But I doubt people will check. also please always report security sensitive issues via hackerone |
@nickvergessen i am a bit irritated about the "disconnect" between the Client (who perhaps is meant to be an e.g. Native App) i myself perhaps would feel better, if the second /POST/ to actually retrieve the Token would be forced to originate from the same source-ip adress that would make it harder for a third party to get the AppPassword |
I'll keep that in mind The difference between Oauth2 is, that the IdP hands out an AuthCode back directly to the user. OAuth2 sends the user back to the Serviceprovider or NativeApp, via redirect_uri. Here with login flow v2, you just push out an Auth-Page to UserX and |
Save the ip address and show a warning on mismatch sounds good to me. |
Dear Team,
i discovered Login flow v2
My Question is at the bottom :-)
Lets say, a phisher tries to use that API to initiate the Retrieval of an AppToken for UserXYZ, that is not himself.
curl -X POST https://demo2.nextcloud.com/index.php/login/v2
(-> Using demo2.nextcloud.com in this example, but it could be nextcloud.ImportantCompany.com as well)
The phisher gets back the following:
{"poll":{"token":"3cx8pDOb3QJfQJDZDo4WemN4cjQDIhV4YZZELxeL7Wm5qWiIyZkYnLbZnbyS4IdEEakvVYMqxY1PM6tFr3Paam2dOstOjarCX4NfxGGFUFOxzjDjziJFdgX2A8NKoRH","endpoint":"https:\/\/demo2.nextcloud.com\/index.php\/login\/v2\/poll"},"login":"https:\/\/demo2.nextcloud.com\/index.php\/login\/v2\/flow\/ve5rsdvyLkgPjMU8ozIDf2Q0YVpz3aEj98oKQ59N3SiAzrwP9Zi0Rm1kdjgcQgRoE0OL9s52im0cGAlAZ18QG0MX63k4pemHVlCShGZbFYI4AvRJ985bBavDsz0Lqc21s"}
The phisher then sends an EMail to UserXYZ at ImportantCompany Ltd. to open up the link and follow the instructions at:
https://demo2.nextcloud.com/index.php/login/v2/flow/ve5rsdvyLkgPjMU8ozIDf2Q0YVpz3aEj98oKQ59N3SiAzrwP9Zi0Rm1kdjgcQgRoE0OL9s52im0cGAlAZ18QG0MX63k4pemHVlCShGZbFYI4AvRJ985bBavDsz0Lqc21s
The phisher waits for the user to grant access and afterwards the phisher polls:
curl -X POST https://demo2.nextcloud.com/login/v2/poll -d "token=3cx8pDOb3QJfQJDZDo4WemN4cjQDIhV4YZZELxeL7Wm5qWiIyZkYnLbZnbyS4IdEEakvVYMqxY1PM6tFr3Paam2dOstOjarCX4NfxGGFUFOxzjDjziJFdgX2A8NKoRH"
So the phisher retrieves an AppToken für UserXYZ like:
I assume the phisher then can use all API Calls whatsoever of that Nextcloud's User named UserXYZ.
Question is: Are there any measures that prevent a phisher to use this method?
Perhaps not only targeted for a specific user, but using this for a mass mailing phishing attack.
(The phisher then of course has to build an infrastructure to mass-poll the API, which should be no problem)
Am i missing something here?
The text was updated successfully, but these errors were encountered: