Repository navigation
9.11.1
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
filterquery parameter: checked byfilterOperatorsBlacklistsince 9.11.0; - the
keysquery parameter: it is a projection, and since MongoDB 4.4 a projection holds aggregation expressions,$functionincluded.filterOperatorsBlacklistnow checks it like the filter, on collection and document requests; - the aggregation pipeline of a
PATCHrequest: the newupdatePipelineSecurityCheckerinterceptor runs it through the sameaggregationSecurityblacklists that guard the aggregations declared on collections. A$setholding$functionis refused with403, 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
-
$functionand$accumulatorinkeysare refused with403, as they are infiltersince 9.11.0. The samefilterOperatorsBlacklistconfiguration applies to both parameters:filterOperatorsBlacklist: blacklist: ["$where", "$function", "$accumulator"] enabled: true
-
PATCHwith an aggregation pipeline is checked againstaggregationSecurity: a pipeline with$function,$accumulatoror a blacklisted stage gets403. DisableupdatePipelineSecurityCheckeronly whereaggregationSecurityis disabled too:updatePipelineSecurityChecker: enabled: false