com.nextcloud.client bypass the protection lock in andoid app v 3.18.1 latest version.
The Nextcloud Android app's password lock could be bypassed by repeatedly opening and backgrounding the app from the launcher's app-info screen. An attacker with physical access to an unlocked phone could then read the user's Nextcloud files.
Originally disclosed on HackerOne
- Triaged in 3 days
- Fixed in 37 days
- Paid in 3 months
- Disclosed after 3 months
Summary by the program
Advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-32j4-9xf3-h2mg
The report
Summary:
nextcloud allowed multiple account within the android client app on a single lock
Steps To Reproduce:
1.open nextcloud app 2.add security password to protect the app 3.close the app again open the app and now show the password to open the app
- so now the password protection bypass lets start 2.hold the nextcloud app and see the app info open it 3.Here the three option 1.open.2.uninstall and 3.force stop now click open button and now see the app lock protection in the app and now open app and back open and back between 3 to 4 time same procedure and now you will see the app lock protection bypass in nextcloud android app
Supporting Material/References:
[list any additional material (e.g. screenshots, logs, etc.)]
- [attachment / reference]
Impact
if an attacker has physical access to an android mobile without screen lock,but with nextcloud installed and set up,he can easily access the nextcloud-files.
regards:Javed Ahmad
Context
Nextcloud ships an Android client, com.nextcloud.client, that can be protected by a local app lock. The user sets a security password, and the app asks for it before showing the account and its files. The lock is meant to keep someone who picks up an unlocked phone away from the Nextcloud data stored in the app.
The report describes a way to get past that lock on version 3.18.1 of the Android client. The program rated it low severity (CVSS 1.1) under Improper Access Control, and a bounty of 200.00 USD was paid. The report was disclosed on 2022-04-30, and the program points to a published advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-32j4-9xf3-h2mg.
Setup
- Target: the Nextcloud Android app, package
com.nextcloud.client, version 3.18.1. - Precondition: Nextcloud is installed and set up on the device, and the app lock (security password) is enabled.
- The attacker in the impact scenario has physical access to the phone but no screen lock on the device itself.
- No special tools are described. The whole procedure is done through the Android launcher and the system app info screen.
Finding it
The report shows the app lock being bypassed by reopening the app from the app info screen and switching back and forth a few times. The summary states that Nextcloud allowed multiple accounts within the Android client on a single lock, and the reproduction shows the lock screen being skipped after the app is reopened from the app info screen and switched back and forth a few times.
Exploitation
Step 1: Set the app lock
- Open the Nextcloud app.
- Add a security password to protect the app.
- Close the app.
Reopening the app now shows the password prompt, which is the expected behaviour.
Step 2: Open the app from the app info screen
- Hold the Nextcloud app icon and open the app info screen.
- The app info screen offers three options: open, uninstall and force stop.
- Tap the open button.
The app lock protection is shown in the app at this point.
Step 3: Switch back and forth
Open the app and go back, then open and go back again, between three and four times, repeating the same procedure. After this, the app lock protection is bypassed and the Nextcloud content is reachable without the password.
The report does not describe any request, response, log or screenshot for these steps; the supporting material section only contains a placeholder for an attachment or reference.
Root cause
The report does not analyse the code. What it shows is that the lock check is not enforced consistently when the activity is brought back to the foreground through the app info screen's open action and then cycled in and out several times. The report does not explain why the lock is skipped. The report does not identify the specific component or flag involved.
Impact
If an attacker has physical access to an Android phone without a screen lock, but with Nextcloud installed and set up, they can easily access the Nextcloud files. The impact depends on that physical access and on the absence of a device screen lock; the report does not claim any remote exploitation.
Fix
The program's summary only links to the advisory GHSA-32j4-9xf3-h2mg.
Variants to test
- Repeat the app info open and back cycle on other versions of the Nextcloud Android client to see whether the bypass still occurs.
- Try the same cycle after force stop instead of open, and check whether the lock prompt appears on the next launch.
- Try the same pattern on other Android apps that offer a local app lock, entering through the app info screen and cycling foreground and background, and watch for the protected content appearing without a prompt.
- Try the cycle with the app reached from the recent apps list rather than the launcher, and check whether the lock is enforced.
Hunting notes
This kind of bug hides in local app locks and other client-side gates that depend on activity lifecycle events. During recon, look for apps that advertise a PIN or password lock for stored data, then test every way of entering the app: launcher icon, app info screen, recent apps, notifications and deep links. A positive result is the protected content being shown without the prompt after a few open and back cycles. The impact scenario is physical access to an unlocked phone with Nextcloud set up, which lets the attacker read the Nextcloud files.
What happened, in plain words
Nextcloud is a service for storing and sharing files, a bit like a private version of Google Drive or Dropbox that you or your organisation run yourselves. Besides a website, Nextcloud offers a mobile app for Android phones. That app is identified by a package name, com.nextcloud.client, which is simply the unique label Android uses to tell one app apart from another.
The Android app has a feature called an app lock. You set a security password inside the app, and from then on the app asks for that password before it shows your account and your files. The idea is simple: if you hand your phone to someone, or leave it on a table, the Nextcloud data inside the app stays behind that password. Think of it like a small safe inside a room: even if the room door is open, the safe should still need its own key.
The report describes a way to get past that safe on version 3.18.1 of the Android client. The report was filed under the Nextcloud program. and the program rated it low severity with a CVSS score of 1.1. CVSS is a standard scoring system for how serious a security flaw is; 1.1 is near the bottom of the scale, which fits a bug that needs someone holding your phone. A bounty of 200.00 USD was paid, and the report was disclosed on 2022-04-30. The program also points to a published advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-32j4-9xf3-h2mg, which the program links to..
The weakness is classified as Improper Access Control. That is a broad label for any situation where something is supposed to be restricted but the restriction can be sidestepped. Here the restriction is the app lock, and the sidestep is entering the app through a different door than usual.
The setup you need
Before any of this matters, a few things have to be true:
- The target is the Nextcloud Android app, package
com.nextcloud.client, version 3.18.1. - Nextcloud must already be installed and set up on the phone, with an account logged in.
- The app lock, meaning the security password inside the app, must be switched on.
- The attacker in the scenario has physical access to the phone, but the phone itself has no screen lock. A screen lock is the PIN, pattern or fingerprint that guards the whole phone; without one, anyone who picks the phone up can use it.
- No special tools are needed. Everything happens through the Android home screen and the system's app info screen.
That last point is worth pausing on. The app info screen is a normal Android settings page. If you press and hold an app icon on your home screen, Android usually offers a small menu, and one of the entries takes you to information about that app: its version, its permissions, and buttons to open it, uninstall it or force stop it. Force stop means telling Android to shut the app down completely. None of this requires hacking tools; it is part of the phone.
Finding it
The report shows the app lock being bypassed by reopening the app from the app info screen and switching back and forth a few times. The summary says that Nextcloud allowed multiple accounts within the Android client on a single lock, and the reproduction shows the lock screen being skipped after the app is reopened from the app info screen and switched back and forth a few times.
In plain terms: the app seems to check the password when you start it one way, but not when you arrive at it another way. The report does not dig into why. It just shows the sequence that produces the result.
Walking through the steps
Step 1: Turn the lock on
- Open the Nextcloud app.
- Add a security password to protect the app.
- Close the app.
When you open the app again now, it asks for the password. That is the correct, expected behaviour, and it is the baseline. You need this step first because you cannot demonstrate a bypass of a lock that was never switched on. It also proves the lock works normally, so anything that happens later is clearly abnormal.
Step 2: Come in through the app info screen
- Hold the Nextcloud app icon and open the app info screen.
- The app info screen offers three options: open, uninstall and force stop.
- Tap the open button.
At this point the app lock protection is shown in the app. So far, so good: the password prompt appears even when you enter this way. The interesting part is what happens next.
Why try this route at all? Because an app can be started from several places: its icon, the list of recently used apps, a notification, a link, or the system's own open button. Each of those can hand control to the app in a slightly different way, and a check that is wired to only one of those paths will be missing on the others. Testing every entrance is a standard habit when you look at client-side locks.
Step 3: Go back and forth
Open the app and go back, then open and go back again, between three and four times, repeating the same procedure. After this, the app lock protection is bypassed and the Nextcloud content is reachable without the password.
This is the core of the finding. The exact number of repetitions is described as between three and four. The report does not explain the mechanism, and it does not include any request, response, log or screenshot for these steps; the supporting material section only contains a placeholder for an attachment or reference.
Why this probably happens
A short detour into how Android apps work will make the idea easier to follow. An Android app is made of screens, and each screen is called an activity. Android does not let an app run forever in the background; it moves activities through states, such as visible, paused and stopped, and it can bring them back later. This movement is called the activity lifecycle. When you leave an app and return, Android may not rebuild the screen from scratch; it may simply bring the existing one back to the front.
A lock screen is therefore a check that has to run at the right moment. If the app only checks the password when it is first created, and not every time it comes back to the foreground, then a return through a path the developer did not consider can skip the check. The report does not analyse the code and does not identify the specific component or flag involved. What it shows is that the lock check is not enforced consistently when the app is brought back through the app info screen's open action and then cycled in and out several times. The report does not explain why the lock is skipped. That is an educated guess about the cause, not something the report proves.
What an attacker could do
If an attacker has physical access to an Android phone without a screen lock, but with Nextcloud installed and set up, they can easily access the Nextcloud files. That is the whole impact. It depends on two conditions: holding the phone, and the phone having no screen lock of its own. The report does not claim any remote exploitation, meaning nobody can do this over the internet from another country; they have to have the device in their hand.
It helps to separate the two layers. The phone's screen lock protects everything on the device. The app lock protects only the Nextcloud data inside the app. This bug removes the second layer, so if the first layer is also missing, the files are exposed. If the phone does have a screen lock, the attacker still has to get past that first.
The fix
The program's summary only links to the advisory GHSA-32j4-9xf3-h2mg. If you want to know what changed in the code, that advisory is the place to look.
Other things worth trying
Once you understand the shape of a bug like this, you can look for it elsewhere. These are variations on the same theme, not steps that were performed in the report:
- Repeat the app info open and back cycle on other versions of the Nextcloud Android client to see whether the bypass still occurs.
- Try the same cycle after force stop instead of open, and check whether the lock prompt appears on the next launch.
- Try the same pattern on other Android apps that offer a local app lock, entering through the app info screen and cycling foreground and background, and watch for the protected content appearing without a prompt.
- Try the cycle with the app reached from the recent apps list rather than the launcher, and check whether the lock is enforced.
Notes for anyone hunting similar bugs
This kind of bug hides in local app locks and other client-side gates that depend on activity lifecycle events. Client-side means the check happens on your own device, inside the app, rather than on a server somewhere. That matters because a check on your device can be influenced by how your device starts the app, while a check on a server cannot.
During recon, which is the exploratory phase where you get to know a target, look for apps that advertise a PIN or password lock for stored data. Then test every way of entering the app: launcher icon, app info screen, recent apps, notifications and deep links. A deep link is a web address that opens a specific screen inside an app rather than a page in a browser. A positive result is the protected content being shown without the prompt after a few open and back cycles.
The impact scenario is physical access to an unlocked phone with Nextcloud set up, which lets the attacker read the Nextcloud files.
Glossary
- Nextcloud: a self-hosted service for storing and sharing files, with a web interface and mobile and desktop clients.
- Android client: the Nextcloud app that runs on Android phones.
- Package name: the unique identifier Android uses for an app, here
com.nextcloud.client. - App lock: a password set inside an app that must be entered before the app shows its content.
- Screen lock: the PIN, pattern or fingerprint that guards the whole phone.
- Improper Access Control: a weakness where something meant to be restricted can be reached by a route that skips the restriction.
- CVSS: a standard scoring system for the severity of security flaws, where higher numbers mean more serious.
- Bounty: a payment made by a program to someone who reports a valid security bug.
- Disclosed: made public, usually after the vendor has had time to fix the issue.
- Advisory: an official published notice describing a security issue and its fix.
- App info screen: the Android settings page for a single app, offering actions such as open, uninstall and force stop.
- Force stop: an Android action that shuts an app down completely.
- Activity: a single screen inside an Android app.
- Activity lifecycle: the set of states an Android screen moves through, such as visible, paused and stopped, as the user switches around.
- Foreground: the state of being the app currently on screen and in use.
- Client-side: happening on the user's own device rather than on a server.
- Remote exploitation: attacking a system over a network from elsewhere, without physical access.
- Recon: the exploratory phase of security testing where you learn about a target and its features.
- Deep link: a web address that opens a specific screen inside an app instead of a page in a browser.
- Recent apps list: the Android overview of apps you have used lately, from which you can jump back into one.