Next generation 2-factor authentication and security hardening

Originally published at: https://nextcloud.com/blog/next-generation-2-factor-authentication-and-security-hardening/


Today, Nextcloud 15 has been made available. As there is so much new and improved in this release, we have dedicated separate blogs to each main area of improvement. This blog covers our work in the area of security hardening and new security capabilities.

Download now!

Next generation 2-factor authentication

Security continues to be a key concern for Nextcloud users. To improve the protection of Nextcloud servers, this release enables administrators to control and enforce two-factor authentication globally or on a group-by-group base. New are also one-time codes for system administrators, to be used when the 2nd factor is unavailable.

All users will be warned to generate their one-time codes as soon as possible and store them somewhere safe. Administrators have command-line control over 2FA, in case they or users are locked out of their account.

To lower the effort of using the second factor for secure authentication, notifications from devices already authenticated can be used as second factor. This way, a mobile device can approve authentication in a browser, or the desktop client can approve authentication on a phone. The user simply gets a notification and can approve it.

Receiving a notification on iPad
Receiving a notification on Android
Simply tap approve to log in

Further hardening of Nextcloud

To harden Nextcloud further, this release brings more strict CSP (Content Security Policy) rules providing even deeper protection from Cross-Site Scripting vulnerabilities. The third generation of our App tokens improves handling on external password change. This reduces the number of times users have to re-authorize their client applications as the clients can get re-authorized automatically, provided one of the users' logins is valid.
Manage app tokens in Nextcloud

Details on CSP and App Token V3

Our CSP no longer by default allows unsafe-eval. This blocks the javascript eval function. Developers can effectively no longer interpret text as instructions. you could do
eval('alert(1)')

And it would just work. Now it no longer does. This means app developers will have to update their app and keep this limitation in mind. But code injection attacks by a hacker become significantly harder with our stricter CSP.
Over the last 2 years, our App Token technology evolved from app tokens which were invalidated whenever the user changed their password (V1) to public key app tokens that would be updated on password change (V2). V3 is adapted to work with LDAP or other external authentication mechanisms. While we still can’t update app tokens when you change your LDAP password, upon the first login in the web or any client, all app tokens are updated.

1 Like

For a next generation 2FA implementation I would expect proper webauthn/fido2 support, rather than the now deprecated U2F standard which isn’t and will never be properly supported in Firefox (it’s even disabled by default and can be enabled only through about:config).

How it works ?
I mean for getting notification and accept them.

I am on NC 15.0.0 with two-factor auth enabled. But when i want to login in only have the 6 digits code to enter no notification.

I have the lastest update of the iOS nextcloud app