Skip to content
Naked Security Naked Security

Anatomy of a certificate problem – the “PrivDog” software in the spotlight

The bug's now fixed, but when software offers to make your secure transactions more secure... ...you don't expect things to work the other way around!

An adware program called SuperFish hogged the cryptography news lately.

Lenovo tried a bit of an experiment by pre-installing this program on some of its consumer notebooks.

The company was apparently under the impression that its customers would be pleased to have a free utility that brought them better-quality ads by peeking inside their secure transactions.

As it happened, many of its customers might never have even noticed SuperFish, were it not for the negative publicity that followed the revelation that the software had got its cryptography wrong.

SuperFish blessed itself with the right to give its own security “seal of approval” to your usual HTTPS sites, such as internet banking and webmail.

Unfortunately, it also allowed any and all cybercrooks to self-certify their own dodgy websites and malware downloads in a way that SuperFish would give them a seal of approval, too.

As a cynic might say, “What could possibly go right?”

Fortunately, because SuperFish wasn’t deliberately malicious, it didn’t try to hide itself or to prevent removal, so you could remove it easily with its own uninstaller.

And for those who preferred to get rid of it by hand, Naked Security and numerous other sites gave instructions on what to do.

Of course, it’s not only adware that is increasingly stymied by the use of HTTPS, where web traffic is encrypted all the way from your browser to the server at the other end.

Security software, if it watches out for malware in the web pages you visit, faces a similar challenge: how to spot pages that belong to crooks if they are wrapped inside HTTPS?

MiTM explained

The answer, for better or for worse, is a trick called keybridging, also known as decrypt-recrypt, or, more commonly, as Man in The Middle (MiTM).

When your browser connects to, say, https://example.com/, the security software intercepts the connection and “answers” it, either right there on your own computer, or in some gateway server between you and the internet.

The security filter then connects onwards to https://example.com/ and grabs the content on your behalf (that’s why this sort of software is called a “proxy”), using an HTTPS connection of its own.

That means the HTTPS replies from example.com actually terminate inside the security software, too, so your traffic is unencrypted, both outbound and inbound, with the result that the software can look inside it.

Strictly speaking, that violates the end-to-end encryption “promise” of HTTPS, and it also plays havoc with the HTTPS security certificate presented by example.com, which never reaches your browser.

To trick your browser into thinking it really did connect to example.com, the security software generates, in real time, a fake certificate pretending that it is example.com.

And to trick your browser into trusting that fake certificate, the security software adds itself to Windows as what’s known as a Trusted Root Certification Authority (see images below).

That means it can not only mint fake certificates, but sign them and therefore verify them at the same time.

Clearly, that means you have to trust man-in-the-middle security software a lot – it’s a bit like letting your accountants be their own auditors and sign off their own work.

The SuperFish problem

SuperFish’s problem was that it failed to protect the cryptographic material that it used on-the-fly to mint its fake certificates.

In other words, a crook on the other side of the world could sign his own web page or malware program with the same signing key that SuperFish was using on your computer.

And when your browser saw the crook’s digital certificate, it would say, “Hey, that certificate was signed by SuperFish, and I trust SuperFish, therefore I trust the crook!”

The PrivDog issue

It turned out that SuperFish wasn’t the only recent consumer product to implement MiTM and get things wrong.

At about the same time, towards the end of 2014, internet company AdTrustMedia also tried a bit of an experiment by adding a MiTM-type component into its PrivDog product.

AdTrustMedia is partnered with Comodo, an internet security company that proudly promotes itself as “now the largest Trust Provider in the world.”

Comodo’s primary business is signing HTTPS certificates for you, after doing sufficiently diligent research to verify that you are who you claim.

In short, Comodo’s Certificate Authority (CA) division vouches for your certificate, and therefore vouches explicitly for your identity and implicitly for your trustworthiness.

It is this diligence by a CA that prevents crooks from making a certificate in the name of, say, big-bank.example and then getting it signed and verified as if it were the real thing.

PrivDog-in-The-Middle

But PrivDog wasn’t so careful with the certificates it generated on-the-fly for doing its MiTM.

Here’s what we saw:

So far, so good, albeit only up to a point.

As you can see above, Sophos deliberately paid a bit extra for a “green-aura” HTTPS certificate for Naked Security.

Called EVs, or Extended Validation Certificates, they are meant to give a visitor a bit more reassurance about the the website owner.

That’s because the CA is supposed to (and, in this case, did!) put additional work into checking up on the owner’s identity and right to operate the web server involved.

PrivDog’s minted-on-the-fly replacement certificate doesn’t meet EV criteria, so the product effectively downgrades Naked Security’s rating, supposedly in the name of improving security.

PrivDog’s “privacy upgrades”

It gets worse, because PrivDog sometimes created replacement certificates that effectively upgraded a website’s security rating, by inadvertently generating a trusted certificate as a placeholder for a dud one.

We tested this by visiting a website run by Hanno Böck, a German journalist who was one of the early investigators of PrivDog’s security problems.

He has a URL that uses a certificate signed by his own CA, one that is not trusted by any browser and should therefore produce a security warning.

If browsers didn’t produce security warnings for home-made certificates, then any crook would be able to mint a certificate in the name of any website.

Here’s what happened:

In short, a phishing site with an unvalidated, unverified certificate might end up looking legitimate to a PrivDog user.

PrivDog “re-mints” a certificate with an untrusted signer as a certificate with a trusted signer, namely PrivDog itself.

The fix

Fortunately, PrivDog has now been updated.

As far as we can tell, the latest version no longer has this security-sapping bug:

This sort of bug is a pretty bad look for a security company – particularly one whose main business is verifying the identity of the owners of HTTPS certificates.

It’s a bit like a notary public, who is supposed to certify documents and annotate them with his official stamp, handing out free copies of his stamp so you can quickly and easily certify your own documents at home.

Additionally, the makers of PrivDog probably didn’t do themselves too many favours by writing up this bug with the words:

A minor intermittent defect has been detected in a third party library used by the PrivDog standalone application which potentially affects a very small number of users.

What would have been so hard about saying, “Sometimes our product would let through untrusted certificates without a suitable warning, so we’ve fixed that bug”?

What to do?

If you have PrivDog installed, make sure you’re up to date!

0 Comments

“At about the same time, towards the end of 2014, internet security company Comodo also tried a bit of an experiment by adding a MiTM-type component called PrivDog into its endpoint security product.”

that would be incorrect. the version of privdog that was bundled with their endpoint security product was old and did not do SSL MiTM. it was an older version that was implemented as a browser extension (rather than an SSL MiTM proxy) that was bundled in their custom version of google chrome which itself is bundled with their endpoint security.

around then end of 2014 the company behind privdog (related to but not the same as comodo) developed a version of privdog that wasn’t browser dependent, that worked as described, but that was never bundled with comodo’s endpoint security suite.

it’s a minor distinction, i know, but users of your competitor’s endpoint security suite were not all exposed to this security risk.

Reply

It is indeed a minor distinction, but I get your point. I changed “by adding [PrivDog] into its endpoint security product” to say “into its product set.”

That should avoid any confusion about whether merely having *some* Comodo product was enough for you to end up with PrivDog, e.g. as part of some automatic update.

Bottom line: go to Programs and Features. If “PrivDog” is installed, it should show up as a program in its own right, and AFAIK can be uninstalled independently of any other software component, whether from Comodo or not.

Reply

the stand alone version of privdog (the one that does SSL MiTM) is not one of the products that comodo distributes. i believe the advisory you quoted alludes to that fact.

Reply

I am still trying to work out the exact relationship between AdTrustMedia and Comodo, but I have modified the article so that “PrivDog” is just, well, PrivDog.

Reply

I don’t understand. Why would you need any MitM security software to check the validity of a certificate, when your browser does that already? What’s PrivDog supposed to add?

Reply

PrivDog is privacy software that functions as a MitM. It is meant to combat “malvertising” by actually replacing ad content that hasn’t gone through their trusted affiliate. This certificate funny business is an attempt to get around the browser’s checks.

Some unexplained activity I’ve seen in my web logs makes me sure that this isn’t the last major security news we’ve heard regarding PrivDog. It circumvents too many aspects of safety and asks the user to trust it way too much.

Reply

It wasn’t to check the security of the certificate. The purpose was to get access to the unencrypted http stream so they could check it for malware. Faking out the security with a bogus certificate was just to be able to decrypt and peek into the stream after the browser or server had encrypted it.

Reply

PrivDog looks _inside the traffic itself_ to watch out for dodgy ads, which it will remove to keep you safe.

And if you like (you *do* like, because it’s the default!) it will, ahem, remove ads of the shabby sort, even from encrypted traffic, and REPLACE THEM WITH FANTASTIC ONES! HOW COOL IS THAT?

Note that you do not need MiTM software to check certificates. The whole problem is the other way around, which is the point of the article: MiTM software messes with the certificate chain, so it needs to be very, very careful not to make things worse.

Of course, this whole thing about the “automatic advert augmentation algorithm” may be a hammer you don’t need looking for a nail you didn’t know you had, but, hey…

Sorry. That’s all I’ve got. “Hey.”

Reply

Simplest solution is to remove PrivDog. Does Sophos detect it (and similar software) as PUAs?

Reply

We detect it as App/PrivDog (The “App/” prefix means it’s considered a PUA, or Potentially Unwanted Application.)

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe to get the latest updates in your inbox.
Which categories are you interested in?
You’re now subscribed!