Same problem. It's not fixed, but I have been able to control it, for the most part.
It worked fine for 6 weeks after purchase. After I installed a couple of new apps, it started acting possessed --but only when I plugged it in....it fires up text messages, pulls up websites, scrolls by itself...crazy stuff. It also loses it's touch-screen ability whenever the phone is plugged in. I went to the Genius Bar and they gave me a new phone. The second one was fine for the first few days, and then I finished reinstalling the rest of my apps (a meditation app, fitness app and a security system app) and it started acting crazy again. It's possible that there's a screwy app in there, but Apple is so restrictive about its app code for developers....
When it started up again with phone #2, I watched it for a bit and thought possibly something was lingering in memory that was the feeding the poltergeist. So, I shut the phone off completely hoping to clear the memory. I turned it back on plugged it in and the freaky behavior was gone -- except for the touch screen issue. I simply can't use touch screen while the phone is plugged in, but at least it's not on my nightstand pinging, scrolling and clicking its way through my contacts list. It may also be that the crazy behavior is still trying to start up, but because my screen is locked, it's unable to make anything happen. (I do still notice a couple of random shifts on the unlock screen but nothing else happens.) So, temporary solution. Just before you plug it in....shut it down. Then restart it, plug it in and the crazy behavior is eliminated.