Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Securing Chrome Native Message host

I'm developing an application using Chrome Native Messaging that starts through a Chrome Extension.

My question is: How can I ensure that host application is really the same supplied by me?

I need to ensure the authenticity the application called by extension. How do I get it if I don´t have permission to read registry or check if something was changed?

like image 910
Rodrigo Passos Avatar asked Apr 07 '15 19:04

Rodrigo Passos


People also ask

What is Chrome native host?

Native messaging is a Web-to-App communication mechanism supported in all modern browsers (Firefox, Chrome, Edge) to exchange UTF8-encoded JSON messages between a browser extension and a native host application.

What is Native messaging host?

The native app host sends and receives messages with extensions using standard input and standard output. Extensions that use native messaging are installed in Microsoft Edge similar to any other extension. However, native apps aren't installed or managed by Microsoft Edge.

What is Chrome native messaging EXE?

The ChromeNativeMessaging.exe enables communication between the UiPath Extension for Chrome and the UiPath Studio/Robot.


1 Answers

That is an excellent question, and my guess is the answer is "unfortunately, you can't".

It would be interesting to implement some sort of cryptographic hash like the ones Chrome uses to verify extension files, but that's not a very strong guarantee.

Consider (all of this hypothetical):

  • You can secure the registry entry / manifest pretty easily this way, but what about the file itself?
  • Suppose you pin a hash of the executable, then it becomes painful to update it (you'll have to update the extension too in sync). Can be resolved with some kind of public key signature though instead of a hash.
  • Suppose you pin the executable in the manifest. What about its data files? More importantly, what about the libraries a native app uses?

Securing a Chrome extension/app is easy, since the only "library"/runtime you rely on is Chrome itself (and you put trust into that). A native app can depend on many, many things on the system (like the already mentioned libraries), how do you keep track?

Anyway, this seems like an interesting thing to brainstorm. Take a look the Chrome bug tracker if there is already anything similar, if not - try to raise a feature request. Maybe try some Chromium-related mailing list to ask the devs.

like image 196
Xan Avatar answered Sep 23 '22 21:09

Xan