Feeds

T-Mobile JavaScript comment stripper breaks websites

It's not optimisation, it's pessimisation

The Power of One Brief: Top reasons to choose HP BladeSystem

Attempts by T-Mobile to speed up mobile data connections are breaking websites.

The bug intermittently affects mobile device users and PC users using tethered connections. It is caused by "optimisations" to the sites' Javascript code made on the fly, in attempt to optimise the amount of data received. Instead of stripping out comments, the optimisation – or more precisely, "pessimisation" – also strips out strings in the code itself.

MySociety first publicised the issue last week.

A developer told us the bug struck while his team was giving a demo to a potential investor. The team subsequently spent two days tracking down what had caused the issue.

"T-Mobile have managed to strip out bits of JavaScript code as well as comments. The jQuery library suffers, too. Worse than that, the script files are cached and won't get replaced when the user moves off 3G and back on to a decent ISP: in effect, T-Mobile has broken websites permanently," said the dev.

MySociety's Matthew Somerville blamed clumsy coding:

"The T-Mobile JavaScript comment-stripper appears to be searching for '/*' and '*/' and removing everything in between. This might work in most cases; however in the jQuery library, we find a string containing '*/*', and later down the file, another string containing '*/*'. T-Mobile removes everything between the things it thinks are comment markers, even though they're actually contained within strings, causing the jQuery library to be invalid JavaScript and stopping anything using jQuery from running," he wrote.

The apparent indeterministic nature of the bug – which attacks only occasionally – has made it harder to track down. "We are investigating the issue you have raised and are taking it very seriously," T-Mobile told us. ®

Securing Web Applications Made Simple and Scalable

More from The Register

next story
Apple fanbois SCREAM as update BRICKS their Macbook Airs
Ragegasm spills over as firmware upgrade kills machines
HIDDEN packet sniffer spy tech in MILLIONS of iPhones, iPads – expert
Don't panic though – Apple's backdoor is not wide open to all, guru tells us
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Captain Kirk sets phaser to SLAUGHTER after trying new Facebook app
William Shatner less-than-impressed by Zuck's celebrity-only app
Do YOU work at Microsoft? Um. Are you SURE about that?
Nokia and marketing types first to get the bullet, says report
Microsoft takes on Chromebook with low-cost Windows laptops
Redmond's chief salesman: We're taking 'hard' decisions
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
Misc memory hazards 'could be exploited' - and guess what, one's a Javascript vuln
prev story

Whitepapers

Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Reducing security risks from open source software
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Consolidation: the foundation for IT and business transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.