• General
  • How to detect if Pixel device was compromised when going through customs?

I want to preface that i've read all the information about Auditor and Verified Boot but it is a little hard for me to apply the information to the following case:

Assume someone has a Pixel device with Stock OS and it is seized during an airport check. After the device is returned, they want to flash GrapheneOS but are unsure if the device is compromised.

How would they go about ensuring it is not compromised? Should Auditor be set up on Stock OS beforehand?

Obviously, after flashing GrapheneOS and finding that the verified boot key hash doesn't match then the device was compromised and likely won't even boot. This is the obvious scenario.

However, is there a way for the device to be compromised before flashing GrapheneOS in such a way that the verified boot key hash matches but the device is still compromised from the initial customs check? Will Auditor detect anything wrong if it was set up after this theoretical compromise has already taken place?

Is there a scenario where Android Verified Boot key matches but Auditor fails the check on GrapheneOS?

Assuming there is a scenario that exists like above, what would the next best step be? Re-flash GrapheneOS?

    When I travelled to Europe this year I installed Auditor with the Remote Attestation option -- see https://attestation.app/tutorial -- on my GOS Pixel, but I would think the same could be done in principle for a standard AOS phone, so long as Auditor can be installed onto it. Clearly, do this before any travel, so that the attestation is set up before any likely compromise.

    I set it to test every 24 hours, with a 72-hour limit for delays before alerts are emailed (which I think is the default anyway). Obviously, a masked email and a nonsense username are recommended. The message each day from Auditor saying that remote verification succeeded is a welcome thing ;-)

    DeletedUser88 Assume someone has a Pixel device with Stock OS and it is seized during an airport check. After the device is returned, they want to flash GrapheneOS but are unsure if the device is compromised.

    How would they go about ensuring it is not compromised? Should Auditor be set up on Stock OS beforehand?

    Great question, and very practical, especially for those traveling to countries with very involved/invasive checks like China and Israel.

    If after waiting in the airport security room after an hour is there also a way to check if a beacon or anything else hardware-wise was installed?

      K8y I think just flashing the device again will do.

      K8y they wouldnt need to install extra beacons beyond whatever the device already offers up freely to anyone with knowledge for how the BLE api seems to work.

      Tangentially: apparently when visiting in some countries there's a mandatory app to install. Is the regular Android sandbox sufficient, is setting a custom user container necessary, or is it game over as soon as the app is there ?

      DeletedUser88 Will Auditor detect anything wrong if it was set up after this theoretical compromise has already taken place?

      Software compromises (rootkits) shouldn't persist across Verified reboots.

      And of course, you'd want to factory reset to make sure anything that was installed to non-measured / non-Verified (at boot) parts to the OS (like apps) is blackholed.

      From what I can tell, if you suspect hardware compromises, then it is game over for that device.

      This ^^^.

      EU citizen. I don't like carrying electronics through customs, especially US, UK and AU customs. Phones and laptops have been searched by all three listed. It is not that the content is illegal. 34 white woman... I don't fit the demographics for child porn or terrorism. The content is simply private and proprietary and not for random dissemination. Loosing control of my devices they may as well be bricked so I prefer to leave electronics at home and pick up replacements at my destination.

      I assume if there is a persistent compromise while the Pixel is on Stock OS then the device will fail to boot as well due to verified boot?

        DeletedUser88 Verified boot prevents modifying the firmware or OS images without a sophisticated exploit to bypass verified boot for either the firmware or OS. It also prevents downgrading the firmware past a rollback version upgrade or downgrading the OS past a security patch level upgrade since that's used as the rollback version for the OS and gets incremented every month with each stock OS release in practice, other than a rare case they might do a YYYY-MM-05 security patch level release prior to a quarterly/yearly update with the same patch level later in the month. The hardware keystore rollback protection takes OS version into account though.

        An sophisticated exploit of verified boot of the OS could allow surviving factory reset from recovery but not flashing from fastboot mode. Surviving flashing the firmware/OS would require replacing fastboot mode with their own, implying having a lower-level verified boot exploit not only an exploit for OS verified boot performed by the firmware for the core OS and by the OS itself for the rest of the OS.

        This is theoretically possible but not something that is particularly likely to have even been developed to work against the stock Pixel OS in practice. How often do regular users even factory reset, let alone reflashing the OS from fastboot mode? It's an incredibly niche purpose for an exploit and it's much harder to develop than a local privilege escalation exploit for the OS. It's also probably harder to develop than a remote code execution exploit in most cases. They would need to find vulnerabilities in a far smaller amount of code which can be triggered while the device boots and verifies the early firmware and later OS images. It's even quite feasible that there are not vulnerabilities to exploit without physical tampering, unlike the massive attack surface of browsers and the OS. Most of the vulnerabilities in this niche would be a failure to implement the basics of verified boot properly rather than a typical memory corruption bug since there's so little attack surface. It's quite possible there are vulnerabilities but it's such a small amount of attack surface exposed by persistent state to the early firmware and OS while verifying.

          We've removed the completely unsubstantiated claims of a device running the stock Pixel OS being compromised in an incredibly deep way which bypassed verified boot through exploiting the early firmware verification process. No evidence of it has been provided or even an explanation of why the person believes their device is compromised. If they're being targeted with such sophisticated exploits, why are they aware of the device being compromised in the first place? How do they know it's happening? Many people come to us claiming their device was compromised and it turns out they lack any reason to think that and simply have a strong believe nearly any device they use is compromised based on running into things like minor UI bugs or higher battery drain than they expect. There are people actually being targeted with exploits but they would not typically be aware of it unless features caught the exploit happening or found signs of a payload reused to target many people with flaws allowing it to be detected.

          GrapheneOS Thank you for your answer. Would such a low-level verified boot exploit fail an Auditor attestation if Auditor was set up before the compromise? What about if Auditor was set up after the compromise?

            DeletedUser88
            Bluntly, if that level of exploit is used against you or a reasonable threat given your threat model then you are a direct national security target of a major nation.

            In which case, no one can realistically make any real promises and you likely have the resources to just burn that phone and get another.

            As a practical matter, a factory reset will take care of anything you actually have to worry about.

              JollyRancher Bluntly, if that level of exploit is used against you or a reasonable threat given your threat model then you are a direct national security target of a major nation.

              Oh such a compromise is definitely not within my threat model. Would like an answer for the sake of information is all.

              JollyRancher As a practical matter, a factory reset will take care of anything you actually have to worry about.

              What about the installing of hardware beacons that a former whistleblower warned certain countries do:

              https://www.businessinsider.com/nsa-tao-intercepting-packages-2014-5

              Journalists, diplomats and high profile individuals sometimes need to hand over their phones for a length of time when covering sensitive topics. This might be a silly question, but I don't suppose there's an app that scans if a beacon or some fishy non-Pixel hardware chip has been installed?

                K8y
                No software solution will detect that. Power draw is basically always variable enough, and those devices low power enough, that you aren't going to detect the tampering without a physical examination.

                GrapheneOS replacing fastboot mode with their own

                Would Verified Boot catch / detect the replaced fastboot image (or recovery image for that matter) and warn?

                GrapheneOS quite feasible that there are not vulnerabilities to exploit without physical tampering

                Interesting. Anyone aware of any form of publicly known physical tampering that has broken Verified Boot? Curious since the RoT/RoV are required to be "tamper resistant" and so the tampering must happen elsewhere?

                GrapheneOS Most of the vulnerabilities in this niche would be a failure to implement the basics of verified boot properly rather than a typical memory corruption bug since there's so little attack surface

                Unsure if what Christopher Wade demonstrated (not on Pixels) at DEFCON 31 qualifies, but it was pretty impressive to see: https://youtu.be/31xrNuH1RV4 / https://ghostarchive.org/varchive/31xrNuH1RV4