Skip to content
Snippets Groups Projects
  1. Apr 04, 2023
  2. Mar 20, 2023
  3. Dec 15, 2022
  4. Nov 17, 2022
  5. Nov 16, 2022
  6. Nov 07, 2022
  7. Oct 30, 2022
  8. Oct 05, 2022
  9. Aug 24, 2022
  10. Jun 21, 2022
  11. May 26, 2022
  12. Apr 06, 2022
  13. Mar 09, 2022
    • chandrn7's avatar
      Allow login through OpenID Connect (#16221) · a6ed6845
      chandrn7 authored
      * added OpenID Connect as an SSO option
      
      * minor fixes
      
      * added comments, removed an option that shouldn't be set
      
      * fixed Gemfile.lock
      
      * added newline to end of Gemfile.lock
      
      * removed tab from Gemfile.lock
      
      * remove chomp
      
      * codeclimate changes and small name change to make function's purpose clearer
      
      * codeclimate fix
      
      * added SSO buttons to /about page
      
      * minor refactor
      
      * minor style change
      
      * removed spurious change
      
      * removed unecessary conditional from ensure_valid_username and added support for auth.info.name in user_params_from_auth
      
      * minor changes
      a6ed6845
  14. Mar 01, 2022
    • Claire's avatar
      Change old moderation strikes to be displayed in a separate page (#17566) · 14919fe1
      Claire authored
      * Change old moderation strikes to be displayed in a separate page
      
      Fixes #17552
      
      This changes the moderation strikes displayed on `/auth/edit` to be those from
      the past 3 months, and make all moderation strikes targeting the current user
      available in `/disputes`.
      
      * Add short description of what the strikes page is for
      
      * Move link to list of strikes to “Account status” instead of navigation item
      
      * Normalize i18n file
      
      * Fix layout and styling of strikes link
      
      * Revert highlights_on regexp
      
      * Reintroduce account status summary
      
      - this way, “Account status” is never empty
      - account status is not necessarily bound to strikes, or recent strikes
      14919fe1
  15. Feb 14, 2022
    • Eugen Rochko's avatar
      Add appeals (#17364) · 564efd06
      Eugen Rochko authored
      * Add appeals
      
      * Add ability to reject appeals and ability to browse pending appeals in admin UI
      
      * Add strikes to account page in settings
      
      * Various fixes and improvements
      
      - Add separate notification setting for appeals, separate from reports
      - Fix style of links in report/strike header
      - Change approving an appeal to not restore statuses (due to federation complexities)
      - Change style of successfully appealed strikes on account settings page
      - Change account settings page to only show unappealed or recently appealed strikes
      
      * Change appealed_at to overruled_at
      
      * Fix missing method error
      564efd06
  16. Jan 23, 2022
    • Claire's avatar
      Add OMNIAUTH_ONLY environment variable to enforce externa log-in (#17288) · bddd9ba3
      Claire authored
      * Remove support for OAUTH_REDIRECT_AT_SIGN_IN
      
      Fixes #15959
      
      Introduced in #6540, OAUTH_REDIRECT_AT_SIGN_IN allowed skipping the log-in form
      to instead redirect to the external OmniAuth login provider.
      
      However, it did not prevent the log-in form on /about introduced by #10232 from
      appearing, and completely broke with the introduction of #15228.
      
      As I restoring that previous log-in flow without introducing a security
      vulnerability may require extensive care and knowledge of how OmniAuth works,
      this commit removes support for OAUTH_REDIRECT_AT_SIGN_IN instead for the time
      being.
      
      * Add OMNIAUTH_ONLY environment variable to enforce external log-in only
      
      * Disable user registration when OMNIAUTH_ONLY is set to true
      
      * Replace log-in links When OMNIAUTH_ONLY is set with exactly one OmniAuth provider
      bddd9ba3
    • Claire's avatar
      Remove support for OAUTH_REDIRECT_AT_SIGN_IN (#17287) · cfa583fa
      Claire authored
      Fixes #15959
      
      Introduced in #6540, OAUTH_REDIRECT_AT_SIGN_IN allowed skipping the log-in form
      to instead redirect to the external OmniAuth login provider.
      
      However, it did not prevent the log-in form on /about introduced by #10232 from
      appearing, and completely broke with the introduction of #15228.
      
      As I restoring that previous log-in flow without introducing a security
      vulnerability may require extensive care and knowledge of how OmniAuth works,
      this commit removes support for OAUTH_REDIRECT_AT_SIGN_IN instead for the time
      being.
      cfa583fa
  17. Jan 16, 2022
  18. Nov 05, 2021
    • Claire's avatar
      Fix reviving revoked sessions and invalidating login (#16943) · 6da135a4
      Claire authored
      Up until now, we have used Devise's Rememberable mechanism to re-log users
      after the end of their browser sessions. This mechanism relies on a signed
      cookie containing a token. That token was stored on the user's record,
      meaning it was shared across all logged in browsers, meaning truly revoking
      a browser's ability to auto-log-in involves revoking the token itself, and
      revoking access from *all* logged-in browsers.
      
      We had a session mechanism that dynamically checks whether a user's session
      has been disabled, and would log out the user if so. However, this would only
      clear a session being actively used, and a new one could be respawned with
      the `remember_user_token` cookie.
      
      In practice, this caused two issues:
      - sessions could be revived after being closed from /auth/edit (security issue)
      - auto-log-in would be disabled for *all* browsers after logging out from one
        of them
      
      This PR removes the `remember_token` mechanism and treats the `_session_id`
      cookie/token as a browser-specific `remember_token`, fixing both issues.
      6da135a4
  19. Sep 30, 2021
  20. Aug 26, 2021
  21. Aug 25, 2021
    • Claire's avatar
      Fix authentication failures after going halfway through a sign-in attempt (#16607) · 94bcf453
      Claire authored
      * Add tests
      
      * Add security-related tests
      
      My first (unpublished) attempt at fixing the issues introduced (extremely
      hard-to-exploit) security vulnerabilities, addressing them in a test.
      
      * Fix authentication failures after going halfway through a sign-in attempt
      
      * Refactor `authenticate_with_sign_in_token` and `authenticate_with_two_factor` to make the two authentication steps more obvious
      94bcf453
    • Daniel's avatar
      Fix undefined variable for Auth::OmniauthCallbacksController (#16654) · 5c210211
      Daniel authored
      The addition of authentication history broke the omniauth login with
      the following error:
      
        method=GET path=/auth/auth/cas/callback format=html
        controller=Auth::OmniauthCallbacksController action=cas status=500
        error='NameError: undefined local variable or method `user' for
        #<Auth::OmniauthCallbacksController:0x00000000036290>
        Did you mean?  @user' duration=435.93 view=0.00 db=36.19
      
      * app/controllers/auth/omniauth_callbacks_controller.rb: fix variable
        name to `@user`
      5c210211
  22. Jun 21, 2021
  23. May 03, 2021
  24. Dec 10, 2020
    • ThibG's avatar
      Add honeypot fields and minimum fill-out time for sign-up form (#15276) · 49eb4d4d
      ThibG authored
      
      * Add honeypot fields to limit non-specialized spam
      
      Add two honeypot fields: a fake website input and a fake password confirmation
      one. The label/placeholder/aria-label tells not to fill them, and they are
      hidden in CSS, so legitimate users should not fall into these.
      
      This should cut down on some non-Mastodon-specific spambots.
      
      * Require a 3 seconds delay before submitting the registration form
      
      * Fix tests
      
      * Move registration form time check to model validation
      
      * Give people a chance to clear the honeypot fields
      
      * Refactor honeypot translation strings
      
      Co-authored-by: default avatarClaire <claire.github-309c@sitedethib.com>
      49eb4d4d
  25. Nov 12, 2020
  26. Oct 12, 2020
  27. Aug 24, 2020
    • santiagorodriguez96's avatar
      Add WebAuthn as an alternative 2FA method (#14466) · e8d41bc2
      santiagorodriguez96 authored
      
      * feat: add possibility of adding WebAuthn security keys to use as 2FA
      
      This adds a basic UI for enabling WebAuthn 2FA. We did a little refactor
      to the Settings page for editing the 2FA methods – now it will list the
      methods that are available to the user (TOTP and WebAuthn) and from
      there they'll be able to add or remove any of them.
      Also, it's worth mentioning that for enabling WebAuthn it's required to
      have TOTP enabled, so the first time that you go to the 2FA Settings
      page, you'll be asked to set it up.
      This work was inspired by the one donde by Github in their platform, and
      despite it could be approached in different ways, we decided to go with
      this one given that we feel that this gives a great UX.
      
      Co-authored-by: default avatarFacundo Padula <facundo.padula@cedarcode.com>
      
      * feat: add request for WebAuthn as second factor at login if enabled
      
      This commits adds the feature for using WebAuthn as a second factor for
      login when enabled.
      If users have WebAuthn enabled, now a page requesting for the use of a
      WebAuthn credential for log in will appear, although a link redirecting
      to the old page for logging in using a two-factor code will also be
      present.
      
      Co-authored-by: default avatarFacundo Padula <facundo.padula@cedarcode.com>
      
      * feat: add possibility of deleting WebAuthn Credentials
      
      Co-authored-by: default avatarFacundo Padula <facundo.padula@cedarcode.com>
      
      * feat: disable WebAuthn when an Admin disables 2FA for a user
      
      Co-authored-by: default avatarFacundo Padula <facundo.padula@cedarcode.com>
      
      * feat: remove ability to disable TOTP leaving only WebAuthn as 2FA
      
      Following examples form other platforms like Github, we decided to make
      Webauthn 2FA secondary to 2FA with TOTP, so that we removed the
      possibility of removing TOTP authentication only, leaving users with
      just WEbAuthn as 2FA. Instead, users will have to click on 'Disable 2FA'
      in order to remove second factor auth.
      The reason for WebAuthn being secondary to TOPT is that in that way,
      users will still be able to log in using their code from their phone's
      application if they don't have their security keys with them – or maybe
      even lost them.
      
      * We had to change a little the flow for setting up TOTP, given that now
        it's possible to setting up again if you already had TOTP, in order to
        let users modify their authenticator app – given that now it's not
        possible for them to disable TOTP and set it up again with another
        authenticator app.
        So, basically, now instead of storing the new `otp_secret` in the
        user, we store it in the session until the process of set up is
        finished.
        This was because, as it was before, when users clicked on 'Edit' in
        the new two-factor methods lists page, but then went back without
        finishing the flow, their `otp_secret` had been changed therefore
        invalidating their previous authenticator app, making them unable to
        log in again using TOTP.
      
      Co-authored-by: default avatarFacundo Padula <facundo.padula@cedarcode.com>
      
      * refactor: fix eslint errors
      
      The PR build was failing given that linting returning some errors.
      This commit attempts to fix them.
      
      * refactor: normalize i18n translations
      
      The build was failing given that i18n translations files were not
      normalized.
      This commits fixes that.
      
      * refactor: avoid having the webauthn gem locked to a specific version
      
      * refactor: use symbols for routes without '/'
      
      * refactor: avoid sending webauthn disabled email when 2FA is disabled
      
      When an admins disable 2FA for users, we were sending two mails
      to them, one notifying that 2FA was disabled and the other to notify
      that WebAuthn was disabled.
      As the second one is redundant since the first email includes it, we can
      remove it and send just one email to users.
      
      * refactor: avoid creating new env variable for webauthn_origin config
      
      * refactor: improve flash error messages for webauthn pages
      
      Co-authored-by: default avatarFacundo Padula <facundo.padula@cedarcode.com>
      e8d41bc2
  28. Jul 14, 2020
  29. Jul 07, 2020
  30. Jun 09, 2020
  31. May 10, 2020
    • ThibG's avatar
      Remove confusing “You are already signed in.” flash message (#13547) · 45202f79
      ThibG authored
      When attempting to access the log-in page while already logged in,
      Devise's `require_no_authentication` kicks in and sets a flash
      message “You are already signed in.”
      
      In almost all cases, this also causes a redirect to /web, which
      does not display or clear flash messages, thus leaving the message
      to a potentially much later date, like for instance, accessing
      /preferences several minutes after being redirected to /web.
      45202f79
  32. Feb 16, 2020
  33. Jan 23, 2020
    • Eugen Rochko's avatar
      Fix password change/reset not immediately invalidating other sessions (#12928) · daf71573
      Eugen Rochko authored
      While making browser requests in the other sessions after a password
      change or reset does not allow you to be logged in and correctly
      invalidates the session making the request, sessions have API tokens
      associated with them, which can still be used until that session
      is invalidated.
      
      This is a security issue for accounts that were already compromised
      some other way because it makes it harder to throw out the hijacker.
      daf71573
  34. Dec 30, 2019
  35. Sep 24, 2019
  36. Sep 18, 2019
  37. Sep 15, 2019
Loading