# How does the 'QuantumInsert' attack work?

I recently stumbled on descriptions of the 'QuantumInsert' attack (mainly used by the TAO group from NSA). This technique seems to be massively used to perform man-in-the-middle or man-on-the-side attacks to insert viruses on specifically targeted computer systems.

Bruce Schneier has several notes on it (see here and there and probably more...). It is also cited in articles published by Spiegel (in English) (see here).

If I understand well, this technique may be used to insert small payloads that are inserted in an HTML page that is currently loaded from a legitimate website. One could probably insert small JavaScript application made to penetrate the web browser of the target (if I understood well).

Now, I would like to know more about the limits of this technique. I read it that only NSA could get access to this kind of attacks, but could other governments, or big companies master this technique too ?

And, finally, I would like to know if there are some ways to protect your web access from this attack (at an individual level) ?

Edit: Just a good explanation from the 30C3 (Dec 2013) in this talk.

"And, finally, I would like to know if there are some ways to protect your web access from this attack (at an individual level) ?" The answer to this question is no. Some attacks would never touch your server. Here is a simple ASCII drawing to explain it all.

Visitor (me) --> my ISP (1) --> another provider (2) --> another provider (3) --> your server (4)


At any point between 1-3 there will be many routers and switches. Any attacker can modify data BEFORE it gets back to me. Consider the following. You have a website which solely displays the time, nothing more. There is no HTML code, nothing but the time is displayed. At ANY point in time along the wire, a TAP can be placed to modify data:

Me --> go get the time --> your server
Your server --> here is the time --> network (this is beyond your control now)


The attack?

Your server --> here is the time --> network --> TAP (modify this page) --> me


See the dilemma? You can shout: "but SSL! and TLS!" and it will do nothing against a signed cert being injected. You can shout: "I will MD5 checksum the page!" But you're missing the underlying point, you can only control, what you control. The harsh reality is there is little you can do at the end of the day.

Gist of it? SSL/TLS will do little when it comes to the "web" via way of public browsing.

• I am sorry but I don't understand why SSL does not solve this. Wasn't the whole purpose of SSL to prevent MITM ? – Paul Praet Mar 14 '14 at 16:25
• Paul, whi;e SSL was created to solve this, the dilemma stems from vulnerabilities in network design. SSL will assist, but can't solve the network design problem. – munkeyoto Mar 17 '14 at 12:37
• If I want to go to www.facebook.com and the NSA replies to me before facebook can, what SSL certificate will they send to me ? They cannot use the one from facebook because they don't have the matching private key. If they use another one, my browser will detect the certificate does not belong to facebook.com. – Paul Praet Mar 18 '14 at 14:27

Well the most effective defense would likely be operating under non-standard conditions to complicate the use of known attacks. For example, if you VMed your browser, then a compromise wouldn't matter unless they could also break out of the VM, but when dealing with an attacker that is directly targeting you and has massive resources, it's probably not safe to assume that they don't have a way to break out of the VM as well, but if you can externally limit what can connect in to your system (through an external firewall) and you can make sure that only the sites you want to go with are allowed to be visited, this would theoretically provide decent protection.

Alternately, if you only loaded HTTPS content, it would prevent insertion of third party content as long as you verify the certificate (and the site you are interacting with has not allowed their private key to be compromised). Otherwise, it is reasonable to assume that any party capable of controlling a large number of routing nodes on the Internet could potentially modify your traffic if they so desired and inject a man in the middle attack.

Really it comes down to general best practices for untrusted browsing and using typical man in the middle protections. It isn't really a new threat, just confirmation of a threat we've all known was a possibility for a long time.