[SERVER-57289] redact should not convert BSONArray into BSONObj Created: 11/May/21  Updated: 29/Oct/23  Resolved: 24/Jun/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.6, 4.4.11, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Irina Yatsenko (Inactive) Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-61846 Prevent redact from throwing BSONObje... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.2, v5.0, v4.4
Sprint: Security 2021-06-14, Security 2021-06-28
Participants:

 Description   

Wrapping a BSONArray object with redact changes its type to BSONObj which means it gets logged in

{0:"value0", 1:"value1", ...}

format rather than ["value0", "value1", ...] format. This makes it a bit harder to parse the logs and might create inconsistencies in format between redacted and non-redacted arrays or depending on whether the arrays are nested.



 Comments   
Comment by Githook User [ 15/Dec/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-57289 redact should not convert BSONArray into BSONObj

(cherry picked from commit 3b8806bef0f65df11e4d49786bf962ce0dd6b4dd)
Branch: v4.4
https://github.com/mongodb/mongo/commit/0507c5804f9402625654d054b9d7bd7eadabdb42

Comment by Githook User [ 15/Dec/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-57289 redact should not convert BSONArray into BSONObj

(cherry picked from commit 3b8806bef0f65df11e4d49786bf962ce0dd6b4dd)
Branch: v5.0
https://github.com/mongodb/mongo/commit/d1f74cceb696a33b2486b04e569152de4922b2de

Comment by Haley Connelly [ 15/Dec/21 ]

These backports are needed to backport https://jira.mongodb.org/browse/SERVER-61846 to  4.4

Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 24/Jun/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-57289 redact should not convert BSONArray into BSONObj
Branch: master
https://github.com/mongodb/mongo/commit/3b8806bef0f65df11e4d49786bf962ce0dd6b4dd

Comment by Mark Benvenuto [ 02/Jun/21 ]

This code: https://github.com/mongodb/mongo/blob/2da60c28f0996433e61e80ac5cfdde621244837e/src/mongo/bson/bsonobj.cpp#L147-L150 should be updated to use BSONArrayBuilder for processing array entries.

Generated at Thu Feb 08 05:41:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.