keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
20.72k stars 1.43k forks source link

Unable to connect to KeepassXC-Browser "Access to the specified native messaging host is forbidden" #7128

Open Bohaska opened 2 years ago

Bohaska commented 2 years ago

Overview

I am unable to connect my KeepassXC browser extension with my KeepassXC app. I have tried all of the tips listed at https://github.com/keepassxreboot/keepassxc/issues/1559 but I still haven't fixed my problem.

Key details: I use macOS 12. I use Vivaldi

Error: keepass.js:1029 Failed to connect: Access to the specified native messaging host is forbidden

Steps to Reproduce

  1. Download the KeepassXC browser extension directly from Github
  2. Download the KeepassXC app
  3. Enable browser integration
  4. Try to connect

Expected Behavior

KeepassXC and the browser extension connects

Actual Behavior

They do not connect to each other

Context

I have checked whether the native messaging script file is there, it is, and the path is pointing to the correct location { "allowed_origins": [ "chrome-extension://pdffhmdngciaglkoonimfcmckehcpafo/", "chrome-extension://oboonakemofpalcgghocfoadofidjkkk/" ], "description": "KeePassXC integration with native messaging support", "name": "org.keepassxc.keepassxc_browser", "path": "/Applications/KeePassXC.app/Contents/MacOS/keepassxc-proxy", "type": "stdio" }

When I debug it in developer console, the console says this keepass.js:1059 Connecting to native messaging host org.keepassxc.keepassxc_browser keepass.js:1029 Failed to connect: Access to the specified native messaging host is forbidden. keepass.js:1142 Error 9: Key exchange was not successful.

I have also tried setting the proxy location to the keepassXC app's internal proxy app manually but didn't do anything

The extension is allowed to "communicate with cooperating native applications".

KeePassXC - Version 2.6.6 Revision: 386b79a

Qt 5.15.2 Debugging mode is disabled.

Operating system: macOS 12.0 CPU architecture: x86_64 Kernel: darwin 21.1.0

Enabled extensions:

Cryptographic libraries:

Operating System: macOS Browser: Vivaldi

droidmonkey commented 2 years ago

Pulling out key details: macOS 12, Vivaldi

keepass.js:1029 Failed to connect: Access to the specified native messaging host is forbidden

Bohaska commented 2 years ago

I have added your key details into the overview

varjolintu commented 2 years ago

What happens if you try to start /Applications/KeePassXC.app/Contents/MacOS/keepassxc-proxy manually from Terminal/iTerm?

Bohaska commented 2 years ago

What happens if you try to start /Applications/KeePassXC.app/Contents/MacOS/keepassxc-proxy manually from Terminal/iTerm?

Nothing. When I start it while both KeepassXC and the extension is running, and reload the extension, no visible changes happen.

varjolintu commented 2 years ago

Ok. Then I suggest you take another look at ~/Library/Application Support/Vivaldi/NativeMessagingHosts/ and check if you have permissions to the script file and folder.

Bohaska commented 2 years ago

Ok. Then I suggest you take another look at ~/Library/Application Support/Vivaldi/NativeMessagingHosts/ and check if you have permissions to the script file and folder.

I do not fully understand what you mean by "permissions". I have checked that KeepassXC is able to create the relevant files there, if this is what you meant.

varjolintu commented 2 years ago

Right click the script file in that folder, select Get Info and you have a Sharing & Permissions section at the bottom.

Is Vivaldi able to access your files, if you try to upload something for example?

Bohaska commented 2 years ago

Right click the script file in that folder, select Get Info and you have a Sharing & Permissions section at the bottom.

Is Vivaldi able to access your files, if you try to upload something for example?

I can read and write to the file. All other users (everyone) can only read. After granting Vivaldi Full Disk Access and restarting it, the problem still isn't fixed.

Sorry for the delay, I was sleeping

varjolintu commented 2 years ago

Does it help if you use Disk Utility and try to repair (First Aid) for your partition? It should fix any permissions that are not correctly set. This sounds like Vivaldi doesn't have access to its own preferences, which sounds really odd. Does any other browser work?

Bohaska commented 2 years ago

Does it help if you use Disk Utility and try to repair (First Aid) for your partition? It should fix any permissions that are not correctly set. This sounds like Vivaldi doesn't have access to its own preferences, which sounds really odd. Does any other browser work?

Chrome is also not working, with the same error. Disk Utility did not fix the problem.

varjolintu commented 2 years ago

There's clearly something wrong with your OS installation or the system. One thing you could try is to open the JSON script file from Vivaldi when you are uploading or selecting a file. Is that allowed?

Bohaska commented 2 years ago

I can upload the file from Vivaldi (I tested it with Github)