Google Pixel Lock Screen Bypass: The $70K SIM Swap
A race condition unlocked locked Pixel phones without a fingerprint or passcode, following a forgotten SIM PIN.
Published on masimshahzad.medium.com
A forgotten SIM PIN led David Schütz to a race condition that unlocked locked Pixel phones, no fingerprint or passcode. Google paid $70K
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is a case study of a publicly disclosed Android lock screen bypass on Google Pixel devices, found by David Schütz (xdavidhu) in 2022 and fixed as CVE-2022-20465. The affected feature is Android's lock screen and, more specifically, the stack of "security screens" that the platform layers on top of the primary authentication screen. Normally the lock screen demands the passcode or fingerprint before the home screen becomes reachable, and secondary prompts such as the SIM PUK prompt sit above that primary screen without being able to remove it.
The bug let a person holding a locked Pixel, with physical access and a SIM of their own that is locked by a PIN, reach the home screen without the owner's passcode or fingerprint. Google's November 2022 Android security bulletin rates it High (elevation of privilege, Android 10 to 13); NVD scores it CVSS 3.1 4.6 Medium, reflecting the physical access requirement. The Android VRP paid $70,000.

Setup
The researcher's starting point was his own phone and his own SIM. The precondition for the bypass is physical possession of a locked Pixel plus a SIM that is itself locked with a PIN, which the attacker controls. The report describes reproduction on a Pixel 6 and a Pixel 5. No accounts, tooling or special software are described; the trigger is the SIM PUK reset flow.
Finding it
Schütz reset his SIM using its PUK code after forgetting the SIM PIN. After that reset, the phone showed a fingerprint prompt straight after a reboot, when it should have demanded the passcode. That mismatch, a fingerprint prompt where the stronger passcode prompt belonged, was the first sign that the security screen stack was not behaving as designed.
The next day he repeated the SIM reset on a phone that was merely locked rather than freshly rebooted, and landed on his own home screen. The behaviour reproduced on both a Pixel 6 and a Pixel 5.
Exploitation
Reproduction steps are intentionally omitted, so what follows is the sequence of events rather than a payload walkthrough.
Step 1: Reset the SIM with its PUK
Using the PUK code to reset a PIN-locked SIM brings up the SIM PUK prompt. That prompt is a security screen stacked on top of the normal fingerprint or PIN screen.
Step 2: Let the PUK step succeed
When the PUK step succeeds, the PUK component asks the security screen stack to dismiss the current screen. The request does not say which screen it means; it is a dismiss of "whatever is on top".
Step 3: Race the SIM state watcher
Another component watching SIM state had already swapped the active screen back to the normal lock screen. The PUK component's dismiss call therefore hit the wrong target: it dismissed the real lock screen, and dismissing the real lock screen meant unlocking the phone.
Step 4: Observe the result
On a phone that was merely locked, the sequence ended on the home screen. On a freshly rebooted phone, the visible symptom was a fingerprint prompt where the passcode should have been required.
Root cause
The design mistake is an ambiguous command. The PUK flow asked the stack to dismiss the current screen without naming the screen type it wanted removed. Because a separate SIM state watcher could change the top of the stack between the PUK flow starting and its dismiss call arriving, the dismiss landed on the primary lock screen instead of the PUK screen. An analytical mapping of this bug gives CWE-362 (Race Condition) and CWE-305 (Authentication Bypass by Primary Weakness).
Existing defences did not stop it because the stack accepted a dismiss from a caller that no longer owned the top screen.
Impact
A lost or stolen Pixel was effectively open to anyone with a SIM tray tool and a SIM they controlled. That exposes personal data, authenticator apps, work profiles and anything else a lock screen is meant to protect. The condition is physical access plus an attacker-controlled PIN-locked SIM; the NVD score of 4.6 reflects that physical access requirement.
The disclosure path is part of the story. Triage took 37 minutes, then a month of silence ended with a duplicate verdict, effectively $0 against a $100,000 table maximum. Only after a live demo, a call and an October deadline did Google confirm his report was what triggered the fix, and pay $70,000 as an exception.
Fix
Android's fix made dismiss take the type of screen the caller wants removed, so the PUK flow can now only dismiss a SIM PUK screen. The defensive principles behind that change are:
- Name the target: a dismiss call must state which screen type it is allowed to remove.
- Treat stale callers as no-ops: if the top of the stack changed, the late caller does nothing.
- Fail closed on unlock: reaching an empty stack should still require proof that the owner authenticated.
The following pseudocode illustrates these principles:
# Pseudocode: a screen may only dismiss itself, never "whatever is on top"class SecurityStack: def dismiss(self, caller_mode, caller_id): with self.lock: top = self.stack[-1] if self.stack else None if top is None or top.mode != caller_mode or top.id != caller_id: audit("stale_dismiss_ignored", caller_mode) return False # late or wrong caller: no-op self.stack.pop() if not self.stack: # last screen gone -> unlock? if not self.owner_verified_since_lock(): self.push(PrimaryAuthScreen()) # fail closed return False unlock_device() return True# Test: SIM event swaps the top screen before the PUK flow finishes -> phone stays locked
The bug was fixed in the November 2022 Android security update.
Variants to test
- Other secondary prompts that can dismiss screens. Try SIM, Wi-Fi and accessibility prompts on Android builds and check whether any of them can close the primary authentication screen. A positive result is the home screen appearing, or a weaker prompt (fingerprint) appearing where the passcode should be required.
- State changes during a prompt. Trigger a prompt and, while it is open, cause a component that watches device state to swap the active screen. A positive result is the prompt's completion acting on the new top screen rather than its own.
- Dismiss calls without a target type. Look for any API in a security screen stack that dismisses "the current screen" without naming a type. A positive result is a caller removing a screen it did not create.
- Empty-stack unlock paths. Exercise flows that pop the last screen and check whether unlock still requires proof of owner authentication. A positive result is an unlock without that proof.
- Duplicate triage as a process test. Track reports that are closed as duplicates and check whether the fix that ships is attributed to the right report. A positive result is a fix landing while the originating report has no clear owner or timeline.
What happened, in plain words
Imagine you hand your locked phone to someone for a moment. They hand it back, and it is unlocked. They did not guess your PIN, they did not use your fingerprint, and they did not install anything. That is what David Schütz found on Google Pixel phones in 2022, and Google fixed it and paid him $70,000.
The trigger was surprisingly ordinary: a dead battery and a forgotten SIM PIN. A SIM is the small card a mobile network uses to recognise your phone and your number. A SIM PIN is a short code that locks the SIM itself, separate from the phone's own lock screen. If you forget that SIM PIN, the network gives you a longer rescue code called a PUK (Personal Unblocking Key) that lets you reset the SIM PIN.
Schütz used his PUK to reset his SIM PIN, and noticed the phone behaving strangely: it asked for a fingerprint when it should have asked for the stronger passcode. The next day he repeated the same reset on a phone that was simply locked, and ended up on his own home screen without ever unlocking it. The bug reproduced on a Pixel 6 and a Pixel 5.
Google tracked the flaw as CVE-2022-20465. A CVE is a public catalogue number for a known security flaw, so people can refer to the same bug unambiguously. The fix arrived in the November 2022 Android security update.

This is a case study of a public disclosure, not a discovery of my own. The point of reading it is to understand how a small ambiguity in software can turn into a full unlock, and what a good fix looks like.
The background you need first
Before the details make sense, a few ideas need to be clear.
The lock screen. When your phone is locked, the lock screen is the gate in front of everything else: your photos, your messages, your banking apps. To get past it you normally prove you are the owner, either with a passcode (a number or pattern you type) or with a fingerprint.
Authentication. Authentication is simply the act of proving who you are. A passcode and a fingerprint are two different ways of doing it. A passcode is generally considered stronger, because a fingerprint can in principle be copied or forced, while a passcode lives in your head.
A stack of screens. Android does not show just one lock-related screen. It keeps a stack, like a pile of cards. The main lock screen sits at the bottom. On top of it, Android can place secondary prompts: a message about the SIM, a Wi-Fi login request, an accessibility prompt. Only the top card is visible. When a card is removed, the one underneath becomes visible again.
A race condition. This is the heart of the bug, so it deserves a careful comparison. Imagine two people trying to update the same shared shopping list at the same time. One crosses off "milk" while the other is still reading the list, and the second person's next action lands on the wrong line. A race condition is exactly that: two parts of a program act on shared state at nearly the same moment, and the result depends on who gets there first. Usually the code assumes a certain order, and the real world does not always cooperate.
A component. Android is built from many separate pieces of software, called components, each doing one job. One component draws the lock screen. Another watches whether the SIM has changed. They run alongside each other, which is exactly the setup a race condition needs.
Dismissing a screen. When a prompt finishes its job, it tells the system to dismiss a screen, meaning remove it from the stack. The important question is: which screen? If the instruction says "remove whatever is on top", it depends entirely on what happens to be on top at that instant.
CWE and CVSS. CWE is a catalogue of weakness types, the categories that bugs fall into. CVSS is a scoring system that rates how serious a specific flaw is, from 0 to 10. Both are ways for the industry to talk about bugs consistently.
A bounty and a VRP. A bug bounty is a reward a company pays to someone who reports a security flaw responsibly instead of abusing it. Android's programme is called the Android VRP, short for Vulnerability Reward Program.
The setup
The starting point was the researcher's own phone and his own SIM. Nothing exotic was needed: no special software, no accounts, no tools beyond what a normal person has. The precondition for the bypass is physical possession of a locked Pixel plus a SIM that is itself locked with a PIN, which the attacker controls. In other words, the attacker needs to hold your phone and to bring their own locked SIM card.
The report describes reproduction on a Pixel 6 and a Pixel 5. The trigger is the SIM PUK reset flow, the same flow any customer uses after forgetting their SIM PIN.
Finding it
Schütz forgot his SIM PIN and reset the SIM using its PUK code. After that reset, the phone showed a fingerprint prompt straight after a reboot, when it should have demanded the passcode. That mismatch was the first clue: a fingerprint prompt where the stronger passcode prompt belonged meant the stack of security screens was not behaving as designed.
The next day he repeated the SIM reset, this time on a phone that was merely locked rather than freshly rebooted, and landed on his own home screen. The behaviour reproduced on both a Pixel 6 and a Pixel 5.
Why does this matter? Because a phone that has just rebooted is supposed to be extra strict. After a restart, Android normally refuses the convenience of a fingerprint and insists on the passcode, on the reasoning that a passcode is knowledge only the owner has. Seeing the weaker check where the stronger one belonged was a signal that something in the ordering of screens had gone wrong.
How the bypass worked, step by step
Reproduction steps are intentionally left out, so what follows is the sequence of events rather than a recipe.
Step 1: Reset the SIM with its PUK
Using the PUK code to reset a PIN-locked SIM brings up the SIM PUK prompt. That prompt is a security screen stacked on top of the normal fingerprint or PIN screen. Picture the main lock screen as the bottom card and the PUK prompt as a new card placed on top of it.
Step 2: Let the PUK step succeed
When the PUK step succeeds, the PUK component asks the security screen stack to dismiss the current screen. The request does not say which screen it means; it is a dismiss of "whatever is on top". This is the ambiguity at the centre of the bug. The PUK component knows which screen it created, but it does not name it when asking for removal.
Step 3: Race the SIM state watcher
Another component watching SIM state had already swapped the active screen back to the normal lock screen. Because two components were acting on the same stack at nearly the same moment, the PUK component's dismiss call hit the wrong target. It dismissed the real lock screen, and dismissing the real lock screen meant unlocking the phone.
In the shopping list comparison: one person crosses off an item, but by the time the pen reaches the paper, someone else has rewritten the list, and the cross lands on a different line. Here the "different line" was the primary lock screen, and removing it is the same as unlocking.
Step 4: Observe the result
On a phone that was merely locked, the sequence ended on the home screen. On a freshly rebooted phone, the visible symptom was a fingerprint prompt where the passcode should have been required. Two slightly different outcomes, both wrong, both traceable to the same ordering problem.
The root cause
The design mistake is an ambiguous command. The PUK flow asked the stack to dismiss the current screen without naming the screen type it wanted removed. Because a separate SIM state watcher could change the top of the stack between the PUK flow starting and its dismiss call arriving, the dismiss landed on the primary lock screen instead of the PUK screen.
An analytical mapping gives two weakness categories. CWE-362 is Race Condition, the timing problem just described. CWE-305 is Authentication Bypass by Primary Weakness, meaning the authentication check itself was defeated rather than worked around.
Existing defences did not stop it because the stack accepted a dismiss from a caller that no longer owned the top screen.
The impact
A lost or stolen Pixel was effectively open to anyone with a SIM tray tool and a SIM they controlled. A SIM tray tool is the small pin used to pop out the SIM card holder. That exposes personal data, authenticator apps, work profiles and anything else a lock screen is meant to protect. Authenticator apps deserve a mention: they are the apps that generate the short codes you type as a second step when logging in elsewhere, so access to them can cascade into access to many other accounts.
The condition is physical access plus an attacker-controlled PIN-locked SIM. That physical requirement is why NVD, the National Vulnerability Database that publishes CVSS scores, rated it 4.6 Medium even though Android's own bulletin rates it High for elevation of privilege on Android 10 to 13. Elevation of privilege simply means gaining more access than you are entitled to.
The disclosure path is part of the story. Triage took 37 minutes, then a month of silence ended with a duplicate verdict, effectively $0 against a $100,000 table maximum. A duplicate verdict means the report was treated as describing a bug someone else had already reported. Only after a live demo, a call and an October deadline did Google confirm his report was what triggered the fix, and pay $70,000 as an exception.
The fix
Android's fix made dismiss take the type of screen the caller wants removed, so the PUK flow can now only dismiss a SIM PUK screen. In the shopping list comparison, the instruction now says "cross off the milk" instead of "cross off whatever is at the top".
The defensive principles behind that change are:
- Name the target: a dismiss call must state which screen type it is allowed to remove.
- Treat stale callers as no-ops: if the top of the stack changed, the late caller does nothing. A no-op is an action that deliberately has no effect.
- Fail closed on unlock: reaching an empty stack should still require proof that the owner authenticated. Failing closed means that when in doubt, you deny access rather than allow it, like a door that locks when its power fails.
The following pseudocode illustrates these principles. Pseudocode is code written for humans to read, not for a computer to run; it shows the shape of the logic without the details of a particular programming language.
# Pseudocode: a screen may only dismiss itself, never "whatever is on top"class SecurityStack: def dismiss(self, caller_mode, caller_id): with self.lock: top = self.stack[-1] if self.stack else None if top is None or top.mode != caller_mode or top.id != caller_id: audit("stale_dismiss_ignored", caller_mode) return False # late or wrong caller: no-op self.stack.pop() if not self.stack: # last screen gone -> unlock? if not self.owner_verified_since_lock(): self.push(PrimaryAuthScreen()) # fail closed return False unlock_device() return True# Test: SIM event swaps the top screen before the PUK flow finishes -> phone stays locked
Line by line, in plain words:
- The first line is a comment saying the rule: a screen may only dismiss itself, never "whatever is on top".
class SecurityStack:declares a blueprint for the stack of security screens.def dismiss(self, caller_mode, caller_id):defines the dismiss action. It now requires two pieces of information: the type of screen the caller is (caller_mode) and which specific screen it created (caller_id).with self.lock:takes a lock, meaning only one caller can be inside this code at a time. This is the direct answer to a race condition: it removes the possibility of two components interleaving.top = self.stack[-1] if self.stack else Nonelooks at the top card, or records that there is none if the stack is empty.if top is None or top.mode != caller_mode or top.id != caller_id:checks whether the top card is missing, of a different type, or a different specific screen. If any of those is true, the caller is not the owner of the top screen.audit("stale_dismiss_ignored", caller_mode)writes a log entry recording that a late or wrong dismiss was ignored. An audit log is a record kept for later review.return Falsestops here without removing anything. This is the no-op for stale callers.self.stack.pop()removes the top card, but only after the checks passed.if not self.stack:asks whether the stack is now empty, which is the moment an unlock might happen.if not self.owner_verified_since_lock():checks whether the owner has actually proved who they are since the phone was locked.self.push(PrimaryAuthScreen())puts the main lock screen back if they have not, andreturn Falserefuses the unlock. This is failing closed.unlock_device()runs only when the owner has been verified.return Truereports that the dismiss succeeded.- The final comment describes the test: a SIM event swaps the top screen before the PUK flow finishes, and the phone stays locked.
The bug was fixed in the November 2022 Android security update.
Variants to test
If you are learning to look for this class of bug, these are directions worth testing. A positive result means you have seen the wrong screen removed or an unlock without proof.
- Other secondary prompts that can dismiss screens. Try SIM, Wi-Fi and accessibility prompts on Android builds and check whether any of them can close the primary authentication screen. A positive result is the home screen appearing, or a weaker prompt (fingerprint) appearing where the passcode should be required.
- State changes during a prompt. Trigger a prompt and, while it is open, cause a component that watches device state to swap the active screen. A positive result is the prompt's completion acting on the new top screen rather than its own.
- Dismiss calls without a target type. Look for any API in a security screen stack that dismisses "the current screen" without naming a type. An API is the set of commands one piece of software offers to another. A positive result is a caller removing a screen it did not create.
- Empty-stack unlock paths. Exercise flows that pop the last screen and check whether unlock still requires proof of owner authentication. A positive result is an unlock without that proof.
- Duplicate triage as a process test. Track reports that are closed as duplicates and check whether the fix that ships is attributed to the right report. A positive result is a fix landing while the originating report has no clear owner or timeline.
Key takeaways
- "Dismiss the current thing" is an ambiguous command, and race conditions love ambiguity.
- Secondary prompts such as SIM, Wi-Fi and accessibility prompts must never be able to close the primary authentication screen.
- Duplicate handling is part of security: the report that gets a fix shipped deserves a clear owner and timeline.
Glossary
- Android: the operating system that runs on most phones that are not iPhones, made by Google.
- API: the set of commands one piece of software offers to another so they can work together.
- Audit log: a record of events kept so they can be reviewed later.
- Authentication: the act of proving who you are, for example with a passcode or fingerprint.
- Authentication bypass: getting past a login or lock check without proving who you are.
- Authenticator app: an app that generates short codes used as a second step when logging in to other services.
- Bug bounty: a reward a company pays to someone who reports a security flaw responsibly.
- Component: one separate piece of software inside a larger system, each doing a specific job.
- CVE: a public catalogue number for a known security flaw, so people can refer to the same bug unambiguously.
- CWE: a catalogue of weakness types, the categories that bugs fall into.
- CVSS: a scoring system that rates how serious a specific flaw is, from 0 to 10.
- Dismiss: to remove a screen from the stack of screens the system is showing.
- Duplicate verdict: a decision that a report describes a bug someone else has already reported.
- Elevation of privilege: gaining more access than you are entitled to.
- Fail closed: when in doubt, deny access rather than allow it, like a door that locks when its power fails.
- Fingerprint prompt: a screen asking you to prove who you are with your fingerprint.
- Home screen: the main screen of a phone, reachable only after unlocking.
- Lock screen: the gate in front of everything on a locked phone, requiring proof of identity to pass.
- No-op: an action that deliberately has no effect.
- NVD: the National Vulnerability Database, which publishes CVSS scores for known flaws.
- Passcode: a number or pattern you type to prove who you are.
- Physical access: being able to hold and touch the device itself.
- Pseudocode: code written for humans to read rather than for a computer to run.
- PUK (Personal Unblocking Key): a longer rescue code from the mobile network that lets you reset a forgotten SIM PIN.
- Race condition: a bug where two parts of a program act on shared state at nearly the same moment, so the result depends on who gets there first.
- SIM: the small card a mobile network uses to recognise your phone and your number.
- SIM PIN: a short code that locks the SIM itself, separate from the phone's lock screen.
- SIM tray tool: the small pin used to pop out the SIM card holder.
- Stack: a pile of items where only the top one is visible, and removing the top reveals the one underneath.
- Triage: the first review of a report, where it is checked and sorted.
- VRP (Vulnerability Reward Program): Android's bug bounty programme.