mattermost / desktop

Mattermost Desktop application for Windows, Mac and Linux
Apache License 2.0
2k stars 812 forks source link

Oauth / SAML authentication should never take place in an embedded browser #1451

Closed Jenjen1324 closed 11 months ago

Jenjen1324 commented 3 years ago

I confirm (by marking "x" in the [ ] below: [x]):


Summary

According to the OAuth 2.0 Threat Model and Security Considerations (Section 4.1.4) OAuth authentication should not take place in an embedded browser. This also happens on the mobile apps, but I'm not quite sure if this issue applies to Mattermost Server since on the web-app the authentication takes place correctly via a redirect.

Why this is a problem:

Environment

Steps to reproduce

Log in via OAuth

Expected behavior

Any OAuth flow should open the system browser when logging the user in and granting permission to the client app.

Observed behavior

Login window opens within desktop app

Possible fixes

N/A

Willyfrog commented 3 years ago

Hello and thanks for reportting, we totally agree and we currently have a ticket for tracking it.

I look forward to see that change implemented this year :)

Jenjen1324 commented 3 years ago

@Willyfrog that's great to hear. Just to clarify, this also affects the current GitLab authentication which is already in place. I didn't see it mentioned in the linked ticket.

Willyfrog commented 3 years ago

the idea is to work on Oauth for any service, nothing especific for gitlab, google or some other. I'm afraid the linked ticket is more a reminder that we need to work on that than a full description and scope of the feature, that'll will come once we start to work on it.

devinbinnie commented 1 year ago

We have a ticket open to deal with this: https://mattermost.atlassian.net/browse/MM-37984

devinbinnie commented 11 months ago

Hey all,

I want to apologize for the lack of communication on these tickets regarding authentication. But I come with some good news: we've been working on separating the external login flow from the Desktop App, deferring to the browser like many other applications do. This should overall improve security and stability around the login process, as the current implementation requires a few hacks to make it work correctly.

As of today, we released Mattermost v9.1 which has this feature implemented, and should work with all existing Desktop App versions going back to at least v5.3.0. Going forward we will be supporting this login flow for all external providers using the Desktop App, and this should fix any issues around login flow. Your server will need to be upgraded to take advantage of this feature.

I'll be closing these tickets for now as fixed, but feel free to comment and ask questions if you have any. Thanks for your patience :)