Skip to content

9.11.1

Choose a tag to compare

@github-actions github-actions released this 15 Oct 07:27
· 464 commits to master since this release
17b4921

Release 9.11.1

Overview

A security release that completes 9.11.0: no request can make MongoDB run JavaScript, from any of the three places where a client writes operators. 9.11.0 covered the filter query parameter. This release covers the other two, the keys query parameter and the aggregation pipeline of a PATCH request. Upgrade recommended for every deployment that serves untrusted clients. No data migration is needed.

Security

keys and PATCH pipelines cannot run JavaScript on the server

$where, $function and $accumulator run JavaScript on the MongoDB server. A client can write operators that MongoDB evaluates in three places:

  • the filter query parameter: checked by filterOperatorsBlacklist since 9.11.0;
  • the keys query parameter: it is a projection, and since MongoDB 4.4 a projection holds aggregation expressions, $function included. filterOperatorsBlacklist now checks it like the filter, on collection and document requests;
  • the aggregation pipeline of a PATCH request: the new updatePipelineSecurityChecker interceptor runs it through the same aggregationSecurity blacklists that guard the aggregations declared on collections. A $set holding $function is refused with 403, and so is a blacklisted stage such as $lookup.

Both run with the default configuration. The defaults are documented in restheart-default-config.yml and restheart-default-config-no-mongodb.yml.

Docs: Security Hardening.

Behavior Changes

  • $function and $accumulator in keys are refused with 403, as they are in filter since 9.11.0. The same filterOperatorsBlacklist configuration applies to both parameters:

    filterOperatorsBlacklist:
      blacklist: ["$where", "$function", "$accumulator"]
      enabled: true
  • PATCH with an aggregation pipeline is checked against aggregationSecurity: a pipeline with $function, $accumulator or a blacklisted stage gets 403. Disable updatePipelineSecurityChecker only where aggregationSecurity is disabled too:

    updatePipelineSecurityChecker:
      enabled: false