<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:16:27 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CDRIVER-2824] Client metadata is invalid JSON</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2824</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;It appears that libmongoc does no sanitization of (at least) the &lt;tt&gt;platform&lt;/tt&gt; field when building client metadata. A log of the swift driver connecting to mongod reveals the following invalid JSON:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ driver: { name: &quot;mongoc&quot;, version: &quot;1.11.0&quot; }, os: { type: &quot;Darwin&quot;, name: &quot;macOS&quot;, version: &quot;17.4.0&quot;, architecture: &quot;x86_64&quot; }, platform: &quot;cfg=0x00d68265 posix=200112 stdc=201112 CC=clang 9.1.0 (clang-902.0.39.2) CFLAGS=&quot;&quot; LDFLAGS=&quot;&quot;&quot; }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</description>
                <environment></environment>
        <key id="603508">CDRIVER-2824</key>
            <summary>Client metadata is invalid JSON</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13202">Works as Designed</resolution>
                                        <assignee username="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="matt.broadstone@mongodb.com">Matt Broadstone</reporter>
                        <labels>
                    </labels>
                <created>Wed, 12 Sep 2018 19:37:41 +0000</created>
                <updated>Fri, 27 Oct 2023 13:14:13 +0000</updated>
                            <resolved>Thu, 13 Sep 2018 18:43:39 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2002262" author="jesse" created="Thu, 13 Sep 2018 18:43:39 +0000"  >&lt;p&gt;Including BSON string values that have quotes in them is perfectly valid driver behavior; the best fix for this is if the server properly escapes JSON strings it dumps to the logs.&lt;/p&gt;</comment>
                            <comment id="2001199" author="jeff.yemin" created="Wed, 12 Sep 2018 20:52:21 +0000"  >&lt;p&gt;Linked to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-16620&quot; title=&quot;escape double quotes \&amp;quot; when printing strings to log&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-16620&quot;&gt;&lt;del&gt;SERVER-16620&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The C driver could work around this by not including double quotes in BSON strings in client metadata, but the root cause is the server logs, I suspect.&lt;/p&gt;</comment>
                            <comment id="2001187" author="jmikola@gmail.com" created="Wed, 12 Sep 2018 20:43:12 +0000"  >&lt;p&gt;Handshake data is provided in BSON (see: &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/mongodb-handshake/handshake.rst#connection-handshake&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;spec&lt;/a&gt;), so is it the responsibility of libmongoc (or any driver) to escape characters in fields? I wonder if this is instead an issue the tools parsing this data on the server side.&lt;/p&gt;

&lt;p&gt;AFAIK, this data isn&apos;t stored in any server collection and gets dumped to log files. I&apos;m not sure if it&apos;s accessible by other means, but if the tools reading it are scraping it from mongod logs, then perhaps the server needs to escape it to ensure it only prints well-formed JSON to its logs.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="175646">SERVER-16620</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htya9j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>