keepassxreboot / keepassxc-browser

KeePassXC Browser Extension
GNU General Public License v3.0
1.78k stars 188 forks source link

[Serious] Breaks browser styleseets for XML documents #2286

Closed benbucksch closed 4 months ago

benbucksch commented 4 months ago

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

  1. Open https://v1.ispdb.net/office365.com in Firefox (This URL returns XML with a Content-Type of "text/xml")

Debug info

KeePassXC - 2.7.7 KeePassXC-Browser - 1.9.1.1 Operating system: Linux Browser: Firefox 128.0 and earlier

benbucksch commented 4 months ago

I had first wrongly blamed the browser https://bugzilla.mozilla.org/show_bug.cgi?id=1906109 before finding out that it's this addon that breaks it.

varjolintu commented 4 months ago

Thanks. Found the reason. The extension does not check the content type before using content scripts. I made a fix where all XML files are ignored with the file extension type or checking the ContentType.

benbucksch commented 4 months ago

Thanks for the super fast response.

Can you use a whitelist (modify only HTML) instead of a blacklist (not XML), to avoid that other file types are broken?

droidmonkey commented 4 months ago

Other file types have style sheets?

varjolintu commented 4 months ago

Other file types have style sheets?

I think this depends on the browser. Some file types are shown inside an internal page that can also allow some styling. At least this seem to happen with Firefox.