9 ms·
An SSL cert that is valid for any and all domains and all levels of subdomains
- reanimus 6y agoI'm curious how many SSL implementations will accept it (assuming you signed it with a trusted root/self-signed certs are allowed)
- mike_d 6y agoNone. Wildcards are not allowed at the first or second level. https://en.wikipedia.org/wiki/Wildcard_certificate#Examples https://en.wikipedia.org/wiki/Wildcard_certificate#Examples
- ryan-c 6y agoNor are they permitted anywhere other than in the leftmost part of the name. *.*.example.com and foo.*.example.com aren't allowed. Not sure what the current state of software accepting these things is, but minimally, CAs are not allowed to issue anything like that.
- SiempreViernes 6y agoSo are we pretty certain or very certain that at least one implementation (probably in an IoT device) will no bother with this validity check and accept it anyway?
- floatingatoll 6y agoDo network routers count as IoT devices?
- ryan-c 6y ago100% certain, but it's self signed, so no mainstream browser will honor it.
- rndgermandude 6y agoThe question wasn't whether if it is allowed, but how many implementations will actually accept it ;)
- tialaramex 6y agoPopular browsers don't accept these prohibited names, e.g. here's the relevant code for Mozilla's NSS: security/nss/lib/mozpkix/lib/pkixnames.cpp Likewise for Chromium: trunk/src/net/base/x509_certificate.cc (I've intentionally not linked these because burdening the relatively heavyweight source viewers with idle HN readers who are mostly going to glaze over and not read once they discover it's tricky C++ code seems unfair) My guess would be that because it's harder to process multiple wildcards at all, and indeed even the sketchy single wildcard in odd position (which Symantec used to issue and argued wasn't technically prohibited e.g. dev-*.auditcompany.example where auditcompany.example was a domain belonging to Symantec's auditors...) it's less likely anybody goes to the effort to do this even though it's a bad idea. But I guess if the wrong programmer is assigned the problem they might cheerfully write a nice loop to process wildcards even though it's more effort and the wrong thing so we can't rule out that it has happened somewhere at least once.
- tolqen 6y ago> I've intentionally not linked these because burdening the relatively heavyweight source viewers with idle HN readers who are mostly going to glaze over and not read once they discover it's tricky C++ code seems unfair Seems like a good use case for linking to their respective GitHub mirrors
- vlz 6y ago> Seems like a good use case for linking to their respective GitHub mirrors https://github.com/chromium/chromium/blob/master/net/cert/x509_certificate.cc#L518 https://github.com/chromium/chromium/blob/master/net/cert/x5... https://github.com/mozilla/gecko-dev/blob/master/security/nss/lib/mozpkix/lib/pkixnames.cpp https://github.com/mozilla/gecko-dev/blob/master/security/ns...
- liammonahan 6y agoThis is cute. Does this have any practical value? You would never get someone to sign it obviously, and for self-signed certs you have no revokability here without reissuing a cert to everything in your domain. Most people with a PKI setup don't need this, right? This is still very cheeky, though!
- Ayesh 6y agoI suppose you can use such certificate to MITM yourself to inspect the traffic to/from nodes you control, but pretty much every tool out there has features to generate certificates on the fly.
- guenthert 6y agoYou mean like HTTP(S) proxies and deep-inspection firewalls?
- Ayesh 6y agoAny software or hardware that needs to intercept HTTPS. One common example is antivirus software that block malicious content. It can install this wild-wildcard certificate, and act as a proxy to all sites the user visits. There are obvious security issues to it of course.
- devy 6y agoSo this is a self-signed TLS certificate. Perhaps pair the CSR with mkcert[1], it will be even more useful (without seeing the warning messages in browsers.) to be used locally. [1]: https://github.com/FiloSottile/mkcert https://github.com/FiloSottile/mkcert
- dtech 6y agoSince this cert is valid for basically everything, you can trust and use that one cert and don't need a CA plus generated certs like mkcert does.
- skyzyx 6y agoThis is grossly irresponsible.
- nexuist 6y agoIt's a joke, no? Nobody in their right mind would actually use this in production (of course, now that I've said that, they will, but I digress).
- el_dev_hell 6y agoIt's 100% a joke and will 100% end up being used in production eventually.
- pilif 6y agoFor this to be useful in production, it would need to be signed by a proper CA. No CA will sign this. And if they accidentally did, it would be revoked immediately in order to not end up like Diginotar and Symantec
- squiggleblaz 6y agoDiginotar and Symantec ended up like Diginotar and Symantec. Even Let's Encrypt backed down. There seems to be strong pressure on CAs to not do the secure thing when they've made a mistake.
- jeroenhd 6y agoYou say that, but: https://github.com/flotwig/the-one-cert/issues/2 https://github.com/flotwig/the-one-cert/issues/2
- dtech 6y agoA valid use case would be local development or MITM'ing yourself
- mike_d 6y ago
- AnonC 6y agoObviously, this is for internal environments under one’s control. I found this bit amusing and wondered if the author had some kind of meta message here: > Issuer: C = US, ST = GA, L = Atlanta, OU = Junk
- lucb1e 6y agoThis should be on top since the title can be confusing. I thought someone found a vulnerability but it's indeed just a script to generate a certificate without having to care which common name or alternative names you give it.
- kalium-xyz 6y agoSo *.?
- x3n0ph3n3 6y agoDid you bother reading? . doesn't work with subdomains. You need more 's and .'s
- pedrocx486 6y agoDoesn't the title here literally say that it works with subdomains? Or I'm misunderstanding? (Not my field of work.)
- cpach 6y agoYes it does, due to the way that it’s structured. AFAICT, the wildcard symbol (asterisk) will not match across the separator (i.e. the period). So ¤.¤ will only match example.com or contoso.com etc, not blog.example.com or sales.contoso.com. If you look at the cert, it has lots of line that looks like this: DNS:¤.¤.¤.¤.¤.¤.¤.¤.¤.¤, DNS:¤.¤.¤.¤.¤.¤.¤.¤.¤.¤.¤, In that way it will match all possible levels of subdomains. (Asterisk substituted for ¤ in order to not trip up the formatting here on HN.)
- cpach 6y agoIf anyone finds 'x3n0ph3n3’s comment to look weird, it’s because HN ate the asterisks in there.
- infogulch 6y agoLook at the certificate details: https://github.com/flotwig/the-one-cert/blob/master/openssl.cnf https://github.com/flotwig/the-one-cert/blob/master/openssl.... You have to have a separate alt name specified for every possible number of subdomains. * does *not* match *.*, or *.*.*, etc
- cpach 6y agoI don’t think that ? is a valid operator in this context.
- virgilp 6y agoThis gives a whole new meaning to the concept of "public key encryption".
- eru 6y agoI wonder why they left out the single "DNS:*". Is that not valid?
- AndyMcConachie 6y agoIt's complicated. Here is a report on dotless domains you may find interesting. https://www.icann.org/en/system/files/files/sac-053-en.pdf https://www.icann.org/en/system/files/files/sac-053-en.pdf
- imrehg 6y agoThey didn't, that entry is in the top level commonName (CN in the openssl output), or looking stright in openssl.cnf: ...snip... commonName = * ... [alt_names] DNS.1 = *.* DNS.2 = *.*.* ...
- praseodym 6y agoSubjectAltNames should always include the common name, modern browsers won’t even look at the common name value any more (because it’s validation algorithm is not well defined, whereas it is for subjectAltNames).
- igetspam 6y agoShould be not must. The RFC doesn't required it. SSL implementations are complicated. Browsers might accept this up until hmthe Nth SAN, at which point they stop reading because they have arbitrary SAN limits (not in the spec). Some issuers care about CN/Alt match and some don't More fun than generating this cert would be doing an analysis of who will accept it, who will reject it and who will accept up to a point. (Obviously I dontbexpect anyone to issue it, if you handed in a CSR for it.)
- tialaramex 6y agoFrom a purely pragmatic point of view, in the Web PKI CN is ignored by Chrome for some time now and I think Firefox did that too. There were, and might still be, exceptions for certificates you trust which aren't from the Web PKI. You break it, you bought it. The Baseline Requirements require that Public CAs ensure CN if present (which for compatibility it usually will be) is set to the same name as one of the SANs. Historically breaches were not uncommon, but as noted above now these certificates won't work as intended in Chrome so that's another practical reason above getting a slap on the wrist from m.d.s.policy.
- jonnybarnes 6y agoI thought you couldn’t put wildcards in multiple levels of the domain?
- shadycuz 6y agoI've done .example.com and .dev.example.com but I'm not sure if you mean that or . I haven't seen the latter either.
- jonnybarnes 6y agoI mean I think *.*.example.com isn’t valid.
- oefrha 6y agoThat's typically a limitation imposed by CAs (e.g. Let's Encrypt), not a limitation in the spec. RFC 6125 even contains an example of a multilevel wildcard domain (but says support in existing implementations is unclear): Specifications for existing application technologies are not clear or consistent about the allowable location of the wildcard character, such as whether it can be: ... * included as all or part of more than one label (e.g., *.*.example.com) https://tools.ietf.org/html/rfc6125#section-7.2 https://tools.ietf.org/html/rfc6125#section-7.2 Edit: Actually, according to https://community.letsencrypt.org/t/allow-multiple-level-wildcard-certificates/67242 https://community.letsencrypt.org/t/allow-multiple-level-wil..., browsers are behind the "only one level of wildcard" rule, too: > We would also have to contend with the CA Browser Forum’s Baseline requirements. Presently they define a “wildcard domain” as: > “A Domain Name consisting of a single asterisk character followed by a single full stop character (“*.”) followed by a Fully-Qualified Domain Name.”, > Allowing multiple wildcard labels would likely run afoul of the baseline requirements.
- a10c 6y agoIs there a particular reason why CAs don't allow this? Security or otherwise?
- 6y ago
- josteink 6y agoI realize this is not an overly serious project, but still.. To use this, you have to install node, and use that to run generate.js[1]... and what does generate.js do? 1. It generates an openssl.conf-file, which could have been checked into the repo as static content. 2. It runs a bash-script[2] which calls the openssl CLI-tool, with this config-file as a parameter. I get it that we are programmers, but how many layers of indirection are we going to add to what could have been a simple README, and pre-supplied config-file? Less is more. Not everything needs to be NodeJS. [1] https://github.com/flotwig/the-one-cert/blob/master/generate.js https://github.com/flotwig/the-one-cert/blob/master/generate... [2] https://github.com/flotwig/the-one-cert/blob/master/run-openssl.sh https://github.com/flotwig/the-one-cert/blob/master/run-open...
- vbezhenar 6y agoMay be I don't understand something, but this repository does have static openssl.conf and even generated key/certificate, so you absolutely don't have to install node. You need to install node, if you want to regenerate it with different parameters or something like that.
- cookiengineer 6y agoMaybe for inexperienced developers the whole point of this approach is that bash loops and string manipulations are inguessable (and by any means not similar to any real programming language)? I mean, after 20 years of UNIX, I don't even have a clue why expressions fail in bash sometimes ¯\_(ツ)_/¯
- dcminter 6y agoYou probably already know this tool, but it was new to me relatively recently: https://www.shellcheck.net/ https://www.shellcheck.net/
- cookiengineer 6y agoYep, shellcheck helps a lot while debugging shell scripts and quirks. (ALE has support for it, too, in case you use VIM)
- jupp0r 6y agoPerfect. Let's get it signed by Digicert!
- an_account_name 6y agoI mean out of the Symantec roots... Ooh, I bet WoSign would do it!
- Nextgrid 6y agoI bet Honest Achmed will sign it in exchange of a couple used cars: https://bugzilla.mozilla.org/show_bug.cgi?id=647959 https://bugzilla.mozilla.org/show_bug.cgi?id=647959
- craftinator 6y agoHah I haven't stumbled across this in years! Thanks for sharing!
- lmilcin 6y agoProbably would be more useful with less subdomain levels. This will inevitably trigger problems with some tools and you do not typically need anything more than 3-4.
- eddieoz 6y agoHaving possibilities as a technology perspective is always a good thing. But without a good use case, it seems to be worthless. CA's will review it from a business perspective and if the market doesn't need it, they will not implement.
- emilfihlman 6y agoDNS:*.*, Is this missing ai and other top level domains?
- cpach 6y agoPlease check your comment again. HN ate some characters:)
- emilfihlman 6y agoThanks! I think it's fixed now : )
- lucb1e 6y agoSomeone posted that question 4 hours before you did and it was answered 3 hours ago.
- emilfihlman 6y agoAh I see, thanks!
- ganouti 6y agoCan someone do please do an ELI5? I know what a certificate is, but not more than that so I don't really understand what's happening here. Thanks!
- BorisTheBrave 6y agoCertificates list what website they are a certificate for. Wildcards are allowed in some cases. This certificate claims it certifies every website. There's a mechanism called certificate chains that allows browsers to validate that the certificte actually has the authority it claims to have - obviously, this certificate would not pass that validation.
- kenrose 6y agoCertificates are used to prove the identity of a given domain. e.g., if you visit https://news.ycombinator.com https://news.ycombinator.com (https), when your browser connects, the server offers a certificate that basically says “this is the certificate for news.ycombinator.com”. Your browser verified that the domain on the certificate is the same as the domain you’re visiting. If they’re different (or if there’s is something else wrong with the certificate like it expired), you are shown a warning that says “It may not be safe”. Some sites have a multitude of domains and they don’t want to have a different certificate for each. Fortunately, there is a way to specify wildcard expressions in a certificate. For example, many SaaS tools where your account name is part of the domain (e.g., my company’s PagerDuty account is at opsevel.pagerduty.com). A certificate that could be provisioned would be for .pagerduty.com and that would work for all of their subdomains (one per customer). This site invented a cute trick where they used wildcards to essentially match any* domain or arbitrarily deep level of subdomains. It literally is a certificate that could be used by any domain because its wildcards match everything. Of course, it provides no security because it’s vacuously passing.
- coenhyde 6y agoThis is not a valid certificate. See https://tools.ietf.org/html/rfc6125#section-6.4.3 https://tools.ietf.org/html/rfc6125#section-6.4.3 1. The client SHOULD NOT attempt to match a presented identifier in which the wildcard character comprises a label other than the left-most label (e.g., do not match bar.*.example.net). 2. If the wildcard character is the only character of the left-most label in the presented identifier, the client SHOULD NOT compare against anything but the left-most label of the reference identifier (e.g., *.example.com would match foo.example.com but not bar.foo.example.com or example.com).
- thedanbob 6y agoThose are both “should not”, not “must not”. So technically this isn’t breaking the rules, though it’s obviously incredibly not recommended.
- coenhyde 6y agoyeah but i think you'll have a hard time finding a client library which will consider the certificate valid. If it does i would consider it broken.
- 411111111111111 6y agoisnt it valid according to these rules? 1. is about wildcards in the domain part while having a hostname and 2. is in effect, which is why there are so many alternative subject names. they just added 127 subject alternative names to adhere to these rules.
- coenhyde 6y agoThose 127 SAN's have wildcards which are not the left most label, which as i interpret it would be a violation of rule 1.
- gigatexal 6y agoThis is hilarious
- matthewtovbin 6y agoThis seems like a very bad idea, though definitely less hassle to manage than a regular set of certificates.
- deleted 6y ago[deleted]
- dmtroyer 6y agosomeone please fork letsencrypt to provide this cert.