561 points · by stablemap · 8y ago · 248 comments
I wonder if this was used to extract some private keys?
https://twitter.com/svblxyz/status/969220402768736258 https://twitter.com/Manawyrm/status/969230542578348033
They are running the good old php shell of "<%= system(%_REQUEST['cmd']) %>". As root. As a security company.
This entire company is just blowing my mind at the moment. What's next, are they running their services on a notebook in the office?
For situations like this where a fiasco just keeps getting worse, each step its own facepalm.
* Asking users to generate private keys on the issuer's server
* Storing those private keys
* Emailing those private keys
* Sending that email completely in the clear
* Running unsanitized user input on their server
* as root
Well, their CEO's linked-in profile doesn't really sound like a security company.
> Email Marketing Digital Marketing Google Analytics Google Webmaster Tools Market Analysis Marketing PPC SEM SEO Sales Security Social Media Marketing Web Analytics Affiliate Marketing Google Adwords Management E-commerce Lead Generation Online Marketing Online Advertising SaaS Marketing Strategy Strategic Partnerships Cloud Computing New Business Development Business Strategy Start-ups Web Development CRM Social Media Product Marketing Solution Selling Strategy Channel Partners Channel Sales Business Alliances Business Development Leadership Social Networking Network Security Hardware Product Management B2B Professional Services GTM Partner Program Development Internet Security Google B2B Marketing Sales Operations
Saying that, that quote sounds way too long to not be BS.
system('openssl req -config /prod/prod-config.cnf -subj "/CN={$DOMAIN}" ....'
And whoever wrote that function assumed someone else had sanitized DOMAIN.It looks like a lot more understandable of a mistake when framed like that.
PHP's system() manpage: http://php.net/manual/en/function.system.php
[red box]
Warning
When allowing user-supplied data to be passed to this function, use escapeshellarg() or escapeshellcmd() to ensure that users cannot trick the system into executing arbitrary commands.
system(3): http://man7.org/linux/man-pages/man3/system.3.html Any user input that is employed as part of command should be carefully sanitized, to ensure that unexpected shell commands or command options are not executed. Such risks are especially grave when using system() from a privileged program.
This is a canonical mistake that's used as a mistake example in textbooks.I had a similar thought. My thought was: "HOLY SHIT!"
;-)
https://www.trustico.com/ssltools/create/csr-pem/create-a-ne...
Apparently they decided to keep a copy of the private key.
Edit: Looks like they are having problems atm. A copy can be found at
https://web.archive.org/web/20180217071027/https://www.trust...
Perhaps they’re passing this command to a secured container? I shouldn’t make excuses for them, but passing root commands to the shell seems too far out there.
You haven't been in software too long, have ya? /s
Glibness aside (and I meant the above as a joke, not a personal attack), this is distressingly common to the point of being near-universal in some areas of our industry.
That would indicate they were concerned about shell injection while writing the code. But if that were true, why would they skip the much simpler step of sanitizing/escaping the input?
This would still raise my eyebrows, since root inside a container is still something you should avoid unless absolutely necessary (especially if they aren't using user namespaces). Just because containers add some newer security features to regular processes doesn't mean you should forget the security features (POSIX DAC) that were there in the first place.
It's called the Pwnie Awards.
StartSSL used it, for example, but also allowed you to hand them a CSR of your own making. Although they of course ignored almost everything in the CSR apart from the public key (which is probably a good idea).
(1) IIRC you could even have a smartcard generate the key, at least in theory.
So you could put some other public key in there, add a bogus signature that wouldn't verify and they'd issue certificates for a key you never even controlled.
The bad security implications for that scenario are a bit subtle, and situational, but CAs are supposed to be checking that the CSR is properly signed, that's only a long way down the list because StartCom/ WoSign had so many other serious problems.
The problem is, people who don't understand the issue will prefer a solution that doesn't require installing some software.
Any of them can capture the generated key.
It’s kind of crazy how little we know about these important institutions. Credit reporting agencies are another example of complete incompetence in a presumed-sensible organization.
Especially once money changes hands, there ought to be a lot more terms in the contract to specify good behavior. You need backup when you discover something is run by 6-year-olds.
But, presumably, Trustco generated the public and private keys for the customers, signed the certificates, and handed the whole mess to the customers. I imagine some customers would even pay a bit more to not have to bother learning to generate a keypair and signing request themselves.
The thing I don't understand is how the CEO thought things would likely work out to his advantage. He must have realized that the person holding all of the cards didn't want to cooperate, and decided to try and bully that person into acting against Trustco's customers. To make such a colossal misjudgement makes me curious what else this CEO has done at previous companies.
EDIT: From Trustico's account
> We believe the orders placed via our Symantec account were at risk and were poorly managed. We have been questioning Symantec without response as to concerning items for about a year. Symantec simply ignored our concerns and appeared to bury them under the next issue that arose... We were also a victim whereby Symantec mis-issued SSL Certificates owned by us, subsequently we were asked to keep the matter quiet, under a confidentially notice.
https://groups.google.com/d/msg/mozilla.dev.security.policy/...
Seems like suddenly revoking 23k of their customer's certs with only 24 hours notice is just shooting themselves in the foot.
Maybe they decided preparing CSR is too hard for their clients :/
The idea that the company would store the private keys, however, is even more troubling.
It seems that a lot of businesses and people feel that making things "easier and more convenient" takes priority over best security practices. For example, we can't support client side TLS cert authentication (in addition to a username and password) because customers won't be able to generate the CSR or know how to import the certificate into their client. Instead, let's use SMS or email based two factor authentication.
I can't figure out why the Trustico CEO emailed the private keys to DigiCert. It doesn't make sense.
From my reading of the available data, it would explain why not all of Trustico clients needed their certificates revoked. Some of them will have generated the keys locally, not using Trustico's onlike tool.
You can run arbitrary shell commands as root from their webserver.
Welcome to the future of computers where security comes secondary to extra profits and marketing.
It's either secure or it isn't. Fun fact; Europe's ePrivacy law is coming next year which enforces all communication to be secure.
Link to Directive please?
(The reason I ask is that news reporting on EU law in English is extremely unreliable, and it's best to go to primary sources)
I-scoop[0] explains it well. Do some digging in the documents[1] and you'll get the idea where it's heading to.
"Respect for the privacy of one’s communications is an essential dimension of this right, applying both to natural and legal persons. Confidentiality of electronic communications ensures that information exchanged between parties and the external elements of such communication, including when the information has been sent, from where, to whom, is not to be revealed to anyone other than to the parties involved in a communication. The principle of confidentiality should apply to current and future means of communication, including calls, internet access, instant messaging applications, e-mail, internet phone calls and personal messaging provided through social media." [1](page 6, article 7)
> (The reason I ask is that news reporting on EU law in English is extremely unreliable, and it's best to go to primary sources)
Completely agreed, it's a complete jungle of information and the source documents are hard to digest.
[0] https://www.i-scoop.eu/gdpr/eu-eprivacy-regulation/#The_cons... [1] http://data.consilium.europa.eu/doc/document/ST-15333-2017-I...
I am not saying I plan to break this law: I'm a big supporter of encrypting everything and I was in compliance with this law before this law existed. I think that this law is a big positive step for privacy in the EU.
I am saying that the claims that this EU law will have massive international effects are overblown. There are five other continents with major businesses and only the businesses which operate in the EU have any reason to care about EU laws which are enforceable only in the EU.
EDIT: I accidentally a continent.
This statement is wholly incorrect. HTTP is not generally secure.
> for publishing
When I publish something I do not intend for third parties to interfere with the delivery of what I publish.
> and has the added advantage of being cacheable by proxies
If you trust your proxy, you can still have cached data at your proxy. If you don't trust your proxy, then why are you proxying through it?
It would not prevent anyone from examining that content in flight, or altering it. It would allow any such alteration to be identified.
It is possible to offer various levels of assurance on unencrypted communications.
Mind: I'm describing a possible world, not the one most of us happen to live in. Unless, say, you're retrieving Debian package repositories over FTP or HTTP transport, and rely on the package signature rather than HTTPS for integrity.
See for example: https://unix.stackexchange.com/q/90227
(Malicious ad injection + HTTP = mobile billing)
The only SSL cert you should ever pay money for is $90/year for an EV SSL cert for an ecommerce/product purchasing website where people are entering credit card details. The big friendly green bar GUI element, for non-technical users, is worth it.
> The only SSL cert you should ever pay money for...
You can still "pay" Lets Encrypt, my understanding is that as a non-profit they rely primarily on sponsorship and donations. If you are using them in production for a product making money one could at least consider throwing them a donation. If no one contributes we don't get to have nice things like LetsEncrypt!
HN discussion: https://news.ycombinator.com/item?id=16485801
Well, they also weren't actually running a CA business either.
a) in a sense maybe they thought they were disclosing their private key to a their CA so in a sense it didn't really matter because their CA could issue certificates for their domain anyway (... ignoring certificate transparency/other external verification)
[... we know this is not true and it's mostly people don't know/don't care/it doesn't matter what they are doing in the scheme of things]
If they had done that they wouldn't have had access to any private keys in the first place, so all their subsequent mistakes in mishandling those keys would have been impossible to make.
As for the whole "arbitrary Remote Code Execution as root" on their web server, that's got a pretty obvious solution: sanitize your data inputs, and don't run your web application server as root.
How is it that these guys have managed to stay in business for this long?
If you'd like to have more verification for your certificate you need a extended validation certificate (which often costs money). These certificates also include your (company) name and the issuer verifies whether it's correct or not.
Basic certificate issuers don't judge over domain names or content, they just verify domain ownership.
It is complete and total bullshit that DV SSL certs still cost money (thanks LetsEncrypt), anywhere from $9/year to $80/year.
The companies that rely on selling DV validated SSL certs for their business model are polishing the brass doorknobs on the Titanic. It's all going down. Just a question of when.
In the past, the bar used to be much higher.
Whether a lower bar is a good idea or not I will leave to other more informed folk.
For identify validation, you'd need to buy an EV or OV cert. But for most organizations, particularly if your domain IS your identity, a domain-validated cert is absolutely fine.
The author has a fundamental misunderstanding of the situation [1]. Trustico's awful decisions regarding
a) storing customers private keys and
b) improperly handling key material
Have no bearing whatsoever on EV certs, which verify the legal entities that run websites. This is like saying Trustico is bad, therefore HTTPS is bad.
[1] Assuming this is what the author said - the site is in plain HTTP so integrity isn't guaranteed.
More than one CA has been shown to be extremely lacking in trustworthiness and that trust is important. I'm OK with the centralised model but there needs to be a bit more visibility of the CA process.
...That, and given the massive failures we've seen coming out of the CA world recently, I question whether those audits are actually worth anything.
Cloudflare uses Comodo for their SSL. They could use some other cert authority, but they chose to use Comodo. This is on topic, in a general sense of CAs and trust. It bears repeating: Bad actors tend to flock together.
https://fightthefuture.org/article/the-new-era-of-corporate-...
..and the CTO who made that decision later backed down and said he wouldn't make that same decision again. O_o
I really feel like the biggest reason they're still in business is that very few alternatives offer anything really competitive.
There are like ten thousand other options...
Also, they were amongst the only ones to offer ECDSA certificates IIRC.
Cloudflare detailed a little bit about this in this and other blog posts:
Having multiple issuers is important for us as each CA, at some point in time, has operational issues. Additionally, as you've seen with Symantec, browsers take action to distrust certain issuers/roots.
When either of these scenarios happens, our customers don't care if it's the third-party that's down—they expect fast and reliable issuance from us (Cloudflare).
I'm simply pointing out that when you have incompetent and crooked people in tech, they often run in packs.
You might argue that altruism has no place in business but I disagree. When the CEO of Comodo launched his attack on Let's Encrypt, Cloudflare had opportunity to cut all ties with them. There's plenty of other CAs they could work with. They chose to ignore that scandal, and that matters.
You're assuming that random people on the internet are going to collectively be more secure than CAs, which is obviously not the case.
Imagine you get an email signed by the IRS, and which is trusted by people A1, A2 and A3, who are trusted by people B1, B2, and B3 ... who are trusted by Z1, Z2, and Z3, who are fully trusted by you.
Should be reliable, right?
But while Z1, Z2 and Z3 may keep all OPSEC rules, you have no guarantee that they verified that Y1, Y2 and Y3 did. And even if they did, you have no guarantee that ...
And even if you did, can you guarantee that no one there got any malware, which signed off on a bunch of fake certs?
We have natural experiments showing that WoT, at least as implemented, doesn't scale. I hate that humans don't seem to be able to make it work, but that's reality for you.
Yes, I am a security pessimist.
I think a real solution would be something like a multi-root, score-based system (e.g. if the U.S. government, Underwriters Laboratories & ICANN all state that I'm talking to www.google.com/172.217.13.238, then I honestly probably am) — but I'm worried that it'd be way too complex for normal people.
CAA records help with this, where available, but still leave some things to be desired.
[1] This is the sort of lazy mistake I would make, because I'm not a security expert.
TLS, however, is an "evolution" of SSL and many, many people still use this nomenclature. It doesn't "reek of amateur hour and shallow knowledge", it's just a holdover from the past.
We all know and understand what others are referring to when they say "SSL". It's like when I tell the girlfriend I'm going to go on a "bike ride". She understands that I mean I'm going for a ride on my Harley, a motorcycle, and not an actual bicycle.
Or last weekend, when a friend asked me, "Hey, could you move your car so <other person> can get out?". While I could have stood there arguing with him or correcting him (since my car was actually at home, in my driveway), I instead went out and moved my truck so that the other guest could leave.
This excessive, unwarranted pedantry is annoying as hell. You may be "technically correct" but you make everyone around you dislike you.
It's not quite as bad as calling JS Java or vice versa, it's more like saying Java and then saying Java 1.2 and Java 1.8 and so forth.
Let's Encrypt shut down their new test interface because of a security flaw they found. If this was in a production service, this would have been about as bad of a security flaw as is possible in a PKI system.
Let's not get all high and mighty assuming Let's Encrypt won't get compromised; they probably will. We should be planning for how to deal with that.
If somebody is doing a distributed chat/social system, I would use ssh if I were them.
By ssh I don't mean execution commands but rather encryption/authentication framework.
There are some well known trade-offs, namely that having everyone manually verify fingerprints on initial connect and again on any server change is a large burden.
I don't particularly want to have to go into my bank's local office and verify in person the fingerprint is correct each time they need to rotate a secret.
If this isn't what you meant, that we should use TOFU vs Trusted third party, please do expand.
For banks, it could work quite well. Most other people and organizations aren't that lucky, though.
Only if users never replace their keys, which puts them at significant risk in the event of a key compromise.
CAs have proven again and again to be ridiculously insecure, and the problem is that there is no penalty for their mistakes.
So just remove them all, after a warning period: Let's Encrypt is enough.
Or if they want to stay in business and be trusted by browsers, then require them to put up at least $100k in cash in escrow for each certificate they sign, which is forfeit if there's evidence that any compromise of that specific certificate, due to their fault, has or may have happened, with at least half of the money being distributed to whoever provides the evidence first.
No. I love Let's Encrypt, but we can't put all our eggs in a single basket like that.
Now, if we could somehow foster multiple non-profit organizations like Let's Encrypt, but run under the aegis of different boards and sponsors, I'd be 100% for this idea.
It's very odd that companies for whom CAs business is quite literally a money printing operation can't be bothered to do the relatively minimal maintenance and care required for a trustworthy CA. A bizarre and unexpected failure of the market.
The consumers are, partially, buying a product they can't see: The security operations of the vendor.
Given the consumer has imperfect information, it is exceptionally profitable for a supplier to just not invest in security. The downside being the risk of compromise.
A market set up this way entirely predicts low-cost suppliers. With no way for consumers to introspect security routines, two vendors will appear to simply differ in price. The outcome is rather obvious.
It's like a building that needs secure doors: it's better to invest in a single, massive, bulletproof, guarded door rather than inviting anyone who meets some standards to add a door to the building, since what matters is the weakest door.
If it can be reliably proven that a CA is compromised, then it can be fixed.
Compromising any CA affects the entire internet.
Although it's unlikely that's of any use, since unsophisticated users aren't going to differentiate, and sophisticated ones can use other means to verify identity.