Skip to content

9.10.0

Choose a tag to compare

@github-actions github-actions released this 05 Oct 13:06
· 480 commits to master since this release
d5a0699

Release 9.10.0

Overview

A minor release about what happens before authentication. The brute force guard now counts every failed attempt and refuses a blocked source whatever credentials it sends; no request reads the database before it is authenticated. Upgrading from 9.9.2 needs no data migration and no configuration change. It is a minor release, not a patch, because the order of some interceptors changed: if you write plugins, read For plugin developers below.

Improvements

Brute force guard

  • A blocked source is refused before authentication. It gets 429 Too Many Requests whatever credentials it sends. Until 9.9.2 the answer of a blocked source depended on the credentials: 401 for wrong ones, 429 for the right ones, so the block could be used to test passwords.
  • The block holds while the attack goes on. A blocked request counts as a failed attempt too: the source is released only after it stays quiet for a whole 10 seconds window. Until 9.9.2 the window drained during the block, and max-failed-attempts requests went through every 10 seconds.
  • Every request without an authenticated account counts, whatever its status. Until 9.9.2 only a 401 did, so wrong credentials on a collection that does not exist, answered 404, were never counted.
  • At DEBUG, each counted failure is logged with its source and the count in the window: Failed auth counted: histogram=… count=….

Docs: Brute Force Attack Guard.

Nothing reads the database before authentication

  • The properties of the db and of the collection are now read after authentication. Whether a db or a collection exists is information, and the query that answers it no longer runs for a request without valid credentials.
  • An error set by an interceptor at REQUEST_BEFORE_AUTH is sent at once. Until 9.9.2 it was held back until after authentication.

Bug Fixes

  • The brute force guard lost failed attempts under concurrency: requests arriving together were counted as one. Each failure is now one entry of the sliding window, and none is lost.
  • The brute force guard forgot every source each 100 failed requests overall, so a max-failed-attempts of 100 or more was never reached, and under a distributed attack a lower one could be missed too. Only the sources with an empty window are forgotten now.

Behavior Changes

  • Brute force guard. A blocked source gets 429 also with the right credentials, until it stays quiet for 10 seconds. Requests with wrong or missing credentials are counted on any path, existing or not.
  • 404 and 401. A request without valid credentials for a db or a collection that does not exist gets 401, as before; the difference is that the database is not queried for it.

For plugin developers

Check your interceptors against these changes.

  • dbPropsInjector and collectionPropsInjector moved from REQUEST_BEFORE_AUTH to REQUEST_AFTER_AUTH, with priority Integer.MIN_VALUE and Integer.MIN_VALUE + 1. An interceptor that reads MongoRequest.getDbProps() or getCollectionProps() must run at REQUEST_AFTER_AUTH with a priority value higher than those. At REQUEST_BEFORE_AUTH the properties are no longer there.
  • Each interceptor is resolved right before it is handled, in priority order, so resolve() sees what the interceptors before it attached to the request. Until 9.9.2 every resolve() of an intercept point ran first, then every handle(). An interceptor whose resolve() relied on the request as it was before the others handled it should be checked.
  • vectorScanInterceptor moved from priority Integer.MIN_VALUE to Integer.MIN_VALUE + 10, still at REQUEST_AFTER_AUTH. The priorities from Integer.MIN_VALUE + 2 to + 9 are free for interceptors that declare an aggregation for the request: $vectorScan is recognized in the stages they add.
  • An error set at REQUEST_BEFORE_AUTH ends the request there: authentication does not run, and the interceptors at REQUEST_AFTER_FAILED_AUTH are not called for it.