4

I have upgrade version and during Magento security scan I got this error. I have removed old Jquery and added v.1.12.1

I replaced it in all page.xml. When I tried to check Jquery version of my store by running this from the console of browser

console.log(jQuery.fn.jquery);

I am getting result 1.12.0

I have scanned all file and not able to find 12.1.0 not sure from where scan getting it.

  • 1
    have you checked in the head tag, if the new version is already added? It might be that your website is using an external jquery as well – fmsthird May 15 at 6:46
  • Yes. I have scanned all files. And I am not sure if external Jquery is there but i checked console for all JS. Apart from that i also use console.log(jQuery.fn.jquery); to check which jquery is loading. – Kul May 15 at 6:58
  • 1
    console.log(jQuery.fn.jquery); will check the version of the first jquery in the head tag. that's really strange – fmsthird May 15 at 7:06
  • 1
    A good way to check for more detailed info is to turn of js aggregation in magento then check your developer window on your browser. For Safari it is the resources tab. This will show all the included files that are loaded or tried to load. If you find it then it's a matter of removing it without crashing the site or parts of it such as checkout. – DraganAscii May 16 at 18:54
  • @DragonAscii I have checked in console as well but there is not 1.12.0 version – Kul Jun 3 at 16:40
1
+200

I have found jQuery versions hidden in the following places while updating our client's sites.

  1. Codebase (phtml/xml files)
  2. Backend Config HEAD/Footer html areas
  3. CMS Blocks
  4. Modules / JS Libraries loading their own version of jQuery
  5. Being dynamically injection after the sites loaded via javascript somewhere

First thing would be to check if its within the backend header/footer script inputs in system config

Then if that failed I would, if possible, disable merged javascript as it will allow us to identify where it's coming from better.

Then using dev tools search function within the drawer, search for strings related to your jQuery instance (usually version number works), eg 1.12.0 or jQuery:

You should be able to identify now the filename/path that the jQuery is loading from and whether it's embedded within a JS library or packaged with a module.

If you can't manually find where it's being injection from with the filename and path. You can try searching all the files in your Magento install with grep, replacing the jQuery string with the js file that jQuery is contained in or even just the jQuery version number could work

  • If server SSH into it
  • grep -rl "jQuery.1.12.0.min.js" /path/to/magento/install

If you still can't find it within the files, you could try to check CMS static blocks/pages with SQL

SELECT * FROM cms_block WHERE content LIKE '%jQuery.1.12.0.min.js%';

SELECT * FROM cms_page WHERE content LIKE '%jQuery.1.12.0.min.js%';

  • Nice explanation. I will try and let you know. – Kul Jun 6 at 6:16
  • no luck for me. – Kul Jun 9 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.