Remix.run Logo
▲ handplane 4 hours ago

While in theory, this adds at least some small layer of protection, I have doubts that it adds anything meaningful to stop a smart attacker.

The problem here is that everything is running as your user, so it's all the same security sphere.

You may be thinking, "But Bitwarden requires me to approve each key request". Problem is that if the attacker is already running as your user, which I'm assuming here because to steal your bare keys, they'd already need to be. This means they can also hit the approve button for you.

Ok, now you say "But it requires touchID!". Maybe that gets you just a little bit of protection, but...

The next idea is to just steal the decrypted key out of RAM. This requires a little bit of effort, because you generally can't attach to a sibling process without root on Linux with default configs. This will only delay things slightly. Attaching to your child is allowed, so all an attacker needs to do is replace your launch shortcut/service for Bitwarden with a thin wrapper that makes the attacker the parent process, and then they can just ptrace it and steal the decrypted key next startup. On Mac, where the ptrace path isn't viable due to disallowing ptrace of signed binaries by default, you could just replicate the Bitwarden GUI as a wrapper and steal the master password at startup.

If you really want to protect your keys from attacks like this, you need a real hardware device with OOB signaling.

▲D13Fd 40 minutes ago | parent | next [-]

It's defense-in-depth. Each hurdle you make an attacker jump over can filter some types of attackers. Yes, some might still get through, but that doesn't make it valueless.

> This means they can also hit the approve button for you. . . . Ok, now you say "But it requires touchID!". Maybe that gets you just a little bit of protection, but...

That's a pretty big leap. Systems like Mac OS are designed so that other apps can't easily click that Touch ID button for you. The vast majority of attackers are going to be filtered at this step. Beyond that, anything that "clicks that button for you" could only work when you're logged in - another hurdle - and will probably result in some visible screen activity even if it's "clicked" quickly.

When compared to simple plaintext SSH keys stored on disk, it's a night and day difference.

This is like saying "sure, you could wear a seatbelt, but it's not going to do anything for you if you drive your car off a cliff, so why wear it at all?"

▲macNchz 4 hours ago | parent | prev | next [-]

A lot of your caveats here assume some level of sophisticated attacker that has persistent access to the machine and is motivated to investigate when something doesn't work, rather than the extremely common case of a smash-and-grab credential stealer script that quickly scans through the system and tries to grab anything it can before being removed.

Even things that will not stand up to a motivated attacker still add value towards reducing the likelihood of a breach, by increasing friction for attackers that are simply grabbing at low-hanging fruit. A setup with a bit more friction is a locked door in a long hallway of unlocked doors. Yeah someone can get through it, but it's not going to be their highest priority. This is the case for almost anything security related: layers of imperfect protection are good in combination.

▲handplane 4 hours ago | parent | next [-]

I agree 100% here, and I had this argument running through my head as I wrote this comment. The problem is I think these assumptions only hold up for a very short time in today's world. Even unsophisticated attackers will have access to the sorts of methods involved here soon, if they don't already. I'm not up to date on the latest malware practices, but I would be surprised if they weren't already targeting popular credential managers like Bitwarden.

▲timcobb 3 hours ago | parent [-]

What is the intersection of unsophisticated attacker and enabling tools? That is, what is today's script kiddie? Is there a community around abliterated models that people run to h4ck?

▲handplane 2 hours ago | parent | next [-]

While I have no direct knowledge here, surely there must be. It takes approximately 20 min or less to set up a very capable ablated model on a local consumer-gaming-class GPU. It's not frontier levels right now, but it's still very capable, and with the pace things are going, current frontier power will probably be available in no more than 1-2 years locally.

▲esseph an hour ago | parent | prev [-]

This answers some of those questions both directly, and indirectly...

https://www.techbuzz.ai/articles/hundreds-of-artex-ai-hackin...

▲dns_snek an hour ago | parent | prev [-]

The article presumes that your attacker is more motivated than a simple smash-and-grab credential stealer.

If they are motivated then this advice doesn't really buy you much. If they aren't motivated then the advice is moot to begin with. Passphrase-protected keys on disk are perfectly adequate for defending against simple credential stealers.

▲Aurornis 4 hours ago | parent | prev | next [-]

> While in theory, this adds at least some small layer of protection, I have doubts that it adds anything meaningful to stop a smart attacker.

You’re not wrong, but for most of us the threat of a simple credential stealer is a million times more likely than being targeted by a dedicated, intelligent hacker.

In the most common compromise scenario, the attack comes along with some widely distributed software and is going for quantity of keys compromised via automated scripts, not precision extraction of one person’s keys through interactive exploration of their computer.

Adjust your security model if you’re in an important position at a big company or some other high value target.

For most of us, though, anything that defeats a common credential stealer is highly valuable.

▲stryan 4 hours ago | parent | prev | next [-]

I'm all aboard the Yubikey train[0] for securing SSH keys, but I'd imagine most SSH keys aren't being exfiltrated by smart attackers putting in the work to steal decrypted keys from RAM. Most SSH keys are being exfiltrated by scripts being run via curl | bash (or agents...) that quickly gather up every potentially useful user file they can find and upload it to a remote endpoint somewhere.

[0] I also use an SSH key in Bitwarden for lower priority concerns, but my main SSH keys that get automatically installed on remote systems and used for signing commits are stored via FIDO on Yubis.

▲lokar 4 hours ago | parent [-]

You could also setup the yubikey as a CA to sign short lived ssh keys.

▲what 3 hours ago | parent [-]

What benefit does this provide over just having the ssh key on the yubikey?

Also, pretty sure you can’t use the CA for GitHub without enterprise.

▲lokar 2 hours ago | parent [-]

More niche situations where you can't use the agent. You need to use it from somewhere you can't forward the agent, or you need to make too many calls (eg ssh to 10,000 machines).

▲breakwaterlabs 3 hours ago | parent | prev [-]

Just to note, it is not a given that "running as same user" implies "has control over all other user processes". Wayland for instance (famously) blocks that kind of attack.

It is certainly possible to enable authentication methods whereby two processes at the same privilege level cannot grab each other's secrets or tokens. Credential guard is one example, I am sure there are analogous implementations on Linux but I believe namespacing and SELinux attack this from different angles.

    The next idea is to just steal the decrypted key out of RAM.
It is also not a given that a userland process can do this.
▲handplane 2 hours ago | parent [-]

All of this is true, but would you notice if a malware swapped in a shim into the place where your Bitwarden startup is (user systemd, WM startup, etc), and all that shim did was spawn Bitwarden as a child process? You can generally ptrace a child process.

▲breakwaterlabs 30 minutes ago | parent [-]

This is a strong argument for doing software installations using superuser privileges and denying exec from user-writable locations.

Which is, in fact a relatively common posture.