SERVER-135353ClosedFixed

Heap use-after-free reading a write command's sort pattern from the plan cache

h2. Summary The per-statement {{sort}} field of the {{update}} and {{bulkWrite}} commands is declared as IDL type {{{}object{}}}, which is an unowned {{BSONObj}} view into the wire message buffer. The sort is threaded through the planner into {{{}MergeSortStats::sortPattern{}}}, which the plan cache retains in its debug info. Once the originating command completes its message buffer is freed, leaving the cached entry holding a dangling {{{}BSONObj{}}}. A later {{$planCacheStats}} aggregation

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix
9.1.0-rc09.1.0-rc10258.3.169.0.78.0.377.0.48
Components
Server components related to this issue

No components specified.

Labels
Tags and classification

No labels assigned.