[SERVER-67316] LDAP CNAME resolution truncates CNAME incorrectly Created: 15/Jun/22  Updated: 29/Oct/23  Resolved: 17/Jun/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc11, 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Mark Benvenuto Assignee: Mark Benvenuto
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0
Sprint: Security 2022-06-27
Participants:
Case:

 Description   

dn_expand returns the length of the compressed string, not the length of the uncompressed string. It fills the buffer with a null-terminated string and so we should construct a string using the non-length constructor for std::string.

See https://github.com/mongodb/mongo/blob/f495bdead326a06a76f8a980e44092deb096a21d/src/mongo/util/dns_query_posix-impl.h#L191
References:
https://www.man7.org/linux/man-pages/man3/dn_expand.3.html



 Comments   
Comment by Githook User [ 17/Jun/22 ]

Author:

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

Message: SERVER-67316 LDAP CNAME resolution truncates CNAME incorrectly

(cherry picked from commit c82753a67670b3cc43787925c1de265806c5e5be)
Branch: v6.0
https://github.com/mongodb/mongo/commit/ad83c9f408ab37cd1bdd773a5879050172d005b7

Comment by Githook User [ 17/Jun/22 ]

Author:

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

Message: SERVER-67316 LDAP CNAME resolution truncates CNAME incorrectly

(cherry picked from commit 702f06893aa9dbee862024c78ccf967142199178)
Branch: v6.0
https://github.com/10gen/mongo-enterprise-modules/commit/fca5f65d5e6b4cf975ecee609efef272b48a65a1

Comment by Githook User [ 17/Jun/22 ]

Author:

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

Message: SERVER-67316 LDAP CNAME resolution truncates CNAME incorrectly
Branch: master
https://github.com/mongodb/mongo/commit/c82753a67670b3cc43787925c1de265806c5e5be

Comment by Githook User [ 17/Jun/22 ]

Author:

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

Message: SERVER-67316 LDAP CNAME resolution truncates CNAME incorrectly
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/702f06893aa9dbee862024c78ccf967142199178

Generated at Thu Feb 08 06:07:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.