Un-Trusteer-ed

The bank we use for our business account recently mandated the use of a product called Trusteer Rapport while accessing our information online. Although Mac OS X doesn’t have any problems with “increasingly sophisticated malware in the online environment”, I do need to periodically check our accounts and transactions so I proceeded with the installation.

The first warning sign was after starting the Installer: I was prompted for an administrator password indicating that this software wanted to run from protected areas of my system. Being a developer, I immediately dug into the installer scripts and configuration files to see that the app is placing items in the Rapport/bin, PreferencePanes, LaunchDaemons and LaunchAgents folders of the main system Library folder. The launch folders indicate that the software will be run whenever my Mac is restarted and will be able to do things a normal user would not (because of elevated permissions.)

I placed my security concerns aside as I need to access my bank website, so I went ahead with the installation. Afterwards, I was directed to a web page describing the new software.

Again, as a developer, my first thoughts were suspicious ones. From experience, I know that it’s not easy to modify Safari’s user interface in the way that Trusteer was doing. My guess that there would be a new, always active, background process was confirmed by the presence of “rooksd” in my process list.

However what happened next really opened my eyes. Safari crashed.

Of course that, in and of itself, isn’t the end of the world. But I was surprised to see a new library named RapportUtil1 while looking at the Safari crash report. It was pretty clear that the new Trusteer software caused the crash. But how?

As a longtime Objective-C developer, I know a thing or two about “method swizzling“. In a nutshell, this allows a developer to replace the functionality of code they don’t have direct access to (typically in the system or other frameworks.)

Seeing “_nsapplication_sendEvent_override” tells me that Trusteer is using this technique to change the behavior of Safari. The function that is being affected is -sendEvent: — the part of every Cocoa application where mouse, keyboard and other input is routed.

Method swizzling is a dangerous activity. You have to make assumptions about how some other code, that you’ve never seen, is behaving. You also need to think about how that code might change in future versions. There are extreme cases where this technique can be effective: overriding the default behavior of my web browser is not one of them.

It’s clear that the folks taking control of my browser aren’t as clever as they think. Do you see a common theme when you search Apple’s discussion forums for “RapportUtil1“?

Even more troubling is the method being overridden: every key press or mouse movement is first being sent to Rapport and then forwarded onto Safari. Since this happens often, the intruding software can do pretty much whatever it wants, whenever it wants. And remember that part of this package is running with elevated permissions in the background.

After mentioning my findings on Twitter, I got back some very interesting replies. Graham Lee (@iamleeg) pointed out that I’m not the first developer to question the technical merits of this software. But then Peter Hosey (@boredzo) dropped the real bomb. Trusteer tacitly admits to recording my password. That’s easy to do when you take control of -sendEvent:.

Essentially, my bank is asking me to install is a keylogger. Just so they can warn me not to use the same password on suntrust.com and playboy.com.

Hopefully, the engineers behind Rapport are smart enough to be using hashed passwords rather than clear text. And hopefully none of the personal information Safari has access to is being forwarded to the Trusteer servers. And hopefully they’re not recording how many times I visited playboy.com last month. But that’s beside the point, because as a closed source product, no one can audit their activity. That’s not true with Safari.

Oh, and there’s one other thing: the Rapport software isn’t supported on Lion. One of the tenets of method swizzling is to test your software early and often with any new release of the system or framework that it’s modifying. As a developer, you need to be proactive about fixing any problems that pop up in the code you are overriding. Not doing so is irresponsible and puts your users at risk. The last update for Rapport was in 2009.

(One could speculate that the new privilege separation architecture for Safari in Lion is causing Trusteer’s developers a lot of headaches. The other tenet of method swizzling is to remember that it’s not a matter of if your hack will break in the future, but rather when it will break and how painful it will be to fix.)

Needless to say, I have uninstalled this software and will never be installing it again. I would recommend this course of action to any end user.

But that leaves me with a problem: how do I access my bank’s website? I have three options:

1) Find another bank. This is a difficult choice, as there are many systems that are hooked up to this account: ACH transactions for sales via iTunes, bi-weekly payroll, automatic payments for services, etc. I’d also like to give SunTrust a chance to reconsider their position in requiring this software (they will be getting a copy of this report.)

2) Use the telephone. I can call the bank when I need the information. Sure they’ll get tired of hearing from me, and it will cost them more for customer service, but it’s their choice to require Trusteer Rapport.

3) Run the Trusteer Rapport software in locked down environment. Once it’s supported on Lion, it should be possible to create a virtual machine that that will only be used to access the bank website. Needless to say this is inconvenient, a waste of resources, and severely limits my ability take advantage of my bank’s services.

In closing, I’ll leave you with one final irony: I will never be able to access my bank’s website from what is arguably the most secure computing device in existence today. That’s because the iPad is not a supported platform. Apple only allows third-party applications to run in a secure sandbox where they can’t affect other applications or the operating system. What you’ve seen above is exactly the reason they’ve done this.

Predators

Dear Steve,

I’m one of the developers that is affected by the Lodsys patent infringement claim. I’m writing not to beg for your support, but rather to give you a better idea of how this legal action affects the average iOS developer.

We’re a small company. We have 12 employees that have created 14 products for Mac and iOS. We have been incorporated in the state of North Carolina since 1999. We won an Apple Design Award in 2008.

We’ve been doing product development long enough to know that legal expenses are just a part of doing business. But as we both know, the costs of patent litigation can be staggering. As a small company, we don’t have the resources to defend ourselves, so that leaves us with one option: to pay a licensing fee.

And that worries us and every other iOS developer we know.

In and of itself, paying half of a percent of our App Store sales to Lodsys isn’t going to put us out of business. The fear we have is that this is the first step on a very slippery slope.

It’s well known that the top titles in the App Store can earn tens of thousands of dollars per day. There are many predators with dubious patents who see dollar signs when they look at the flock of iOS developers.

What these predators don’t realize is that for every developer who’s earning millions, there are many thousands who are earning much less. This backbone of the iOS ecosystem is doing well with work we love, but that is very much at risk with increased legal costs. We wonder what happens when these predators discover that the earnings from these apps are much lower than they expect. Will the licensing fees increase as a result? Will our next infringement be 5%, 10%, or more?

Of course, this is also a slippery slope for Apple. Taking on a legal burden for an entire platform is not something we would want to do, especially when the root of the problem is a screwed up patent system.

We love developing products for iOS and the Mac, but this legal mess has already started killing that enthusiasm. Apple has revolutionized the distribution of software via the App Store and that has been a great boon for smaller developers. It makes us furious that these greedy predators can put all of that at risk with patents.

Thanks for your time,

Craig Hockenberry

iPhone multitasking

It’s no secret that “multitasking” is one of the great new features of iOS 4. Unfortunately, many people have a misconception about what Apple has implemented. Hopefully this short essay will help you understand the restrictions and the good reasons for having these limits.

On your desktop, multitasking means that any application or process can run at the same time as another. Technically, there’s no reason why the same can’t be done on a mobile device. However, from a more practical point-of-view, there is one good reason why you don’t want this: a running app uses energy that decreases your battery life. Running fewer apps means you can listen to music longer, make more phone calls, or call up Maps at the end of the day to find a place for dinner.

At the same time, there are certain types of app that must run in the background in order to be useful. Apple has identified three categories of apps:

  • Audio – Apps that plays audible content while in the background. The poster child for this type of application is Pandora.
  • VOIP – When you’re making or receiving phone calls over an Internet connection, you’re using a “Voice Over Internet Protocol” app that runs in the background. Skype is a good example.
  • Location – Some applications need to run in the background so they can keep track of your current location. An app that logs GPS coordinates while you take a walk or run would need to do this.

Additionally, apps can tell iOS 4 that they need additional time to complete a task or want the user to be notified at a specific time. This lets apps finish a long download or pop up the little blue window like an incoming SMS message.

These simple rules cover a wide variety of situations, but there are still some cases that aren’t covered. The main shortcoming is with apps that need to periodically refresh data. Social networking apps, chat programs, news readers, and other utilities that check the Internet for changing data don’t fit into any of the above categories. Developers have proposed solutions to these problems, but there’s no solution for today’s software.

Part of the confusion with multitasking comes from Apple’s excellent implementation of “task switching”. When you double-tap on the home button and start another application, the previous application is “frozen” and put into a state where it’s not running but can be restarted quickly. A part of the freezing process also reduces the amount of memory being used: allowing more applications to fit in freezer.

The next time you tap on the app’s icon, it is “thawed out” and put back on your iPhone’s screen while the previous app is frozen. This process is repeated each time you launch an app.

This sleight of hand makes it feel like you’re running many more applications than you actually are. It also explains how your iPhone can continue to have great battery life while you interact with many different apps. Most of your apps will be frozen and not using power: only the app on your screen is active. And even with audio, phone or GPS apps that are running in the background, you won’t be using more than one of those at a time (go ahead and try to listen to Pandora and the iPod apps at the same time!)

Hopefully this short explanation helps you understand that the developer of your favorite app isn’t being lazy about doing refreshing in the background! If you feel strongly about this situation, the best thing you can do is give Apple some feedback.

Updated July 1st, 2010: Matt Neuburg has written an in-depth explanation of fast app switching at TidBITS.

WORLD WILD DEBACHING CHOCK

DEAR LOSERS WHO ARE GOING TO WWDC HERES MY GUIDE TO MAKE YOUR TRIP PLEASENT IF YOU KNOW WHAT I MEAN

CHOCKTUB

APR 23 SO THIS GUY @MACGUITAR GETS IN THE HOT TUB AND SAYS HE WANTS TO SHOW ME HIS THINGS WHAT A WEIRDO MADE @GRUBER JEALOUS TO

CHOCKTUB

APR 24 @jsnell BE CAREFUL OR I WILL MAKE YOU GET IN THE HOT TUB WHAT KIND OF WHINE DO YOU LIKE

CHOCKTUB3

MAY 8 WELL LOOK WHOS SHOWN UP AND HE BROUGHT SOME READING MATERIAL COULD IT GET ANY HOTTER IN THIS TUB I HOPE SO

CHOCKTUB4

MAY 9 NOW THAT @SIRACUSA HAS FINALLY SHUTUP ABOUT HIS DEEP FEELINGS FOR LARRY WALL WERE GOING TO LEARN ABOUT THE BLINK TAG FROM JEFFRAY PARTY ON

CHOCKTUB5

MAY 13 OK WHO LET THE CHICKS IN I TELL YOU WHAT IF SHE STARTS UP WITH THE POETRY SHELL BE LOOKING FOR A WORD THAT RHYMES WITH PALM

CHOCKTUB6

MAY 16 WHO THE HELL LET THE KID INTO THE HOT TUB BOY BE CAREFUL OF THE GUY BEHIND YOU HELL WANT TO SHOW YOU HIS THINGS YOU CAN LEAVE YOUR HAT ON TO

CHOCKTUB

MAY 19 I THOUGHT CATS DIDNT LIKE WATER THAT SNEEKY BASTARD @SOCKINGTON IS PROBABLY GOING AFTER MY WHINE

CHOCKTUB

May 21st Looks like Twitter’s avatar uploading is broken. Again.

MAY 21 OR MAYBE IT WAS JUST THAT @ATEBITS AND ME BEING IN THE SAME TUB WAS TO HOTT TO HANDLE

MAY 21 IN MORE IMPORTANT NEWS TWITTER FIXED THERE SERVER SO THE CACTUS FITS IN THE HOTT TUB AND @GRUBER THOUGHT SITTING IN MY LAP WAS PRICKLY

CHOCKTUB

MAY 29 SO ITS BIKINIS ON MONDAY AND WOLFS SHIRTS ON TUESDAYS WHAT ARE WE GOING TO WEAR THE REST OF THE WWDC WHEN WERE NOT IN THE HOTT TUB

MAY 29 AN IMPORTANT AVATER UPDATE IS NOT WORKING AND NO IM NOT WEARING A BIKINI IN IT BUT ITS BETTER

MAY 31 HEY HEY IT LOOKS LIKE THAT FOXY @TJW DUDE LOST HIS HAT ON THE WAY TO THE HOTT TUB AND WHAT THE HELL DOES INMO MEAN http://twitpic.com/59r88

CHOCKTUB

JUN 3 WHO LET THE DOGS OUT THIS HOTT TUBB IS FULL OF PARTY ANIMALS NOW MOOF MOOF MOOF MOOF http://bit.ly/QNz2G AND DONT SPILL MY WHINE

CHOCKTUB

JUN 4 I LOVE TO CUDDLE WITH TEDDY BEARS ESPECIALLY IN THE HOTT TUBB WONDER WHO LET HIM OFF THE FARM IN THAT KEEWEE COUNTRY

CHOCKTUB

JUN 4 OH CRAP ANOTHER BEAR SHOWED UP BUT THIS ONES CANADAIAN AND HES GOT HIS EYES ON MY DRINK HES ALMOST A FRENCHIE TO

CHOCKTUB

JUN 5 WHOA SOMEONE AND THERE ROCK HARD ASS JUST SHOWED UP IN THE HOTT TUBB NEVER SEEN SUCH FANCY SWIM TRUNKS EITHER WHAT AN PARTY ANIMAL

CHOCKTUB

JUN 5 THE HOTT TUBB IS GETTING SO FULL WERE ONLY ALLOWING SUBATOMIC PARTICLES FROM THE HARDON COLLIDER MAYBE HIS EXISTENCE PROOFS THE THEORY

CHOCKTUB

JUN 5 @Curvyboom YOU CHICKS SPEND ALL YOUR TIME ON FACEBOOK PLANNING LUNCH AND WAITING IN LINE FOR THE TOILET NO TIME TO PARTY WITH US ANIMALS

JUN 6 WITH ALL THE CHICKS SHOWING UP FOR WWDC I KNEW ONE OF THEM WOULD TRY TO SNEAK INTO THE HOTT TUBB GOOTEN MORGEN MINE FRAULINE ICH HABEN CHOCK

CHOCKTUB

JUN 6 IT LOOKS LIKE SOMEONE WITH A TELETYPE SHOWED UP TO THE HOTT TUBB ID KICK HIM OUT BUT HIS PALMS LOOK DELICIOUSLY FLESHY

CHOCKTUB

JUN 6 @dsandler ITS EASY TO EXPLAIN JUST SAY THAT ITS PINK AND WARM

JUN 7 ANOTHER DAY ANOTHER CHICK IN THE HOTT TUBB SHES ALMOST AS PINK AS I AM AND I THINK SHES LAUGHING AT US NOT WITH US WONDER IF SHES MARRIED

CHOCKTUB

JUN 7 @AmyJane ILL MAKE SURE TO WHISPER POPS IN HIS EAR WHEN WE HAVE OUR ANUAL SNUGGLE

JUN 8 YOU LOSERS WHO DIDNT COME OVER TO THE YERBO BUENO HOTT TUBB MISSED OUR SURPRIZE GUEST DURING THE KEYNOTE @GRUBER WAS SO EXCITED HE PEED

CHOCKTUB

JUN 9 ITS GOT SO CROWDED IN THE HOTT TUBB LAST NIGHT I HAD SOME GOLDEN GATES INSTALLED SO YOU CAN ALL LEAVE NOW

CHOCKTUB

JUN 10 SOMEONE TURNED UP THE HEAT ON THE HOTT TUBB LAST NIGHT AND IM STILL FEELING A BIT WOOZY ALSO SEEING GRUBER SWEAT IS NASTY

JUN 10 OOOOOOHHH FUZZY BALLS ARE TICKLING MY NOSE IN THE HOTT TUBB AFTER FREE BEER AT THE MAC WORLD

CHOCKTUB

JUN 11 YEAH ITS TRUE I MAY BE GETTING OUT OF THE HOTT TUBB TO PERFORM AT A BASH WORKING OUT DETAILS WITH THE LAWYERS

JUN 11 FRICKEN LAWYERS WONT MEAT MY DEMANDS FOR THE YERBO BUENO SHOW MAY HAVE TO GET A FAMILY MEMBER TO DO IT STAY TUNED FOR OFFICIAL CHOCK ROCK

JUN 11 BTW DONT FOR GET TO USE CHOCKROCK WHEN LOCALIZING FOR JAPAN

JUN 11 IF YOUR LOOKING FOR THE HOTT TUBB ITS CONVENIENTLY LOCATED NEAR THE FOUNTAIN AND KEGS LOOK FOR GRUBER IN HOTT PANTS

JUN 11 YES I AM LIVE TWEETING THE BASH TURN OFF YOUR FRICKEN PHONE SO I GET SIGNAL LOOSER

JUN 11 HOTT TUBB http://yfrog.com/5hgdgtj

HOTT TUBB

JUN 11 CAKE IS BEING SERVED IN THE HOTT TUBB BEER TO

June 12th For me, there will never be a beer bash as special as the one this evening.

JUN 24 AND YOU THOUGHT I WAS JOKING ABOUT MY BUDDY STEVE BEING IN THE HOTT TUBB http://bit.ly/Y8MCf A MAGIC MOMENT

A lot of typing

I’ve always wondered what it would be like to write a book. Now I know. It’s the hardest thing I’ve ever done, but rewarding beyond words.

For those of you asking for PDF or Ebook editions, you can order them now directly from O’Reilly. The printed version will be available in a couple of weeks. The “Look Inside” feature at Amazon.com will give you an idea of what the book covers. I’ve also written an overview of each chapter. (And for those of you who are dying to know, the CHOCKLOCK first appears on page ix.)

If you think you know everything about iPhone development, this book will probably prove you wrong. I learned a lot while writing it, and it’s my sincere hope that you’ll benefit from reading it.