A new report form the Toronto-based internet watchdog Citizen Lab has shown cases of governments running network injection attacks that can deliver malware via any HTTP web connection.

The dossier looks at two hacking tools created by the Italian firm Hacking Team and the German biz FinFisher that use the injection attack vector. Both firms claim to sell only to government sources, although leaked documents suggest at least one sale to a private security company has taken place.

The attack works if a spy or other miscreant fits a Hacking Team or FinFisher appliance in the telecommunications company used by the target. Once the victim's IP address is known, the injection server can identify his or her connections to website, intercept the passing unencrypted HTTP stream and insert malicious code into the web page.

This happens without any user interaction at all; the inserted code then exploits vulnerabilities in the victim's computer – perhaps a Flash plugin or browser zero-day – to infect it with spying malware. Governments tend to stockpile exploits for various devices and operating systems.

Citizen Lab says YouTube and Microsoft Live login pages are heavily targeted.

"The proliferation of tools for both tactical and on network injection attacks highlights a vulnerability that has existed since the beginning of the consumer Internet," the report states.

"Until recently, however, it has been challenging to gauge the practical viability of this attack and the number of actors that might have this capability. Hacking Team and FinFisher are probably not unique in packaging and selling these techniques. In terms of surveillance vendors that provide such technology, it seems likely that this is but glimpse into a larger market."

One way to block this kind of attack is to connect via HTTPS, which encrypts the connection and protects it from tampering – assuming the SSL CA certificates aren't compromised.

Most websites aren't using HTTPS for various technical or trivial reasons, but this is changing slowly: Google is doing its bit by promoting TLS/SSL-protected sites on its search rankings, and YouTube will encrypt its streams by default. Microsoft's login.live.com also now uses HTTPS. Encryption adds some costs, but Citizen Lab points out the current security situation demands it.

The group has found out that governments are already using network injection attacks, using software provided by a US military contractor CloudShield Technologies. According to Citizen Lab the governments of Oman and Turkmenistan bought copies of the CloudShield Technologies software.

Human Rights Watch notes that Turkmenistan is "one of the world’s most repressive countries," and that Oman has a long record of spying on and harassing citizens who wish to reform the state's absolute monarchy.

While these governments are buying in their spying technology from third parties, the Snowden leaks have shown that similar attacks are being used by UK and US intelligence agencies. The leaked Tailored Access Operations catalog showed a tool called QUANTUMINSERT that is capable of just this kind of attack.

So remember, next time you check out a cute cat video on YouTube, look for the SSL connection icon – or someone could be pwning your machine while you do. Sleep tight. ®