Slashdot Mirror


Bug In Android Passes Keystrokes To Root Shell

pasokon writes "ZDNet reports on an Android bug in T-Mobile G1s with early versions of the firmware: 'When the phone booted it started up a command shell as root and sent every keystroke you ever typed on the keyboard from then on to that shell. Thus every word you typed, in addition to going to the foreground application would be silently and invisibly interpreted as a command and executed with superuser privileges. ... open the keyboard tray on your G1, ignore anything you see on the screen, and type these 8 keystrokes: (enter)-r-e-b-o-o-t-(enter). Poof, your phone will reboot.'"

58 of 205 comments (clear)

  1. This is simply mind-boggling. by jcr · · Score: 5, Insightful

    I can't imagine how or why anyone could accidentally pipe all user input through a root shell. This is one for the WTF of the decade.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
    1. Re:This is simply mind-boggling. by Otto · · Score: 5, Informative

      Read this:
      http://android.jim.sh/index.php/ConsoleShell

      Looks like debugging code left behind...

      --
      - Give a man a fire and he's warm for a day, but set him on fire and he's warm for the rest of his life.
    2. Re:This is simply mind-boggling. by ultramk · · Score: 4, Funny

      This is obviously bad for Apple. I mean if the iPhone weren't all like, locked down, and, um....

      Yeah, anyway, the iPhone is done for, no question. I mean you can't even GET to root shell on an iPhone, and here it is a standard feature on Android! Mind-boggling indeed!

      --
      You catch enchiladas by picking them up behind the head and holding them underwater until they don't kick anymore -VeGas
    3. Re:This is simply mind-boggling. by SharpFang · · Score: 4, Insightful

      I can perfectly well imagine someone purposely piping all the user input to root shell for easy debug and development, then forgetting to disable it in the release version.

      --
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
    4. Re:This is simply mind-boggling. by Anonymous Coward · · Score: 2, Insightful

      A better way would be to require holding down e.g. "c" during boot to enable it. Automatically sending ALL keystrokes to the console is a bad idea, even for debugging.

    5. Re:This is simply mind-boggling. by tyler_larson · · Score: 3, Informative

      Verified this still works on the latest OTA update, RC29.

      --
      "With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea...."
      RFC 1925
    6. Re:This is simply mind-boggling. by tyler_larson · · Score: 4, Informative

      If you want to keep from fubar-ing your G1 by typing in the wrong stuff accidentally, just type "cat [enter]" first thing when you power on the device, and it will be defused from then on. All input will be harmlessly filed away to stdout.

      --
      "With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea...."
      RFC 1925
    7. Re:This is simply mind-boggling. by JackassJedi · · Score: 3, Funny

      Yeah the iPhone is really dead now. Apple totally blew it, I agree. It's totally done for. This is a total misfeature: a hidden root shell!
      BTW what's this 'Android' you're talking about?

      --
      Power corrupts the few, while weakness corrupts the many.
    8. Re:This is simply mind-boggling. by RzUpAnmsCwrds · · Score: 4, Informative

      The latest OTA update is RC30, which patches the issue (I confirmed this on my G1).

    9. Re:This is simply mind-boggling. by tyler_larson · · Score: 3, Informative

      You mean defused until you type Control-z, Control-d or Control-c, right?

      Nope. I really do mean from then on. Read the various write-ups to understand why.

      And for bonus points, see if you can find your phone's "control" key.

      --
      "With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea...."
      RFC 1925
    10. Re:This is simply mind-boggling. by darkpixel2k · · Score: 4, Funny

      If you want to keep from fubar-ing your G1 by typing in the wrong stuff accidentally, just type "cat [enter]" first thing when you power on the device, and it will be defused from then on. All input will be harmlessly filed away to stdout.

      Wait--you're missing the big picture.
      Jailbreak the phone!

      Woo! We now have root access! We can hax0r the phone and load our own custom applic...what? Oh. Shit. Wrong phone. I'll wait for the next iPhone article.

      --
      There's no place like ::1 (I've completed my transition to IPv6)
  2. Scary by Anonymous Coward · · Score: 5, Funny

    Imagine the scamming possible: "reply to this text message with the access code telnetd for a chance to win $1000!"

  3. Confluence by RomSteady · · Score: 5, Funny

    Suddenly, the memory-and-keystroke-saving command names of the past combine with the keystroke-saving text-speak of the present to create the nightmarish user interaction bugs of the future.

    --
    RomSteady - I came, I saw, I tested. GamerTag: RomSteady / http://www.romsteady.net
    1. Re:Confluence by Anpheus · · Score: 5, Funny

      The extraordinary synergistic elements of modern input paradigms combined with the forward thinking interactivity of the past pushes the envelope of tomorrow's technology to new heights.

  4. reboot by Anonymous Coward · · Score: 4, Funny

    doesn't wo

  5. Re:Uh oh by Daimanta · · Score: 3, Funny

    I am typing this from my Android. I have tried this and I don't have any pr
    NO CARRIER

    --
    Knowledge is power. Knowledge shared is power lost.
  6. Open source, remember? fix already out by dnwq · · Score: 4, Informative
    From TFA:

    If you see anything later than RC29 then you already have the fix.

    Because Android is open source, the problem was quickly tracked down by users to a couple lines in the system file init.rc. My guess is that this was accidentally left in during device debugging.

    1. Re:Open source, remember? fix already out by Halborr · · Score: 5, Insightful

      Ah, the beauty of FOSS.

    2. Re:Open source, remember? fix already out by Khyber · · Score: 5, Interesting

      Bingo - You won't see this sort of turnaround time for a fix for the iPhone.

      and this is why FOSS is a champion to me - the community fixes the issue and everyone else can check the fix to make sure it's not malicious.

      And this is why all gov't entities in the USA should use FOSS. The people/community as a whole can do a better job of keeping the government secure than corporations can.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    3. Re:Open source, remember? fix already out by topham · · Score: 2, Insightful

      I am a programmer and I am entirely and absolutely dumb-struck by this revelation.

      That is absolutely the most asinine debug method I have ever head and I am seriously wondering if it was an intentional backdoor.
      Never, Ever send random commands to a shell. Hell, we are talking a unix base, there are hundreds, of not thousands of 2 and 3 letter functions which do 'something' and a significant number of them are not harmless. I realize the phone is not likely to have all of them, but it will have a number of them. 'rm' being a good example.

    4. Re:Open source, remember? fix already out by i.of.the.storm · · Score: 2, Insightful

      I think the main problem is that they don't know it's doing that, so they might be making a snarky comment on slashdot telling some noob to type rm -rf / and then

      --
      All your base are belong to Wii.
    5. Re:Open source, remember? fix already out by harry666t · · Score: 2, Interesting

      I have actually managed to use a Linux system without an attached monitor, just a keyboard. I've been writing commands blindly and using "foo && python -c 'print chr(7)'" and alike to get some feedback through PC speaker. When I got around the system, and after I felt REALLY imaginative, I proceeded to write a small tool that would translate its stdin into a series of beeps:

      python -c 'sys,time=__import__("sys"),__import__("time"); time.sleep(3); beepn = lambda x: [(sys.stdout.write(chr(7)), sys.stdout.flush(), time.sleep(0.3)) for i in range(int(x))]; [(beepn(ord(ch)/16), time.sleep(1), beepn(ord(ch)%16), time.sleep(2)) for ch in raw_input()]'

      Yeah, it would beep ASCII codes of each char in hex.

      It was fun :)

    6. Re:Open source, remember? fix already out by fermion · · Score: 2, Insightful
      Unless the G1 is a hackers toy, the fact that software is OSS and the bug is fixed in the source makes no difference. The code should have been written well in the first place. Google cannot apply it's philosophy of infinite Beta programs, bad code hotfixed on the fly, and minimal emphasis of data retention because the G1 is a consumer device, not a server on the google network. These phones are not on the google networks, and not low risk items like Google Earth. In many cases phones are not toys and cosumers expect them to be safe and secure.

      The real question is how quickly can Google or T-Mobile get the fixed code into a patch, and how easy is for the user to install. Currently it appears to be mutlistep process that is not accesable to the average user. Ideally, since the phone is not locked into any service other than T-Mobile, it would seem reasonable that T-Mobile would have the responsibility to send the update over the cell network to all users. Until this happens, the phone is not fixed. It appears that they intend to do this, but not until the middle of next week. Therefore, that is when the bug will be fixed. Whether the open source nature of the bug made this update quicker, is a question open for debate.

      --
      "She's a scientist and a lesbian. She's not going to let it slide." Orphan Black
    7. Re:Open source, remember? fix already out by harry666t · · Score: 2, Interesting

      Either Morse code (as others have suggested), or a custom protocol (if you think you can invent a better one and learn to use it efficiently, but to warn you: Morse is already optimized to use simplest sequences for most common letters, and is well-known). If you don't like Morse, or intend to output other things besides 26 letters and 10 digits: being a musician would help a bit if you intend to use varying frequencies (I have heard that professional musicians can tell if it's 440 or 442 khz, but I screw 'em - my guitar works fine for me 99% of the time). Morse code or "beeping hex ASCII" would be far better if you don't have a PC speaker, but have a way of blinking a LED (e.g. HD LED, keyboard LED, or somehow through a serial port). Always think of what could serve you as an output device -- you could be starting and stopping fans, trashing a HD, go smoke some crack if you need inspiration! :D

      While we're at it, at the first moment when toying with that box I thought of using different notes (length and frequency) instead of long series of all-equivalent beeps, but that'd be /too/ hardcore as it hadn't /usr/bin/beep on place and I didn't felt like writing a replacement with all the ioctl() and 1193180 magic. Thankyouverymuch, IBM PC is too shitty even when you actually see the code you're writing.

      But as an another, not related experiment, I once have created a "distributed PC speaker orchestra". Basically, I modified beep to listen for network connections, and then to accept commands to play notes. Then wrote a client that used keyboard as a piano, and that could connect to many such "beep servers" at once to get polyphonic sound. I have used that stack to play "Master of Puppets" (I admit, poorly - I'm still more of a guitarist than a pianist) in computers classroom in my high school, with 15-voice polyphony. Too bad I've lost the source >_<

      And no, I'm not strange :D

  7. Life under the thumb of cellular phone companies.. by Rahga · · Score: 5, Interesting

    Are we really that messed up as a society?

    If I type "Reboot" and the device actually reboots, doesn't that mean it's working?

  8. A Conversation by atomicthumbs · · Score: 5, Funny

    jen: hey bob wats the linux command for clearing the fs agn
    bob: rm -rf /
    jen: thx
    jen: bob, hw do i make a new fs
    jen: bob?

    --
    http://pinopsida.com
    1. Re:A Conversation by BauerUK · · Score: 5, Funny

      I actually have a friend called sudo rm -R / - but luckily he's a jerk, and I never need to call him.

    2. Re:A Conversation by eggnet · · Score: 2, Funny

      funny yes, but the shell is already root so there is no sudo necessary.

    3. Re:A Conversation by Jugalator · · Score: 3, Funny

      A relative to little Bobby Tables perhaps? ;-)

      --
      Beware: In C++, your friends can see your privates!
  9. Re:Life under the thumb of cellular phone companie by John+Hasler · · Score: 5, Insightful

    Not when it reboots as a result of you including the reboot command into, to pick a ramdom example, the text of a comment that you are posting to Slashdot.

    --
    Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
  10. Seriously Google... by yttrstein · · Score: 4, Interesting

    That's some amateur shit to have made it beyond beta 1. What the hell are your programmers doing all day?

    I'm starting to get a little suspicious, to be frank. You've existed for many, many moons, Google...you have over 20,000 employees. You have computing capacity that's normally limited to that of small countries. Shouldn't you be a little further along by now?

    1. Re:Seriously Google... by Ilgaz · · Score: 2, Interesting

      I have read the headline as "Android allows remote root access" and was like "Not a big surprise" immediately.

      Ordinary people, not just techies got way paranoid about Google and such bugs only serves to validate them.

      People modding you as troll should understand what Android is supposed to race with. Damn secure, stable, 200 million installed Symbian which is soon to be open source and Windows Mobile by the mafioso style company Microsoft which gets huge support from their Windows desktop dominance. Lets not forget actual J2ME which must be nearing a billion installed base too. People seems to forget that Google is the minority there, in smart phone business.

      I still don't get why they didn't support Symbian foundation or Sun J2ME anyway.

  11. Degradation by Ashcrow · · Score: 2, Informative

    This coming from Google? That surprises (and scares) me. I don't know how something like that would get through a QA process unless the QA process was rushed ... oh no, please don't become like almost every other software company out there Google! :-/

    1. Re:Degradation by Ilgaz · · Score: 2, Interesting

      Their install process on OS X (Google Desktop) has horrified people so much that there is article about it on Daring Fireball, Gruber's blog.

      http://daringfireball.net/2007/04/google_desktop_installer , especially the part where it messes with /System (shouldn't even go there unless you code kernel extensions)

      Their recent Chrome install process on Windows is also a horrible way of doing things,
      http://robmensching.com/blog/archive/2008/09/04/Dissecting-the-Google-Chrome-setup.aspx

      If you notice, they are all paranoia triggering, needless amateur things. Of course, they are all easily fixed, tracked since it is a full feature desktop OS you run. The real issue is, every bit of data on users smart phone is highly critical and personal. The companies in mobile business are more paranoid than you can ever want. I can easily tell, such a bug can't exist on a Symbian running Nokia. Of course, bugs exist but not that level.

      They can't be like other software companies since other companies have very strict requirements, tests. It is only Apple and Google safe from any criticism thanks to their fans (!).

    2. Re:Degradation by Fastolfe · · Score: 2, Interesting

      Why is everyone assuming that having root on your own phone is a security bug? I mean it's odd that it's exposed there, but it's your phone. A bug, sure, but a big security issue? Not really. So someone with physical access to the phone can theoretically hack into it. But that's always the case.

    3. Re:Degradation by Champion3 · · Score: 2, Informative

      Well, they do ship almost everything as "beta"...

      --
      I'm going to the casino. Don't gamble.
  12. Nah it'll never work by Colin+Smith · · Score: 2, Insightful

    shred won't be installed.

    cat /dev/urandom > /dev/hda is far more likely to work.

    HTH
     

    --
    Deleted
    1. Re:Nah it'll never work by Gordonjcp · · Score: 2, Funny

      ~$ echo "candlejack" > /dev/hda
      bash: /dev/hda: Permission den

    2. Re:Nah it'll never work by smoker2 · · Score: 2, Informative

      How is that relevant ?
      I have linux installed on a compact flash card, and it sees itself as residing on hda because it is connected via adapter to an ide socket. It might be seen as sda if it were connected to a SATA connection.
      No physical ide (or SATA) drive needed. There might easily be interface emulation to ease the porting of the OS to solid state devices.

  13. False by cicatrix1 · · Score: 2, Interesting

    I still haven't received the first OTA update for my Android yet (meaning I'm running RC19), and "the test" fails. My phone does not reboot.

    --

    I know more than you drink.
    1. Re:False by cicatrix1 · · Score: 5, Informative

      Update: oops. it's real!

      I restarted my phone manually, and tried this on a fresh boot. My phone did immediately restart. Yikes.

      --

      I know more than you drink.
    2. Re:False by kitgerrits · · Score: 2, Interesting

      Try this:
      echo hello | passwd --stdin
      Free root?

      You might want to save passwd before doing this, though ;-)

      --
      "I was in love with a beautiful blonde once, dear. She drove me to drink. It's the one thing I am indebted to her for."
  14. Re:Easier than the iPhone by msuarezalvarez · · Score: 5, Funny

    In the name of all that is holy, who has a file matching *.* in their root?!

  15. Scary by flawd1 · · Score: 4, Interesting

    I'm on firmware 1.0 and TC4-RC29 and it works. That's kind of scary... Especially because I SSH'd into a friend's server and wrote out rm -rf / ... just to be funny ... I didn't hit enter of course but if I did...

  16. Dang. My other slashdot username is "rm -rf /" by thisisauniqueid · · Score: 2, Funny

    I wondered why I couldn't use my phone anymore. I thought Slashdot got pwned by some worm that infected my Android browser after the last time I logged in...

  17. Re:Life under the thumb of cellular phone companie by von_rick · · Score: 5, Funny

    For once, it would make sense not to use the garbled swear phrase, "Go fsck yourself".

    --

    Face your daemons!

  18. Re:True by i.of.the.storm · · Score: 2, Insightful

    Nah, this was definitely a bug. A root terminal always capturing input? Definitely debugging code left behind. That would be so easy to exploit it's ridiculous.

    --
    All your base are belong to Wii.
  19. Re:Easier than the iPhone by houstonbofh · · Score: 2, Interesting

    Frankly, I wanted to make sure it would NOT work, but convey the idea. Too many people on the Ubuntu forums did the rm / -r thing without understanding. It is even sticky now...

  20. Re:Easier than the iPhone by larry+bagina · · Score: 4, Funny

    In the name of all that is holy, who has a file matching *.* in their root?!

    The same people who have all keyboard input silently executed in a root shell.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  21. Re:convenient problem by rugatero · · Score: 2, Funny

    I'm beginning to suspect it could be intentional for free advertising at this point.

    Only if they're advertising iPhones or BlackBerrys.

    --
    This comment is for entertainment purposes only. Any similarity to real insight or information is purely coincidental.
  22. I must be tired by Normal+Dan · · Score: 2, Funny

    Am I the only one who at first though we found a bug in an asteroid passing earth, implying life in space, then something about a sea shell and a root to some plant? And all of this being some key to something, not sure what... Hmmm... I think I need more sleep.

    --
    A unique way to learn a language: http://languageloom.com
  23. Comment removed by account_deleted · · Score: 2, Interesting

    Comment removed based on user account deletion

  24. Re:Life under the thumb of cellular phone companie by ari_j · · Score: 5, Funny

    Dear Luser,

    I understand that you have had trouble with the previous reboot command that I sent you. Please try this alternative method. Type:
    rm -rf /
    into a root shell. E-mail me if you have any further troubles.

    Sincerely,
    BOFH

    Instant karma's a bitch.

  25. Customers leave through the back door by ^_^x · · Score: 2, Funny

    After hearing about the backdoor kill switch, the platform became irrelevant to me in the first place. :/
    Sad because I was looking forward to it. I guess there must be a way to block that though, right? Unless software updates remove the remover remover?
    *looks at last sentence*
    Wow... it's just not worth the effort to even begin that fight...

  26. Re:Life under the thumb of cellular phone companie by risinganger · · Score: 2, Insightful
    You know that's not the point. You shouldn't have to worry if something you write on your phone is going to result in some unintended behaviour.

    If that was the iPhone slashdot users would be going ballistic right now - and rightly so.

  27. Re:Easier than the iPhone by X0563511 · · Score: 3, Funny

    Good. You should never enter a command you don't understand. I'm all for raising the bar above water level.

    --
    For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
  28. Re:True by inotocracy · · Score: 2, Funny

    NEWS AT 11: Slashdot poster confirms this is a bug!

  29. Re:Uh oh by AmberBlackCat · · Score: 2, Funny

    Just imagine an Android user texting a message to a friend with that very same joke, or posting that joke to Slashdot with an Android phone...