Skip to content

[stable32] fix(SecurityMiddleware): return header to distinguish error type#58881

Merged
susnux merged 1 commit intostable32from
backport/58869/stable32
Mar 12, 2026
Merged

[stable32] fix(SecurityMiddleware): return header to distinguish error type#58881
susnux merged 1 commit intostable32from
backport/58869/stable32

Conversation

@backportbot
Copy link

@backportbot backportbot bot commented Mar 12, 2026

Backport of PR #58869

Currently we return a 403 (Forbidden) when the password confirmation
failed - which itself seems to be inappropriate as its basically a login
failing so a 401 (not authorized) is more appropriate.

This is especially a problem because APIs might return 403 internally
for good reason (e.g. user missing permission) but 401 would not be a
problem.

But as this is a breaking change so my solution to be able to
distinguish API error from password confirmation error is:

Add a header inside the response that marks failed password confirmation
`X-NC-Auth-NotConfirmed`.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@backportbot backportbot bot requested a review from a team as a code owner March 12, 2026 08:54
@backportbot backportbot bot requested review from Altahrim, ArtificialOwl, CarlSchwan, icewind1991, provokateurin and susnux and removed request for a team March 12, 2026 08:54
@backportbot backportbot bot added bug 3. to review Waiting for reviews labels Mar 12, 2026
@backportbot backportbot bot added this to the Nextcloud 32.0.7 milestone Mar 12, 2026
@susnux susnux merged commit 025f789 into stable32 Mar 12, 2026
217 of 227 checks passed
@susnux susnux deleted the backport/58869/stable32 branch March 12, 2026 14:24
@skjnldsv skjnldsv mentioned this pull request Mar 18, 2026
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants