Skip to content
Access control Disclosed report Beginner CVE-2019-5453

Extremly simple way to bypass Nextcloud-Client PIN/Fingerprint lock

The Nextcloud Android app's PIN or fingerprint lock can be bypassed because the app exposes its files through Android's system file manager. An attacker with physical access to an unlocked device can read and modify previously opened Nextcloud files without knowing the passcode or fingerprint.

volker_weissmann Follow

Originally disclosed on HackerOne

  • Paid in 3 months
  • Disclosed after 16 months

(I'm sorry for my bad English, I'm German) How to reproduce this security bug.

Step 1: Take a normal Android smartphone (maybe it also works on iOS, but I have not tested it yet). Step 2: Install the official nextcloud-client. Step 3: Set up nextcloud: Open the nextcloud app, tap on "Skip", enter the server-address, tap on "Grant access", enter username and password, tick the "Stay logged in" checkbox and tap on "Log in". If the OS asks you "Allow Nextcloud to access photos, media and files on your device?", tap on "ALLOW". Step 4: Open a directory within the nextcloud app with important, secret files. Step 5: Open the nextcloud app, tap on the hamburger button, enter the settings an switch either the "Passcode lock" or the "Fingerpring lock" option on. Close the nextcloud app

Now, nobody without this passcode or without this fingerprint can access the nextcloud-files, even if they have physical access to the device without screen lock. But I found a way to bypass this Passcode/Fingerprint lock: Step 6: Open nextcloud, but do not enter the passcode/do not put your finger on the fingerprint-scanner Step 7: Press the home button. (Nextcloud now runs in the background) Step 8: Open the default Android file manager (com.android.documentsui) Step 9: Tap on the hamburger menu, then tap on the nextcloud logo. Now you should see your nextcloud-files (Note: You can only see/read/modify a file, if you opened the directory with this file within the nextcloud-app at least once). This is a security bug, you shouldn't be able to access these files without the Passcode/Fingerprint lock. This makes the Passcode/Fingerprint lock a useless feature.

Note: If you once opened the secret file before, you can also access ist by opening /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/...

Impact

If an attacker has physical access to an Android smartphone without a screen lock, but with nextcloud installed and set up, he can easily access the nextcloud-files even if the nextcloud app is locked with a fingerprint or pin. This shouldn't be possible.

The original report as published on HackerOne, by volker_weissmann. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

The target is the official Nextcloud Android client, package com.nextcloud.client. The feature under examination is the app's local lock: the "Passcode lock" and the "Fingerprint lock" options in the app settings. When either is enabled, the app is supposed to require the passcode or a fingerprint before its contents can be viewed, so that someone holding an unlocked phone still cannot read the synced files.

The report shows that this lock can be bypassed through the Android system file manager, com.android.documentsui, which exposes the Nextcloud storage provider as a browsable location. The weakness was classified as information disclosure, rated low severity with a CVSS score of 2.1, and disclosed on 26 July 2019.

Setup

The researcher used a normal Android smartphone. The report notes that the issue may also affect iOS but that this was not tested. The only software involved is the official Nextcloud client, installed and configured against a Nextcloud server. No special tools, root access or modified build are required.

The precondition for the bypass is that the app has been set up and logged in with the "Stay logged in" option, that at least one directory containing the files of interest has been opened inside the app, and that either the passcode lock or the fingerprint lock has been switched on. The attacker in the impact scenario needs physical access to the device, and the device must not have a screen lock of its own.

Finding it

The researcher's starting observation is the intended behaviour: with the passcode or fingerprint lock enabled, nobody without the passcode or fingerprint should be able to reach the Nextcloud files, even with physical access to a device that has no screen lock. The files remained reachable through another component on the device, the system file manager, which lists the Nextcloud client as a storage provider.

A second observation concerns scope: a file is only exposed this way if its directory has been opened inside the Nextcloud app at least once. The report also notes that a file opened before can be reached directly through a path under /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/....

Exploitation

Step 1: Prepare the device

Take a normal Android smartphone. The report adds that it may also work on iOS, but that this was not tested.

Step 2: Install the client

Install the official Nextcloud client.

Step 3: Set up the account

Open the Nextcloud app, tap on "Skip", enter the server address, tap on "Grant access", enter username and password, tick the "Stay logged in" checkbox and tap on "Log in". If the operating system asks "Allow Nextcloud to access photos, media and files on your device?", tap on "ALLOW".

Step 4: Open a directory with the files of interest

Inside the app, open a directory that contains important, secret files. This step matters because, as noted above, a file only becomes visible through the file manager if its directory has been opened in the app at least once.

Step 5: Enable the lock

Open the Nextcloud app, tap on the hamburger button, enter the settings and switch either the "Passcode lock" or the "Fingerprint lock" option on. Then close the Nextcloud app.

At this point the expectation is that nobody without the passcode or the fingerprint can access the Nextcloud files, even with physical access to the device and no screen lock.

Step 6: Open the app without unlocking

Open Nextcloud, but do not enter the passcode and do not put a finger on the fingerprint scanner. The lock prompt is left unanswered.

Step 7: Send the app to the background

Press the home button. Nextcloud now runs in the background.

Step 8: Open the system file manager

Open the default Android file manager, com.android.documentsui.

Step 9: Browse to the Nextcloud provider

Tap on the hamburger menu, then tap on the Nextcloud logo. The Nextcloud files are now listed. The researcher notes that a file can only be seen, read or modified if the directory containing it was opened within the Nextcloud app at least once.

This is the bypass: the files are reachable without ever satisfying the passcode or fingerprint prompt, which makes the lock a useless feature in this scenario.

Direct path variant

The report adds a note: if a secret file was opened before, it can also be accessed by opening the following path.

Text
/storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/...

The report notes that a file opened before can also be accessed through this path.

Root cause

The report does not describe the client's code or the design of the storage provider, so the exact mechanism is not stated. The report does not describe the mechanism; the observed behaviour is that the files are reachable through the system file manager and through a path on storage. Any component that can read that provider or that path, such as the system file manager, therefore reads the files without ever meeting the lock. The lock did not prevent access to the files through the file manager.

Impact

An attacker with physical access to an Android smartphone that has no screen lock, but that has Nextcloud installed and set up, can access the Nextcloud files even when the app is locked with a fingerprint or PIN. The report states plainly that this should not be possible. The exposure is limited to files whose directory was opened in the app at least once, and to files previously opened via the direct path. The researcher's own framing is that the lock becomes a useless feature.

Fix

Variants to test

  1. Other Android apps that ship a local PIN or biometric lock together with a documents provider or a shared-storage export directory. A positive result is that the provider or directory lists the protected files while the app sits locked in the background.
  2. The same client on iOS, which the researcher explicitly did not test. A positive result is that a system file browser or share sheet reaches the files while the app lock is unanswered.
  3. Files whose directory was never opened in the app, to confirm the boundary the researcher describes. A positive result would be that such files are also listed, which would widen the exposure beyond the reported condition.
  4. The direct path under /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/... for files that were opened before, checked through a plain file browser rather than the documents UI.

Hunting notes

This class of bug hides in mobile apps that combine a local app lock with any second route to the same data: a documents provider, a media or export directory on shared storage, or a background service. During recon, the signal is an app that advertises a passcode or biometric lock as a privacy feature while also registering itself as a storage provider or writing files to a predictable path on the device. The test is cheap: enable the lock, leave the prompt unanswered, background the app, and open the system file manager.

The report gives a reproducible nine-step sequence with the exact UI labels, plus the boundary condition that a directory must have been opened in the app first. That combination shows a real, if narrow, loss of confidentiality without overstating it, which fits the low severity the program assigned.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 13 min read.

What happened, in plain words

Nextcloud is a service for storing your files on a server that you or your organisation control, a bit like a private version of Google Drive or Dropbox. To read those files on a phone, you install the official Nextcloud app. The app has a privacy feature: you can switch on a "Passcode lock" or a "Fingerprint lock", so that anyone who picks up your phone must type a PIN or scan a finger before the app shows your files.

The idea behind that feature is simple. Even if your phone has no screen lock at all, the Nextcloud app itself should keep your files private. The researcher found that this is not true. The same files can be reached through a completely different door on the phone: the built-in Android file manager, which lists the Nextcloud app as one of its storage locations. Open that file manager, tap the Nextcloud entry, and the files appear, with no PIN and no fingerprint ever asked for.

Think of it like a safe in a hotel room. The hotel puts a keypad on the safe door, but the same valuables are also sitting in an unlocked drawer next to it. The keypad looks reassuring and does nothing.

The report was rated low severity with a CVSS score of 2.1 and classified as information disclosure, meaning the problem is that data can be read by someone who should not be able to read it. It was disclosed on 26 July 2019. The app involved is the Android client, package com.nextcloud.client.

The product and the feature under test

The target is the official Nextcloud Android client. The feature being examined is the app's local lock: the "Passcode lock" and "Fingerprint lock" options in the app settings. When either is switched on, the app is supposed to demand the passcode or a fingerprint before its contents can be viewed. The point is that someone holding an unlocked phone still cannot read the synced files.

A passcode is a short numeric or text code you type. A fingerprint lock uses the phone's fingerprint sensor instead. Both are examples of authentication: proving to the app that you are the person allowed in.

The report shows that this lock can be bypassed through the Android system file manager, com.android.documentsui, which exposes the Nextcloud storage provider as a browsable location. A storage provider is a way for one app to offer its files to the rest of the phone, so that other apps can list and open them without knowing anything about how the first app stores them. The system file manager is the app that comes with Android for browsing files, the equivalent of Finder on a Mac or File Explorer on Windows.

Setting up the test

The researcher used a normal Android smartphone. The report notes that the issue may also affect iOS, Apple's phone operating system, but that this was not tested. The only software involved is the official Nextcloud client, installed and configured against a Nextcloud server. No special tools, root access or modified build are required. Root access means the highest level of control over a phone, normally reserved for the operating system itself; the fact that none is needed makes the finding more serious in practical terms, because anyone can repeat it.

Three things must be true before the bypass works:

  1. The app has been set up and logged in with the "Stay logged in" option.
  2. At least one directory containing the files of interest has been opened inside the app.
  3. Either the passcode lock or the fingerprint lock has been switched on.

The attacker in the impact scenario needs physical access to the device, and the device must not have a screen lock of its own. Physical access simply means holding the phone in your hand.

Finding it

The researcher started from what the app is supposed to do: with the passcode or fingerprint lock enabled, nobody without the passcode or fingerprint should be able to reach the Nextcloud files, even with physical access to a device that has no screen lock.

What looked wrong was that the app's lock only guards the app's own interface. The same files remain reachable through another component on the device, the system file manager, which lists the Nextcloud client as a storage provider. The lock is on the front door of one room, while the corridor outside has an open window into the same room.

A second observation concerns scope: a file is only exposed this way if its directory has been opened inside the Nextcloud app at least once. This is an important boundary. It means the app does not hand everything to the file manager at once; it makes files available as you browse them. The report also notes that a file opened before can be reached directly through a path under /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/....

Reproducing it, step by step

Each step below is taken from the report. The reason for each step is explained so you can see why the sequence matters, not just what to tap.

Step 1: Prepare the device

Take a normal Android smartphone. The report adds that it may also work on iOS, but that this was not tested. Using an ordinary phone matters because it shows the bug is not tied to a modified or unusual device.

Step 2: Install the client

Install the official Nextcloud client. Using the official app from the normal app store means the behaviour comes from the shipped product, not from a custom build.

Step 3: Set up the account

Open the Nextcloud app, tap on "Skip", enter the server address, tap on "Grant access", enter username and password, tick the "Stay logged in" checkbox and tap on "Log in". If the operating system asks "Allow Nextcloud to access photos, media and files on your device?", tap on "ALLOW".

The server address is the location of your Nextcloud server, the way a web address points at a website. "Grant access" is the app asking the server for permission to act on your behalf, and the username and password prove who you are. "Stay logged in" keeps you signed in between sessions, which is exactly the situation a normal user is in. The permission prompt about photos, media and files is Android asking whether the app may read and write files on the phone; allowing it is part of normal setup.

Step 4: Open a directory with the files of interest

Inside the app, open a directory that contains important, secret files. This step matters because, as noted above, a file only becomes visible through the file manager if its directory has been opened in the app at least once.

Step 5: Enable the lock

Open the Nextcloud app, tap on the hamburger button, enter the settings and switch either the "Passcode lock" or the "Fingerprint lock" option on. Then close the Nextcloud app.

The hamburger button is the three-line menu icon in the corner of many mobile apps. At this point the expectation is that nobody without the passcode or the fingerprint can access the Nextcloud files, even with physical access to the device and no screen lock.

Step 6: Open the app without unlocking

Open Nextcloud, but do not enter the passcode and do not put a finger on the fingerprint scanner. The lock prompt is left unanswered. This is the key move: the app is now in the state it is meant to protect, locked and waiting for you to prove who you are.

Step 7: Send the app to the background

Press the home button. Nextcloud now runs in the background. Backgrounding the app leaves it running but out of sight, which is the normal state of a phone app when you switch to something else. The lock is still unanswered.

Step 8: Open the system file manager

Open the default Android file manager, com.android.documentsui. This is the file browser that comes with Android. The point of this step is to leave the Nextcloud app entirely and approach the same files through a different app.

Step 9: Browse to the Nextcloud provider

Tap on the hamburger menu, then tap on the Nextcloud logo. The Nextcloud files are now listed. The researcher notes that a file can only be seen, read or modified if the directory containing it was opened within the Nextcloud app at least once.

This is the bypass: the files are reachable without ever satisfying the passcode or fingerprint prompt. The lock has been walked around rather than broken, which is why the researcher calls it a useless feature in this scenario.

The direct path variant

The report adds a note: if a secret file was opened before, it can also be accessed by opening the following path.

Text
/storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/...

This is a file path, the address of a file inside the phone's storage. Reading it from left to right: /storage/emulated/0/ is the main shared storage area on an Android phone, the place where photos, downloads and app data live. Android/media/ is a folder Android provides for app media. com.nextcloud.client is the Nextcloud app's package name, its unique identifier on the phone. nextcloud/ is the folder the app uses for its files. The ... at the end stands for the rest of the path down to the specific file.

The report notes that a file opened before can also be accessed through this path. In other words, a file opened before can also be reached through this path without going through the app.

Why it works

The report does not describe the client's code or the design of the storage provider, so the exact mechanism is not stated. The report does not describe the mechanism; the observed behaviour is that the files are reachable through the system file manager and through a path on storage.

A useful comparison is a shop with a locked front door and an open loading bay at the back. The lock is real, but it only covers one entrance. Any component that can read that provider or that path, such as the system file manager, therefore reads the files without ever meeting the lock. The lock did not prevent access to the files through the file manager.

Impact

An attacker with physical access to an Android smartphone that has no screen lock, but that has Nextcloud installed and set up, can access the Nextcloud files even when the app is locked with a fingerprint or PIN. The report states plainly that this should not be possible.

The exposure is limited to files whose directory was opened in the app at least once, and to files previously opened via the direct path. The researcher's own framing is that the lock becomes a useless feature. The program rated this low severity with a CVSS score of 2.1 and classified it as information disclosure.

Fix

In the shop comparison, the loading bay needs a lock too, not just the front door.

Variants to test

These are follow-up ideas in the same spirit, for anyone who wants to look for similar problems elsewhere.

  1. Other Android apps that ship a local PIN or biometric lock together with a documents provider or a shared-storage export directory. A positive result is that the provider or directory lists the protected files while the app sits locked in the background.
  2. The same client on iOS, which the researcher explicitly did not test. A positive result is that a system file browser or share sheet reaches the files while the app lock is unanswered.
  3. Files whose directory was never opened in the app, to confirm the boundary the researcher describes. A positive result would be that such files are also listed, which would widen the exposure beyond the reported condition.
  4. The direct path under /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/... for files that were opened before, checked through a plain file browser rather than the documents UI.

Hunting notes

This class of bug hides in mobile apps that combine a local app lock with any second route to the same data: a documents provider, a media or export directory on shared storage, or a background service. During recon, the signal is an app that advertises a passcode or biometric lock as a privacy feature while also registering itself as a storage provider or writing files to a predictable path on the device. The test is cheap: enable the lock, leave the prompt unanswered, background the app, and open the system file manager.

The report gives a reproducible nine-step sequence with the exact UI labels, plus the boundary condition that a directory must have been opened in the app first. That combination shows a real, if narrow, loss of confidentiality without overstating it, which fits the low severity the program assigned.

Glossary

  • Android: the operating system that runs on most phones that are not made by Apple.
  • API: a defined way for one piece of software to ask another for data or actions, like a service counter with a fixed list of requests it accepts.
  • App lock: a feature inside an app that asks for a PIN or fingerprint before showing the app's contents.
  • Authentication: proving who you are, for example with a password, a PIN or a fingerprint.
  • Background (app in the): an app that is still running but not on screen, because the user switched to something else.
  • Biometric lock: a lock that uses a physical characteristic, such as a fingerprint, instead of a typed code.
  • Bypass: getting past a protection without satisfying it, for example reaching files without entering the PIN.
  • Confidentiality: the property that data is only readable by people allowed to read it.
  • Cookie: a small piece of data a website or app stores on your device to remember who you are between visits.
  • CVSS score: a standard number from 0 to 10 that rates how severe a security flaw is; higher means more serious.
  • Documents provider: an Android component that lets one app offer its files to other apps, so they can be listed and opened.
  • com.android.documentsui: the package name of the file manager that comes with Android.
  • com.nextcloud.client: the package name of the official Nextcloud Android app, its unique identifier on the phone.
  • File manager: an app for browsing the files stored on a device.
  • File path: the address of a file inside storage, written as a sequence of folders ending in the file name.
  • Fingerprint lock: a lock that opens only after the phone's fingerprint sensor recognises a registered finger.
  • Hamburger button: the three-line menu icon found in the corner of many mobile apps.
  • Information disclosure: a weakness where data can be read by someone who should not be able to read it.
  • iOS: the operating system that runs on Apple's iPhones.
  • Nextcloud: software for storing and sharing files on a server you control, similar in purpose to Google Drive or Dropbox.
  • Package name: the unique identifier an app has on an Android phone, written in reverse-domain style such as com.nextcloud.client.
  • Passcode lock: a lock that opens only after the correct PIN or code is typed.
  • Physical access: being able to hold and use the device itself, as opposed to reaching it over a network.
  • PIN: a short numeric code used to unlock something.
  • Recon: the early stage of security testing where you look for signals that suggest where a weakness might be.
  • Root access: the highest level of control over an Android phone, normally reserved for the operating system.
  • Screen lock: the phone-wide lock (PIN, pattern or fingerprint) that guards the whole device, separate from any lock inside an app.
  • Severity: how serious a flaw is judged to be, often expressed as low, medium, high or critical.
  • Shared storage: the part of a phone's storage that many apps can read and write, as opposed to storage private to one app.
  • Storage provider: see documents provider; a way for an app to make its files available to other apps.
  • Token: a piece of data that stands in for a login, so software can prove it is allowed without resending a password each time.
  • UI (user interface): the screens and controls a person sees and interacts with in an app.
  • Vulnerability class: the category a weakness belongs to, such as information disclosure, which groups flaws with a similar cause or effect.

More from Nextcloud

View all

The newest disclosed reports for this program.

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.