keepassxreboot / keepassxc-browser

KeePassXC Browser Extension
GNU General Public License v3.0
1.72k stars 178 forks source link

Extensions blocks loading of Mikrotik router web admin #381

Closed brozkeff closed 4 years ago

brozkeff commented 5 years ago

Expected Behavior

Plugin should not be deactivated and work OK on all websites

Current Behavior

Mikrotik router user interface (WebFig v6.38.5 (stable)) on an internal IP (192.168.x.x) is imcompatible with KeepassXC-Browser plugin on Firefox 64.0 64bit Linux Mint. Page stalls then Firefox displays on the top info that this plugin slows down page loading, by "temporarily disabling" this plugin for this page everything loads OK.

Possible Solution

Find why structure of WebFig webpage configuring Mikrotik routers confuses plugin that it creates some heavy load or loop leading to browser considering plugin non-responsive, offering to kill it for that website

Steps to Reproduce (for bugs)

  1. Install KeePassXC-Browser v1.3.2 to Firefox and activate it
  2. Open WebFig UI of Mikrotik router

Debug info

KeePassXC - 2.3.4 KeePassXC-Browser - 1.3.2 Operating system: Linux 64bit (Mint 18.3 Xfce)

varjolintu commented 5 years ago

Try to catch the loop from Tools -> Web Developer -> Performance. I don't have an access to such routers.

varjolintu commented 5 years ago

With normal debugging I suggest you try to see what MutationObserver does in keepassxc-browser.js.

brozkeff commented 5 years ago

I don't understand how MutationObserver works as I am not a developer, if you supply me with a guide what to do I could try it.

Anyway with the Web developer -> Performance monitoring I took this recording:

https://www.dropbox.com/sh/71fsk9tckthoh3b/AABnVwOY3-rCp2Ezd9KUk1w8a?dl=0

Full CPU load for more than two minutes, over 8 MB of json log and no end to this process. Screenshot and the compressed perf log are on the dropbox link. It seems to me that all the tabs of WebFig are in fact permanently loaded but hidden from view, and that the webpage changes all the time with bandwidth used, data transferred etc and each change of the whole huge page triggers some event in the plugin and this goes on indefinitely.

varjolintu commented 5 years ago

It's definitely the MutationObserver. (https://perf-html.io/ is good site for analyzing these performance logs). There's some polling script on the page that creates or modifies the content constantly which causes this. Do you use KeePassXC-Browser for the router page? If not, you could add the URL to Site Preferences in the extension settings and choose Disable all features from the dropdown.

brozkeff commented 5 years ago

Even disabling all features for the particular IP address did not help.

varjolintu commented 5 years ago

Could you try to save the page to a local zipped file with the scripts and test if the same thing still happens? Then I could test it myself.

brozkeff commented 5 years ago

Saving it in Firefox via File-Save clearly does not save all dynamic content so the loaded file does not basically do anything anymore. I am not sure if in the code are not some sensitive info, I found there the company name, IP addresses which I tried to search&replace with some dummy data but anyway I am not willing to upload the file and link it publicly here if something could still leak from the save. I have sent this code to you privately to your PM address.

varjolintu commented 5 years ago

That package didn't work as intended.

varjolintu commented 5 years ago

Is this issue still valid?