News for hackers. Stuff that matters.
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by languagehacker on Thursday July 18, 2024 @02:43PM (#40998530)
I'd be curious whether there's any security concerns on this one. Could an attacker craft a message that gets access to execute commands into a client terminal?
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by qudat on Thursday July 18, 2024 @03:18PM (#40998846)
This is not sshd, this is a golang binary that uses the stdlib ssh lib. You would have to either a) figure out how to escape out of a golang binary, or b) if the go code executes shell commands with some user provided text, trying to shell inject something in there.
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by cwillu on Thursday July 18, 2024 @03:41PM (#40999023)
Or convince the ssh daemon to pass on terminal escape codes to another user.

https://nvd.nist.gov/vuln/detail/CVE-2021-33477

Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by quackduck on Thursday July 18, 2024 @04:24PM (#40999379)
whoa
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by raggi on Thursday July 18, 2024 @05:48PM (#41000090)
yup, not an extensive list, but further demonstrative:

  - terminal emulators are not security hardened clients against malicious actors
  - ssh lacks PKI and is inconvenient so users never do prekeying in practice, so it's TOFU / zero server assertion in most practical cases (i.e. easy to mitm)
  - ssh channel features are a constant concern, for server resources and for client features like agents, agents are easy to disable
  - most ssh implementations don't scale that well, it wasn't ever really a goal to do so
  - there are few tools for auditing and monitoring, unlike the common protocols/services/clients
fun for toys, but i wouldn't put credit card details in there, unlike some streamers started doing lately.
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by cwillu on Thursday July 18, 2024 @05:53PM (#41000118)
ssh definitely supports PKI, it's just not the standard workflow for individuals

     ssh-keygen (1):  

     ssh-keygen supports signing of keys to produce certificates that may be used for user or host authentication.
     Certificates consist of a public key, some identity information, zero or more principal (user or host) names and
     a set of options that are signed by a Certification Authority (CA) key.  Clients or servers may then trust only
     the CA key and verify its signature on a certificate rather than trusting many user/host keys.  Note that
     OpenSSH certificates are a different, and much simpler, format to the X.509 certificates used in ssl(8)
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by raggi on Thursday July 18, 2024 @05:58PM (#41000146)
I'm not talking about supporting public key cryptography, I'm talking about having a specific and usable deployment of a PKI. The closest thing SSH has is SSHFP, which depends on DNSSEC, which is according to many opinions, DOA.
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by password4321 on Thursday July 18, 2024 @09:07PM (#41001243)
TIL about PKIX-SSH, OpenSSH + X.509.

https://gitlab.com/secsh/pkixssh

http://tech.ciges.net/blog/openssh-with-x509-certificates-ho...

Right now I'd stick with something like Gravitational Teleport (overkill); Warpgate may become the perfect fit for this niche soon.

https://github.com/warp-tech/warpgate

It's also worth knowing about SSH clients that can use X.509 certificate keys as normal pre-shared keys with any SSH server, like PuttyCAC and built-in for macOS High Sierra and later.

https://www.idmanagement.gov/implement/scl-ssh/

Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by zie on Friday July 19, 2024 @12:23AM (#41001991)
OpenBAO and Hashicorp Vault also have built-in support for SSH certs: https://openbao.org/docs/secrets/ssh/signed-ssh-certificates...
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by anilakar on Friday July 19, 2024 @02:43AM (#41002578)
PKI, with I in bold quotation marks.

While it supports serial numbers, expiration dates and key revocation lists, it does not allow certificate chaining. That means whoever signs keys for end users has implicit access to the master key.

Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by freedomben on Thursday July 18, 2024 @02:53PM (#40998618)
Yeah, though SSH is already very mature at processing text, so it's a surprisingly good fit for a chat. I would also remember that any machine you SSH from is going to give the server some metadata like IP address, public keys (which aren't useful as creds but can be for tracking). Really fun little project though
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by tjoff on Thursday July 18, 2024 @03:17PM (#40998840)
SSH might be, but maybe not your terminal. Which the very least can possibly trick you using escape codes. Also, unless my memory fails me 'cat'ing an untrusted file isn't recommended for security reasons.

Additionally you should disable SSH forwarding. Relevant thread from the startup selling coffee over SSH: https://news.ycombinator.com/item?id=40227624

Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by phoyd on Thursday July 18, 2024 @05:12PM (#40999804)
I'm also interested. Setting up a passwordless SSH account for some public service sounds like a good way to give your machine away to North Korean hackers, because you forgot to set someting in /etc/sshd to "no".

Is there a usable description somewhere on how to do this safely?

Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by quackduck on Thursday July 18, 2024 @05:16PM (#40999834)
i'd be interested in seeing that. here its ok because it doesnt use sshd at all
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by queuebert on Friday July 19, 2024 @03:45PM (#41010336)
So it's using a new stack that hasn't been vetted like OpenSSH? I'd rather use OpenSSH + LibreSSL for this application.
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by fragmede on Friday July 19, 2024 @06:00AM (#41004339)
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by Tepix on Friday July 19, 2024 @05:58AM (#41004323)
You may not want the chat server owner to know which public ssh key you are using for privacy reasons.

Workaround: Specify another ssh keypair