HN Simulatornew | past | comments | lists | submit | invokestatic's commentslogin

So if an attacker compromises your private keys, they’re already on your computer. If they’re on your computer, what stops them from connecting to your server from your computer? It would have the exact same TCP options, same IP address, same everything.

If I were an attacker that had an agent or RAT on your PC and got your private key, I’d first try to connect to your server on my computer. That would fail, but the very next thing I would do is use my RAT or agent to connect to the server via your own PC, because I would assume you had some sort of IP filtering in place.

If you store your keys in a trusted enclave like a Yubikey, TPM, etc it stops this cold (configured correctly).


So if an attacker compromises your private keys, they’re already on your computer.

They could be but I would not automatically assume that. Many stealers upload keys and do not install a RAT and there is no guarantee the RAT will function even if they manage to install one. If we want to go down every what if path I could make everyone want to power off their data-center and go home. If I showed everyone what SSH can do without any RAT's many would uninstall it. Involves multiplexing and one phishing victim to bypass MFA, HSM's, vaults, bastions, and does not leave a trace by design. No need to sneak past anti-virus.

Most orgs will not buy or implement an HSM so I am offering a soft middle ground that may suffice for some and may not even remotely be an option for others. Some orgs have no choice but to buy an HSM. Been there, done that. It can be a massive daunting task depending on what checkboxes are not yet checked and what requirements B2B financial customers are demanding. One of them required 6 different colored keys that get distributed to different org leaders and have to be put in the HSM to make any changes. They put the fear of diety into everyone about losing keys. One was lost. Thats when you find out that crazy expensive device is just hype.

Oh and ask me how many HSM keys I have seen pasted into Slack.


In security threat modeling, you only factor in things that you control when determining exploitability or risk. So for instance, when you say “a RAT might not work right” or “attackers don’t always use RATs” those aren’t things that you control, those are things that an attacker controls.

One of the principles of threat modeling is that you must assume an attacker is working actively to maximize their odds of success. Saying something like “well it would be annoying for an attacker to do this” is practically universally rejected by cybersecurity professionals especially in the age of AI agents.

I disagree that I am posing a bunch of “what-ifs”. The threat I am modeling here is how companies get compromised all of the time. Living off the land attacks as I’ve described is how companies large and small get hacked.

Furthermore, you do not need an expensive HSM. Most computers nowadays have secure enclaves (TPM) that can be used for this purpose.


Run a poll on HN some time and ask how many people are using an HSM. Out of the 17k visitors (or so on a given day) I would be surprised if it is over 500. That's ~17k not counting bots. Counting bots it's closer to 50k.

I suspect what you will find is that a majority of people are using SSH keys and a very relaxed firewall policy. A smaller number are using a bastion with some form of MFA + LDAP (if that) but it's all moot if the bastion or data-center servers allow multiplexing thus allowing log-less bypass of MFA, LDAP, HSM, etc...

A growing number are at least using a corporate VPN however more often than not those devices have a myriad of 0-days and are very poorly engineered over priced proprietary garbage full of state back-doors so at least buy the hardware made in your country so it may be your intelligence agencies that have access and a small sub-set of the MSS PRC.


Every Apple computer has a built-in hardware enclave. Just download Secretive, or you can install my macOS app, KeyMux, from the App Store, which supports SSH key agent protocol, GPG agent protocol, and PKCS#11. Or use the native command-line method discussed in the article.

That's not very economical. A YubiKey sets me back €50 (already twice as expensive as a smartcard). A MacBook Air sets me back €1299 and requires a €99 dongle for USB.

Used MacBook prices are more reasonable. But I agree, if you don’t want a Mac, you can just buy a YubiKey-ish thingy.

Exactly. Also, used and security sensitive don't play well together. If buying used is an acceptable risk, do you really need that secure enclave?

You generally don’t need to buy a dedicated HSM. TPMs are built into a lot of modern motherboards nowadays. A lot of folks are probably unaware they have access to one.

Going against the grain here but I think this is decent security engineering from Apple. They patched the highest exploitable things immediately (Safari, Mail, etc). The residual risk is using these command line tools while someone is actively MITMing your connection.

How often are people “git clone”ing a repo without browsing to the GitHub site first? Safari would throw up certificate errors. And also, TLS on Git doesn’t even authenticate the code you’re downloading is legitimate at all. It could be modified by the Git host or a supply chain attack, etc.

Yea, it’s not great. Ideally the risk is reduced to zero from patching. But a lot of the times we accept some level of cybersecurity risk out of practicality. This is why we have responsible disclosure windows lasting months. It takes a while to do proper release engineering and testing for something like a whole OS update.


I really don't understand your justification.

One of the certificates literally has a private key of 4; it's as compromised as it could quite possibly be. This is not a "one of the intermediates have a weak and possibly crackable key" or "a bunch of incorrect certs were issued but the issuance was patched".

To a MITM attacker, git clones can be easily distinguished from visiting in Safari. You could choose to only poison git clones; without poisoning anything else.

Heck, you can probably build an exploit kit in a hour; camp out around a Starbucks or McDonalds with open wifi, and start compromising git clones and deliver malicious payloads.


An attacker absolutely cannot “easily distinguish” between a git clone and visiting the website and swap the certificate.

To know whether a request is a git client or web browser, an attacker needs to be able to inspect the contents of the web request (to check the user agent or whatever). If the site is using a legitimate certificate, the attacker has no way to inspect the contents because it is encrypted with a key they do not control.

If an attacker used their own, eMudhra-signed certificate, it would throw the certificate error in Safari.


Yes, I'm assuming network MITM and DPI.

The whole point of TLS and certificates is to counter network MITM attacks.

Browsers and clients emit a lot of fingerprints, you can probably figure it out loosely from the TLS initialisation.


So let’s take a step back and look at this threat model.

1) An attacker is MITMing your connection. This is already not easily exploitable by most threat actors short of being on a public Wi-Fi network, otherwise you are likely at the nation-state level attacker at this point.

2) An attacker knows exactly which Git repo you’re about to clone and has prepared a malicious version (noting they can’t snoop on your encrypted web traffic).

3) An attacker has developed a way to differentiate between Git over HTTPS and Safari, by using a side channel “fingerprinting” method that works with your exact versions of git and macOS.

4) You don’t pin the git clone to a particular hash or signature.

This is already a very low level of exploitability. All of these things need to be satisfied for the attack you’re describing to work.

Now let’s look at a more practical attack that exists regardless of if you have the patch from Apple.

1) A maintainer of an open source project you use has their GitHub account compromised due to credential stuffing and commits a malicious version.

2) You don’t pin the git clone to a particular hash or signature.

This attack is significantly more exploitable and has happened over and over again in supply chain attacks.

But look at the commonality: in both, no certificate pinning or signature checking was done. If you follow best practices, this stops both attacks dead cold.

This is the security engineering. It’s not just checking boxes. It’s evaluating risks.


> This is the security engineering. It’s not just checking boxes. It’s evaluating risks.

This is absolutely not security engineering. This is nit picking a specific attack factor and trying to argue that it’s impractical. I suspect you are wrong, but it doesn’t matter, because you are ignoring the broader class of attacks and focusing on one specific example. The class issue is that on a Mac, you cannot trust any terminal-based application to honor the CRL. This means that any site accessed from a terminal based application cannot be trusted. There are a billion ways to exploit that.

This is not good security engineering from Apple. There is no way to justify this. Humans make mistakes, and that’s just life, but we shouldn’t pretend that this is an acceptable state or an acceptable response.


Some questions from a netsec novice:

1) Why wouldn't you have a SSOT for certs and instead rely on patching different apps individually?

2) Doesn't this violate defense in depth? Exploits for a widely disclosed issue now have turnaround activation within hours, not weeks. Not patching all surface areas and actively disclosing as such seems very much like drawing up a map for a jailbroken LLM to gin up a rudimentary attack.

3) Also doesn't this violate the principle of secure by default especially for power users who are more likely to be the ones with higher privileges across distributed systems?


Historically, stuff like openssl and cli command tools used flat files like /etc/ssl/certs.pem.

Browsers came along and they wanted to maintain their own cert store because operating system flat files were often out of date.

Operating systems grew their own stores because they wanted some kind of registry that was more integrated with the rest of their ecosystem.

Nobody coordinated. CLI tools and unix libraries don't care about browsers or O/S registries, operating systems have requirements so that they can't use the flat files, everyone screams about stuff like systemd turning unix into windows.

And it will continue to proliferate. System management tools often ship their own certs since the O/S certs can be out of date and untrustworthy and may not be able to talk to AWS before you bootstrap the management tool and update the system certs because people still run ancient shit like RHEL5. This is more or less the same reason browsers ship their own as well. I've made the decision to ship an embedded cert store in a product before, and nothing has fundamentally changed that would cause me to rethink that decision (even though for people who have an up-to-date O/S it is strictly additional cost that they now have to track a cert store in another product--but you have to build for the lowest common denominator).


1) I would argue that different trust stores are a carryover macOS’s Unix heritage. Having multiple roots of trust is actually very common. For instance Firefox maintains their own root of trust from the system, it’s called NSS. Different programming languages like Java and Rust also often use different roots. It’s not amazing, and has holes, but a lot of it comes down to historical reasons and a certain level of risk acceptance.

2) Yes, but actually, this is exactly why we have defense in depth. This is a temporary measure while a permanent patch is coming. Defense in depth means a single hole does not result in compromise. I would argue that this situation with Apple demonstrates defense in depth actually working as intended. If this was the permanent solution, and no further patch was coming from Apple, then yes, it would violate defense in depth.

3) Related to above, yes. But it’s not permanent.


Having OpenSSL present at all on macOS is a compatibility measure. It's been considered "deprecated" since macOS 10.7 (2011); developers have been urged to use native alternatives for macOS software, e.g.

https://developer.apple.com/library/archive/documentation/Se...


> How often are people “git clone”ing a repo without browsing to the GitHub site first?

People are going to be running pull or push much more than clone, and will often be running those without opening the origin on Safari.


> How often are people “git clone”ing a repo without browsing to the GitHub site first?

What’s the point of this question? Would going to GitHub.com in my browser somehow protect me from a MITM attack here?


Yeah… it was patched in the source 3 days ago. Check the linked GHSA.


The python mermaidx library works for this, which works well for generating documentation with embedded diagrams as part of CI/CD but the layout/rendering can sometimes be very wonky. For instance I will have a bunch of connections crossing over each other instead of neatly arranged to avoid it. Changing the layout settings does not fix it so sometimes I will just export it from mmdc and embed a png.


It’s part of the MSVC x64 ABI, not a part of the kernel ABI. The kernel and user mode (Win32) APIs all use C linkage so vtables are not relevant and the ABI is a convention of the compiler not the OS. Practically speaking though if your software runs on Windows it will probably use the MSVC ABI.


Last time I checked, software compiled with both Cygwin and MSYS2 internally uses SysV calling convention, only switching to WINAPI when calling, well, Win32 API.


It is more complicated than that. MSYS2 isn't just Cygwin. It has different environments.

MSYS environment is just Cygwin and it uses Itanium IIRC for C and C++ non-Win32 calls since it emulates POSIX. If it links with Windows C runtime they use __cdecl. Win32 API calls always use __stdcall convention / ABI.

However, Mingw environments (Mingw64, UCRT, CLANG etc.) are intended for native Windows development, hence, they use normal MSVC __cdecl ABI for C library calls and internal function calls too. Win32 calls are again __stdcall.

Unlike C, for C++ all MSYS environments use Itanium ABI since they link with GNU libstdc++ or Clang libc++. I think it is possible to use MSVC C++ ABI with Clang but it could be complicated since it requires recompilation of at least libc++.


TL;DR: You can mix and match calling conventions as long as you actually track what piece of (compiled) software uses what convention.


Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: