Skip to content

Limit password validation attempts per account across OData and local login. - #2250

Merged
kavics merged 8 commits into
developfrom
fix/07-changepassword-limit
Nov 5, 2026
Merged

kavics merged 8 commits into
developfrom
fix/07-changepassword-limit

Conversation

@kavics

@kavics kavics commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Limit password validation attempts per account across OData and local login.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Custom ILocalAuthenticationUsers providers bypass the shared account-attempt budget, allowing password checks after the budget is exhausted with only per-IP protection remaining.

1 open issue
What changed in this PR

This PR adds a per-account password-check budget shared by OData credential validation and local login, with response timing and generic failures to reduce account enumeration.

Changes:

  • Adds a configurable, per-instance sliding-window limiter shared across password-validation paths.
  • Introduces randomized response delays and generic account-limit failures while retaining local IP throttling.
  • Expands authentication tests and documents configuration, timing, and deployment limits.
File Description
src/​Tests/​WebAppTests/​ServicesTests.cs Updates expected authentication service registrations.
src/​Tests/​SenseNet.Services.Core.Tests/​PasswordValidationTimingTests.cs Tests timing, cancellation, and credential outcomes.
src/​Tests/​SenseNet.Services.Core.Tests/​PasswordValidationTests.cs Tests concurrency, expiration, aliases, and shared budgets.
src/​Tests/​SenseNet.Services.Core.Tests/​LoginTests.cs Adapts tests to asynchronous validation and generic failures.
src/​Tests/​SenseNet.Services.Core.Tests/​AuthenticationTests.cs Registers validation services and awaits credential checks.
src/​Tests/​SenseNet.ODataTests/​ODataPasswordValidationTests.cs Tests generic failures and anonymous account throttling.
src/​Tests/​SenseNet.ODataTests/​ODataImportTests.cs Isolates reference-visibility testing from password restrictions.
src/​Tests/​SenseNet.IntegrationTests/​TestCases/​LocalAuthenticationTestCases.cs Uses the registered authentication lock.
src/​Tests/​SenseNet.IntegrationTests/​InMemTests/​InMemLocalAuthenticationTests.cs Removes the custom in-memory test lock.
src/​Tests/​SenseNet.IntegrationTests.MsSql/​MsSqlTests/​MsSqlLocalAuthenticationTests.cs Uses the simplified shared integration test.
src/​Tests/​SenseNet.Authentication.Local.Tests/​LocalPasswordValidationTests.cs Tests shared budgets, generic failures, and instance isolation.
src/​Tests/​SenseNet.Authentication.Local.Tests/​LocalPasswordTimingTests.cs Verifies response delays release authentication locks.
src/​Tests/​SenseNet.Authentication.Local.Tests/​LocalAuthenticationTests.cs Extends pipeline setup and updates throttling expectations.
src/​Storage/​Configuration/​IdentityManagement.cs Clarifies ambiguous-name behavior in documentation.
src/​Services.Core/​ServicesExtensions.cs Binds options and registers password-validation services.
src/​Services.Core/​Operations/​IdentityOperations.cs Applies asynchronous timing, throttling, and generic failures.
src/​Services.Core/​Authentication/​PasswordValidationTiming.cs Adds randomized credential-response timing.
src/​Services.Core/​Authentication/​PasswordValidationThrottledException.cs Defines throttling errors with retry timing.
src/​Services.Core/​Authentication/​PasswordValidationOptions.cs Defines the configurable account limit.
src/​Services.Core/​Authentication/​PasswordValidationLimiter.cs Implements atomic sliding-window attempt tracking.
src/​Services.Core/​Authentication/​AuthenticationExtensions.cs Registers and validates shared limiter services.
src/​OData/​ODataMiddleware.cs Maps uncaught throttling exceptions to HTTP 429.
src/​OData/​ODataException.cs Adds the HTTP 429 exception mapping.
src/​Authentication.Local/​RepositoryLocalUsers.cs Reserves shared attempts before password checks.
src/​Authentication.Local/​LocalAuthenticationOptions.cs Documents the shared account-budget setting.
src/​Authentication.Local/​LocalAuthenticationMiddleware.cs Returns generic failures for account throttling.
src/​Authentication.Local/​LocalAuthenticationFlows.cs Adds login timing and updates password validation.
src/​Authentication.Local/​LocalAuthenticationExtensions.cs Connects local configuration to the shared limiter.
docs/​local-authentication.md Documents budgets, timing, configuration, and caller migration.

Review effort: Balanced

@kavics
kavics requested a review from VargaJoe November 5, 2026 07:22
@kavics
kavics added this pull request to the merge queue Nov 5, 2026
Merged via the queue into develop with commit 91be9c5 Nov 5, 2026
7 checks passed
@kavics
kavics deleted the fix/07-changepassword-limit branch November 5, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants