question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authenticate connection to editors

See original GitHub issue

This plugin is potentially-dangerous to use on any multiuser machine (or on any machine where untrusted code may be running, either as your user or as nother user) since it uses a fixed default loopback port (one reserved by IANA for another company at that… 😢) and has no way of authenticating editor-servers with the browser. A malicious attacker with access to loopback could read or If you’re interested in how other extensions have addressed this problem, you might enjoy 1Password’s blog on the subject from 2015.

A simple option for non-Windows systems would be to look into supporting a unix domain socket instead of a loopback socket; at least that would give a modicum of protection against other users on the same machine (although no protection against malicious software running as the same user). I somehow doubt that Fx57 has an API for websockets over a stream-mode domain socket, but you never know.

A more complicated option would be strong authentication; on first-run the browser extension could generate a TLS keypair and require users to confirm a fingerprint in the editor before using websockets; the rest of the session could just use wss:// instead of ws://. This would probably be difficult for editor plugins that aren’t written in a language that allows easy temporary addition to a TLS trust store and I don’t even know that there would be a safe way to generate an RSA or ECDSA keypair from an extension (that sounds like a lot of webcrypto and is there even ASN.1 in webcrypto?), but it’d be pretty secure.

The way vimperator implemented this historically, of course, was to make a securely-named temporary file on disk and pass its name to the editor through exec args; this is much stronger protection (since the file was readable by only the current user and the name was hard to predict, which in turn makes it hard for an attacker to find). I understand that there’s no longer a process management API, but if there’s a way to copy the textarea to a file, you might still be able to exchange text data through a securely-named user-visible-only file and just pass the file name through websockets?

I’m not sure how likely an attack like this is, but there should probably at least be a warning that if you’re on a multi-user machine and the other users are technically savvy and prone to mischief that this plugin broadcasts all of your edits in plaintext to them.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
fregantecommented, Apr 24, 2021

The more I think about this, the less I think this is useful. An authentication here would only be useful here if:

  • a malicious actor can open a port on localhost before your editor does, AND
  • the field you’re about to activate has sensitive information in it

Both situations are rather rare so adding complexity here doesn’t seem worth it.

If the field you’re about to activate has sensitive information:

  1. Clear it
  2. Establish the connection
  3. Paste the content in the editor that opened

This only takes a couple of seconds and ensures that nobody else can read the content.

1reaction
subnutcommented, Feb 23, 2021

@stephane-chazelas

Can’t dbus be used for that?

NO

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage data source settings and permissions (Power Query)
Set Excel Services authentication · Select Data > Queries & Connections. · Select the Queries tab to display the queries in the workbook....
Read more >
Enabling or editing the authentication function - TechDocs
This test is conducted against the directory data service instance that is running on the Control Center host. It cannot be used to...
Read more >
An API for accessing Public Key Credentials - Level 3 - W3C
The user agent mediates access to authenticators and their public key credentials in order to preserve user privacy. Authenticators are ...
Read more >
Connection Editor - Linx
Connection Editor. The connection string specifies the configuration values required to connect to the database. The content of the connection string ...
Read more >
Code editor with key authentication - Ask Different
I am having to access a website that will only allow access using a key, passwords are off limits. I have had a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found