You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Will Currie (JIRA)" <ji...@apache.org> on 2017/10/24 06:39:00 UTC

[jira] [Commented] (SOLR-11512) Infinite parsing loop possible with edismax bq and local-params

    [ https://issues.apache.org/jira/browse/SOLR-11512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16216398#comment-16216398 ] 

Will Currie commented on SOLR-11512:
------------------------------------

Thanks for following up. I doubt the query I supplied makes any sense. I ended up accidentally triggering this loop whilst testing that xmlparser was (somewhat) disabled using the suggestion:
{noformat}
<queryParser name="xmlparser" class="solr.ExtendedDismaxQParserPlugin" />
{noformat}
When I tried the query "{!xmlparser v=DOCTYPE stuff}"" it got rewritten to edismax and spun on cpu. I was kinda surprised to find you can't disable the {! syntax.

> Infinite parsing loop possible with edismax bq and local-params
> ---------------------------------------------------------------
>
>                 Key: SOLR-11512
>                 URL: https://issues.apache.org/jira/browse/SOLR-11512
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: 7.1
>            Reporter: Will Currie
>            Priority: Minor
>         Attachments: SOLR-11512.patch
>
>
> The following query against the techproducts example puts solr into an infinite loop:
> {noformat}
> curl -g -v 'http://localhost:8983/solr/techproducts/select?q=*&defType=edismax&qq={!edismax+v=something}&bq={!edismax+v=$qq}
> {noformat}
> Problem doesn't depend on the collection, just an easy example. I guess I'd expect a failure with "Infinite Recursion detected parsing query ..." instead. So depending on the query config a user typing {!edismax v=whatever} into a search box can send a solr instance to 100% cpu.
> I can reproduce using TestExtendedDismaxParser by adding:
> {code}
>   @Test
>   public void loopsForever() throws Exception {
>     assertJQ(req("defType", "edismax", "q", "*", "qq", "{!edismax v=something}", "bq", "{!edismax v=$qq}"));
>   }
> {code}
> The code seems to hit QParser.checkRecurse() and try to fail but something sends it around for another try. Repeat.
> Given the complexity of the parsing code there may well be other examples. There's no way to disable the local params syntax is there? Question was asked in SOLR-4197.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org