<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:23:57 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>[SERVER-10747] $where operator can block all other operations</title>
                <link>https://jira.mongodb.org/browse/SERVER-10747</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Malicious $where clauses for eg: containing an infinite loop, can cause all other operations to hang for 1 minute (as per &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3&quot; title=&quot;implement inf. loop protection in spider monkey&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3&quot;&gt;&lt;del&gt;SERVER-3&lt;/del&gt;&lt;/a&gt; timeout on JS execution).&lt;/p&gt;

&lt;p&gt;While the guard functionality that terminates the JS execution works, it&apos;s unacceptable for mongo to be unresponsive to all other operations during this interval. Also, the documentation states that, as part of the JS improvements in 2.4, mongo can handle multiple JS operations concurrently. &lt;/p&gt;

&lt;p&gt;Steps to reproduce:&lt;br/&gt;
1. Run a find query with the following filter on any collection:&lt;br/&gt;
   { &quot;$where&quot;: &quot;function() { while(true) {} }&quot; }&lt;br/&gt;
2. While this is running, try running another query against the same mongo instance (both queries can be against the same or different databases), this will block until the query in 1. is terminated by the server.&lt;/p&gt;

&lt;p&gt;Attached is a python script (testcase.py) that demonstrates this using the python driver. &lt;/p&gt;

&lt;p&gt;First, run the setup script: &lt;br/&gt;
&lt;tt&gt;python testsetup.py&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Then, run 1 instance of the script providing a command line argument like so:&lt;br/&gt;
&lt;tt&gt;python testcase.py hang&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Concurrently run another instance of the script without a command line arg:&lt;br/&gt;
&lt;tt&gt;python testcase.py&lt;/tt&gt;&lt;/p&gt;

</description>
                <environment>Operating System(s): Ubuntu 64bit Linux, Mac OS X 10.8.4&lt;br/&gt;
MongoDB version(s): 2.4.5, 2.4.6&lt;br/&gt;
Both in standalone and replica set configuration&lt;br/&gt;
Drivers used: node.js - 1.2.12, python - 2.6.2&lt;br/&gt;
</environment>
        <key id="89200">SERVER-10747</key>
            <summary>$where operator can block all other operations</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-execution">Backlog - Query Execution</assignee>
                                    <reporter username="bhangm">Shubhang Mani</reporter>
                        <labels>
                            <label>query-44-grooming</label>
                    </labels>
                <created>Tue, 10 Sep 2013 14:41:05 +0000</created>
                <updated>Tue, 6 Dec 2022 05:17:54 +0000</updated>
                                                                            <component>Concurrency</component>
                                        <votes>1</votes>
                                    <watches>17</watches>
                                                                                                                <comments>
                            <comment id="430379" author="matt.kangas@10gen.com" created="Tue, 24 Sep 2013 15:04:10 +0000"  >&lt;p&gt;We&apos;ve determined that the root cause is an interaction between locks that the journaling system takes and this javascript operation that doesn&apos;t yield. We also have determined that it is &quot;a bad query&quot;, in the sense that a malicious user has to authenticate successfully before using this method. It is not something an unauthenticated attacker can exploit.&lt;/p&gt;</comment>
                            <comment id="423055" author="angshuman.bagchi@10gen.com" created="Wed, 11 Sep 2013 22:23:12 +0000"  >&lt;p&gt;Hey Shubhang, &lt;/p&gt;

&lt;p&gt;After reproducing this, it looks like a bug and hence I have moved this to the Core Server project where server bugs are addressed. &lt;/p&gt;

&lt;p&gt;Regards, Angshuman&lt;/p&gt;</comment>
                            <comment id="422132" author="angshuman.bagchi@10gen.com" created="Tue, 10 Sep 2013 20:23:12 +0000"  >&lt;p&gt;Hey Shubhang, &lt;/p&gt;

&lt;p&gt;Thanks for the test scripts. I was able to replicate the issue on 2.4.5 on Mac OS X 10.8.4 and are having an internal discussion about this. &lt;/p&gt;

&lt;p&gt;Angshuman&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="33152">SERVER-5326</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="312165">SERVER-25829</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="30951" name="testcase.py" size="352" author="bhangm" created="Tue, 10 Sep 2013 14:41:05 +0000"/>
                            <attachment id="30952" name="testsetup.py" size="222" author="bhangm" created="Tue, 10 Sep 2013 14:41:05 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25125"><![CDATA[Query Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 10 Sep 2013 20:23:12 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        10 years, 21 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            10 years, 21 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>angshuman.bagchi@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-query-execution</customfieldvalue>
            <customfieldvalue>matt.kangas</customfieldvalue>
            <customfieldvalue>bhangm</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmh0n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr2dav:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5030</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1. Run a find query with the following filter on any collection:&lt;br/&gt;
{ &quot;$where&quot;: &quot;function() { while(true) {} }&quot; }&lt;br/&gt;
2. While this is running, try running another query against the same mongo instance (both queries can be against the same or different databases), this will block until the query in 1. is terminated by the server.&lt;/p&gt;
</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrlkuf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>