@@ -100,14 +100,49 @@ impact depends on the data and capabilities available to the actor:
100100 way to recover the password. However, password hashes must still be protected
101101 against offline password-guessing attacks.
102102
103- Limit on password length
104- ^^^^^^^^^^^^^^^^^^^^^^^^
105-
106- Nextcloud uses the bcrypt algorithm, and thus for security and performance
107- reasons, e.g. Denial of Service as CPU demand increases exponentially, it only
108- verifies the first 72 characters of passwords. This applies to all passwords
109- that you use in Nextcloud: user passwords, passwords on link shares, and
110- passwords on external shares.
103+ .. _password_length_limits :
104+
105+ Password Length Limits
106+ ^^^^^^^^^^^^^^^^^^^^^^
107+
108+ Nextcloud accepts account passwords of up to 469 bytes through its standard
109+ account-creation, password-change, and password-reset interfaces. This is the
110+ maximum account-password length enforced by these interfaces. Because the
111+ limit is measured in bytes, a password containing multibyte characters (such as
112+ emojis or characters from non-Latin scripts) may reach the limit with fewer than
113+ 469 characters.
114+
115+ Administrators can use the :doc: `Password Policy app </configuration_user/user_password_policy >`
116+ to configure requirements such as a minimum password length and other
117+ complexity rules. External user backends may impose additional or different
118+ requirements.
119+
120+ The following implementation details do not reduce the general password limits,
121+ but they are relevant when selecting a password policy:
122+
123+ Token Encryption Performance
124+ When ``auth.storeCryptedPassword `` is enabled and an account password is
125+ longer than 214 bytes, Nextcloud uses a larger RSA key when creating
126+ authentication-token records. This increases token-generation overhead, but
127+ does not prevent passwords between 214 and 469 bytes from being accepted.
128+ The 214-byte threshold is therefore a performance consideration, not a
129+ password-length limit.
130+
131+ Administrators who expect very long or one-time passwords to be used may
132+ consider disabling ``auth.storeCryptedPassword `` to avoid this overhead,
133+ subject to the functional consequences described above.
134+
135+ Algorithmic Truncation (Bcrypt)
136+ Nextcloud prefers Argon2id for one-way password hashing when it is supported
137+ by PHP, with Argon2i and bcrypt as fallbacks. Bcrypt considers only the first
138+ 72 bytes of its input. Therefore, if bcrypt is selected, input after the
139+ first 72 bytes does not contribute to password verification. This is a
140+ bcrypt-specific behavior, not a general 72-byte limit imposed by Nextcloud.
141+
142+ Passwords protecting public link and mail shares use the same one-way password
143+ hasher and are subject to the applicable share-password policy. They are not
144+ stored in authentication-token records, so the encryption-related performance
145+ considerations above do not apply.
111146
112147Operating system
113148----------------
0 commit comments