Project

General

Profile

Modem Isolation

Added by Tom Lewis almost 10 years ago

( Sorry for the long intro, skip below to "1st question: Modem Isolation" if you just want to get to the questions)

Hello Replicant project, I've been lurking around your site for some time, and really appreciate what you have achieved so far.

Systems Security is a bit of a hobby and passion for me, and currently I'm interested in applying & improving my mobile device security as so much personal & business information is now finding its way onto mobile devices.

I'd therefore like to ask a series of security questions I've compiled about Replicant's security environment, but will break the questions into separate posts to help others who
may look for similar answers in the future.
( Note: if these forums are not the appropriate venue for this discussion, I will take the conversation to any more appropriate medium as directed. )

As a general framework for this discussion I would like to say that I find the secretive backdooring of phones to be a moral hazard, as the original intended parties are certainly not the only ones who may ultimately access our phones, but all sorts of other parties intent on stealing, or destroying valuable confidential information.

1st question: Modem Isolation
I understand modem isolation is a security strategy to deal with the unmanageably complex, or inaccessible code of the independent modem, but assuming the modem cannot be trusted,
what attack vectors are available to the modem?

Are the modems in these Replicant compatible phones isolated enough that they would have to find a weakness in Replicant's Radio Interface ( the Samsung-RIL ?) in order to gain any further unauthorized access to the phone?

If the above is true, is this security environment because well isolated modems only have a physical connection to the main app processor and a limited amount of shared memory the
processor makes available for the modem to speak to (Essentially the app processor is able to mediate and ensure the modem can only speak directly with the RIL ?)

In a non-modem isolated phone, does the modem have more data channels that essentially let the modem choose on its own to address say the GPS chip, and therefore can try to hack or
access that peripheral without mediation of the app processor running Replicant?

These questions above are essentially to determine if there are any hard physical reasons, that the modems on some phones would be limited in the ways they could gain unauthorized
access to rest of the phone, thank you.


Replies (5)

RE: Modem Isolation - Added by Paul Kocialkowski almost 10 years ago

First off, I removed the original line breaking for easier reading.

These forums are the appropriate place for discussion and it's better to use them rather than a direct email: this way, others can read your question, provide answers and learn about answers that others posted.

The big picture is explained in details at: http://www.replicant.us/freedom-privacy-security-issues.php but I will try to cover specific aspects of your questions.

I understand modem isolation is a security strategy to deal with the unmanageably complex, or inaccessible code of the independent modem, but assuming the modem cannot be trusted, what attack vectors are available to the modem?
Are the modems in these Replicant compatible phones isolated enough that they would have to find a weakness in Replicant's Radio Interface ( the Samsung-RIL ?) in order to gain any further unauthorized access to the phone?

Modem isolation comes from the idea that we cannot trust what the modem does since it is running proprietary software and is connected to operators over the air. Hence, we are looking to find out what hardware it has access to and what this means for privacy/security. If the modem has direct access to storage, the GPS or the RAM, the implications for security are very bad. On the other hand, if it is only connected to the SoC through a dedicated channel, it has to rely upon the SoC's cooperation to access more hardware. This requires an explicit cooperation from the software running on the CPU. I don't see any way for the modem to use a weakness in Samsung-RIL to access more features.

If the above is true, is this security environment because well isolated modems only have a physical connection to the main app processor and a limited amount of shared memory the processor makes available for the modem to speak to (Essentially the app processor is able to mediate and ensure the modem can only speak directly with the RIL ?)

The best devices we support on this regard only have a USB-ish link between the modem and the SoC. Shared memory is very problematic for privacy/security, we consider it to be a fatal flaw.

In a non-modem isolated phone, does the modem have more data channels that essentially let the modem choose on its own to address say the GPS chip, and therefore can try to hack or access that peripheral without mediation of the app processor running Replicant?

It depends on each case, but basically, the modem could have hardware access to the GPS chip (sometimes, both are packaged together), to the storage, to RAM, to various I/O, etc. That would be transparent to the applications processor.

These questions above are essentially to determine if there are any hard physical reasons, that the modems on some phones would be limited in the ways they could gain unauthorized access to rest of the phone, thank you.

Good modem isolation is enough to ensure that the modem doesn't gain further hardware access. However, since free hardware doesn't exist yet, it is very hard to actually know for sure how isolated the modem really is.

RE: Modem Isolation - Added by Tom Lewis almost 10 years ago

Thank you Paul, for those thoughtful clarifications.

To go a little deeper on this topic of modem isolation, and how it affects the security environment:

(1) So in theory there are two basic attack vectors that would be available to an attacker that has complete control of the modem, the "OS" layer, where Replicant lives, and the Firmware layer, where because we have insufficient access to the code for the firmware and hardware design documentation, there exists the possibility of vulnerabilities at that firmware layer, is that correct?

(2) If the above is correct, essentially what the Replicant project had discovered before was that the stock "OS" layer of Samsung Galaxy phones had a method available in its interface to the modem that made access to the phones filesystem trivial, is that correct?

(3) If the above is correct, Replicant closed this easy access by the modem to the filesystem by writing its own open source interface to the modem which removed the offending method that granted this insecure access to the modem, is that correct?

RE: Modem Isolation - Added by Paul Kocialkowski almost 10 years ago

(1) So in theory there are two basic attack vectors that would be available to an attacker that has complete control of the modem, the "OS" layer, where Replicant lives, and the Firmware layer, where because we have insufficient access to the code for the firmware and hardware design documentation, there exists the possibility of vulnerabilities at that firmware layer, is that correct?

The modem could indeed either ask the system for access to more resources (e.g. SamsungGalaxyBackdoor) or access the hardware directly if it can. It's not really about vulnerabilities on the firmware layer, simply a matter of understanding that it can be remotely controlled over the air. Our knowledge of what the modem can actually access (modem isolation) cannot be proven to be limited to what we already know about, because the hardware documentation may not match the actual hardware. Nevertheless, if we have proof that it can access a component, it is definitive proof. What we cannot know for sure is that it cannot access a given device.

(2) If the above is correct, essentially what the Replicant project had discovered before was that the stock "OS" layer of Samsung Galaxy phones had a method available in its interface to the modem that made access to the phones filesystem trivial, is that correct?

Yes, the SamsungGalaxyBackdoor is a way for the modem to request file I/O through the regular communications interface with the CPU system. It implies the cooperation of the software running on the CPU system side, which is no longer the case when running Replicant and Samsung-RIL.

(3) If the above is correct, Replicant closed this easy access by the modem to the filesystem by writing its own open source interface to the modem which removed the offending method that granted this insecure access to the modem, is that correct?

I didn't write Samsung-RIL for that specific purpose: instead, I wrote it because we needed free software to talk with the modem. Not cooperating in abusing the user is a possibility that free software offers, as a consequence of freedom.

RE: Modem Isolation - Added by Tom Lewis almost 10 years ago

Hi Paul,

Thank you for your previous responses, they certainly clear up a lot. Unfortunately I typed a rather lengthy set of followup questions, that for some reason failed to post, and I lost them, so I will try to type a quicker follow up offline and post through to this page again.

(1) I wanted to understand where your knowledge of the hardware environments of these phones originates, do the phone manufacturers themselves release documents, and diagrams that for example detail the physical layout of data channels, or are there 3rd parties that provide such information?

(2) If the manufacturers themselves provide the information, wouldn't they be in significant legal trouble if they were releasing false diagrams as this would be deceptive towards the buyers? I know you're not a lawyer, but have you seen any such deception before?

(3) How isolated is the Galaxy S3 I9300's modem, from the rest of the phone, does the modem just have like a USB connection to the CPU, or does it for example connect to a chip that acts as a hub, and mediates access to all peripherals? What kind of documentation is your knowledge of the S3's hardware based on?

(4) Even if a phone has maximal modem isolation, and has just essentially a copper connection to the CPU ensuring all software level interaction between the modem and the rest of the phone was mediated by Replicant's Samsung-RIL interface, is the theoretical remaining attack vector that the mainCPU itself has proprietary firmware, and therefore even if the modem only had a connection to the CPU, the proprietary firmware in the CPU could have methods that allow the modem to communicate with peripheral chips in the phone, or read main memory, etc?

RE: Modem Isolation - Added by Paul Kocialkowski almost 10 years ago

Unfortunately I typed a rather lengthy set of followup questions, that for some reason failed to post, and I lost them, so I will try to type a quicker follow up offline and post through to this page again.

That's all right. In fact, I'm pretty sure that many people are wondering about the exact same things and I don't mine explaining this in depth once more. After all, part of our mission is also to spread the word about these issues!

(1) I wanted to understand where your knowledge of the hardware environments of these phones originates, do the phone manufacturers themselves release documents, and diagrams that for example detail the physical layout of data channels, or are there 3rd parties that provide such information?

The first, most reliable source we look at is the source code of free software that relates to the hardware. Mostly, the Linux kernel. From that, we were able to clearly deduct that e.g. The Nexus S (I902x) is using shared RAM to communicate with the modem. We can also deduce what protocols are used on other devices (e.g. that the Galaxy S 3 (I9300) is using HSIC, an USB-like link). Of course, when we find out about a transport mechanism, we cannot be sure that it is the only thing the modem is connected to. Sometimes, an overall understanding of how things works can help figure things out: if need to ask the modem for GPS coordinates, it's obvious that the modem has access to the GPS chip, if it's not incorporated in the chip at all. Then, we do look at hardware schematics of the devices. Those are usually called "Service Manuals" and contain some electrical wiring of the devices. Depending on each device and manufacturer, they are more or less precise. These are usually intended for repair shops (they are not available to the public), so they are leaked but usually easy to find online.

(2) If the manufacturers themselves provide the information, wouldn't they be in significant legal trouble if they were releasing false diagrams as this would be deceptive towards the buyers? I know you're not a lawyer, but have you seen any such deception before?

In any case, it is incredibly hard to verify the veracity of that information, in the sense that everything could be technically correct and match the software implementation, but there could be some hidden connections between the modem and other devices that wouldn't be described on that documentation and that we couldn't find out about. The only way to do so would be to trace the lines on the PCB, which is very complex and requires dedicated equipment and a spare device to destroy. So far, I haven't seen anything contradictory on the documentation we found about devices.

(3) How isolated is the Galaxy S3 I9300's modem, from the rest of the phone, does the modem just have like a USB connection to the CPU, or does it for example connect to a chip that acts as a hub, and mediates access to all peripherals? What kind of documentation is your knowledge of the S3's hardware based on?

I am going to document that properly on the wiki at some point in the future. The modem-CPU connection is HSIC, which is some form of high-speed USB. As far as I know, there is no hub and it's connected directly to the SoC, but that should be checked.

(4) Even if a phone has maximal modem isolation, and has just essentially a copper connection to the CPU ensuring all software level interaction between the modem and the rest of the phone was mediated by Replicant's Samsung-RIL interface, is the theoretical remaining attack vector that the mainCPU itself has proprietary firmware, and therefore even if the modem only had a connection to the CPU, the proprietary firmware in the CPU could have methods that allow the modem to communicate with peripheral chips in the phone, or read main memory, etc?

We don't call firmware the software that runs on the CPU. See DeveloperGuide. With Replicant, the software that runs on the CPU is free, except for the bootrom and the bootloaders, that are loaded prior to the system and shouldn't be running anymore once the kernel is started (that would have to be verified).

Also, once there is proprietary software running the CPU, the modem becomes irrelevant as an attack vector, as any program can just spy and collect data on its own without the need of the modem. This is why the software running on the CPU is actually the most important attack vector, hence why we believe a fully free system such as Replicant is important for privacy/security.

    (1-5/5)