Announcement

Collapse
No announcement yet.

Using flash memory as an attack vector

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Using flash memory as an attack vector

    Wow.

    On hacking MicroSD cards

    Today at the Chaos Computer Congress (30C3), xobs and I disclosed a finding that some SD cards contain vulnerabilities that allow arbitrary code execution — on the memory card itself. On the dark side, code execution on the memory card enables a class of MITM (man-in-the-middle) attacks, where the card seems to be behaving one way, but in fact it does something else....

    Flash memory is really cheap. So cheap, in fact, that it’s too good to be true. In reality, all flash memory is riddled with defects — without exception. The illusion of a contiguous, reliable storage media is crafted through sophisticated error correction and bad block management functions. This is the result of a constant arms race between the engineers and mother nature; with every fabrication process shrink, memory becomes cheaper but more unreliable. Likewise, with every generation, the engineers come up with more sophisticated and complicated algorithms to compensate for mother nature’s propensity for entropy and randomness at the atomic scale.

    These algorithms are too complicated and too device-specific to be run at the application or OS level, and so it turns out that every flash memory disk ships with a reasonably powerful microcontroller to run a custom set of disk abstraction algorithms. Even the diminutive microSD card contains not one, but at least two chips — a controller, and at least one flash chip (high density cards will stack multiple flash die).
    ...

    From the security perspective, our findings indicate that even though memory cards look inert, they run a body of code that can be modified to perform a class of MITM attacks that could be difficult to detect; there is no standard protocol or method to inspect and attest to the contents of the code running on the memory card’s microcontroller. Those in high-risk, high-sensitivity situations should assume that a “secure-erase” of a card is insufficient to guarantee the complete erasure of sensitive data. Therefore, it’s recommended to dispose of memory cards through total physical destruction (e.g., grind it up with a mortar and pestle).

    #2
    I read this somewhere else... I never realised that so many small components in a computer can (and are supposed to) run their own code.

    Could this be used to infect a machine with malware, or is it limited to MITM attacks?
    samhobbs.co.uk

    Comment


      #3
      Originally posted by Feathers McGraw View Post
      Could this be used to infect a machine with malware, or is it limited to MITM attacks?
      Dunno. But usually one vector leads to another. Attackers are clever.

      Originally posted by Feathers McGraw View Post
      I read this somewhere else... I never realised that so many small components in a computer can (and are supposed to) run their own code.
      Exercise for you: exactly how many different operating systems do you think are running on any given Android device? If you think the answer is 1, you'd be wrong. Go Googling for a while.

      Comment


        #4
        Originally posted by SteveRiley View Post
        Exercise for you: exactly how many different operating systems do you think are running on any given Android device? If you think the answer is 1, you'd be wrong. Go Googling for a while.
        Well, I know android devices run something like a modified Linux kernel with a Java VM on top... so that's two. The way you posed the question makes me think there are more, though!
        samhobbs.co.uk

        Comment


          #5
          Keep looking

          Comment


            #6
            Well, can't your provider use the sim card to execute arbitrary code on your device?

            Something I'm aware of, but don't really understand. Is that one of them?
            samhobbs.co.uk

            Comment


              #7
              Hint: "mobile phone baseband"

              Comment


                #8
                Hints hurt my brain

                Care to be more specific about what-where-how
                Since this is not something we can control, short of simply not using the technology, what do you see as a way to address the possible problems this could (will) cause?

                Curious minds want to know...
                Kubuntu 24.04 64bit under Kernel 6.10.2, Hp Pavilion, 6MB ram. All Bow To The Great Google... cough, hack, gasp.

                Comment


                  #9
                  Interesting!

                  So, is that it or are there more? Does the bootloader count as an OS?
                  samhobbs.co.uk

                  Comment


                    #10
                    Originally posted by Feathers McGraw View Post
                    So, is that it or are there more? Does the bootloader count as an OS?
                    Sure. It has all the attributes of an operating system: access to files, display drivers, peripheral drivers, etc.

                    On Android phones, the recovery is yet another operating system. In fact, it's a miniature Android, complete with an Android kernel.

                    Originally posted by TWPonKubuntu View Post
                    Care to be more specific about what-where-how
                    Since this is not something we can control, short of simply not using the technology, what do you see as a way to address the possible problems this could (will) cause?
                    As I wrote earlier, Google is your friend. To completely understand the software inside your mobile phone pocket computer, you would need to invest several hours reading. The Android developers web site is a good place to start. Also the XDA Developers wiki.

                    In some cases, we simply have to live with the tiny little black boxes in our phones. Yes, you can replace the primary OS (Android) and you can replace the recovery (TWRP and CWM Recovery). You can't easily replace the bootloader. You can't at all replace the baseband -- this is always a compiled binary that has copyrighted code specific to the radio in the phone. Even parts of the primary OS contain binary blobs, like the hotplug driver for the CPU; Qualcomm is particuarly guilty of this.

                    Comment


                      #11
                      Crystal ball time:

                      How long until there's a FLOSS network to replace the need for proprietary baseband, or WiFi coverage is so ubiquitous that we simply don't need it because we can use other technologies?
                      samhobbs.co.uk

                      Comment


                        #12
                        Isn't that how Studnex got into the Iranian centrifuges?

                        Anyway, Jacob Applebaum, in the 1 hour long keynote at that congress, mentioned SD cards and USB sticks.
                        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                        – John F. Kennedy, February 26, 1962.

                        Comment


                          #13
                          Originally posted by Feathers McGraw View Post
                          WiFi coverage
                          And for what reason do you trust the carriers more than you trust proprietary baseband blobs?

                          Comment


                            #14
                            In everything, caveat emptor! Trust should never be assumed, but sought out and earned.
                            Windows no longer obstructs my view.
                            Using Kubuntu Linux since March 23, 2007.
                            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                            Comment


                              #15
                              The carrier's stuff happens outside my device. If everything is encrypted before it leaves my device, then I can be reasonably sure that my commutations are secure. The binary blob, however, runs on my tablet/phone. Fsck knows what it's doing as well as what it's supposed to be doing!
                              samhobbs.co.uk

                              Comment

                              Working...
                              X