Skip to content
Access control Write-up Beginner

Bypass Mobile PIN Verification

The mobile app stored its PIN verification hash in a shared preferences XML file, and deleting that file removed the PIN prompt entirely. An attacker with physical access to an unlocked or rooted device could bypass the PIN and open the app without knowing it.

Sourav Sahana Follow

Published on medium.com

Bounty$100 View original

Hi Hunters! again I’m here with another findings. The bounty of this bug is not enough but I’m still happy with this ¯\(ツ)/¯.

Sourav Sahana, on medium.com

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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the app treated the presence of a local PIN hash file as proof that a PIN had been set, so removing the file skipped the check instead of failing closed.

Impact

An attacker with physical access to the device could bypass the app's PIN and open it without knowing the code, though the report notes this required physical and root access.

What the attacker needed

Physical access to the device; root access or ADB debugging enabled

The fix

The app should fail closed when the PIN hash file is missing, for example by requiring re-authentication or treating a missing file as an invalid PIN rather than skipping the check.

How it was found

  1. Install the app and note the four-digit PIN prompt.
  2. Observe that no network request appears when entering the PIN, suggesting local storage.
  3. Use ADB to inspect the app's shared_prefs directory.
  4. Find an XML file containing a hash that changes when the PIN is changed.
  5. Delete that XML file.
  6. Reopen the app and see that no PIN is requested.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A PIN is a short number used to lock an app. This app checked the PIN by comparing it to a value saved in a file on the phone. If that file is deleted, the app has nothing to compare against, so it lets anyone in without asking for the PIN.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Sourav Sahana

View all

4 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.