App PIN code can be bypassed in Files iOS
The iOS Files app accepted an unlimited number of PIN attempts, so an attacker with the device in hand could brute-force the four-digit PIN and get into the app. Successful guessing leads to authentication bypass and access to the application.
- Triaged in 5 hours
- Fixed in 19 days
- Paid in 25 days
- Disclosed after 39 days
Summary by the program
Security advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-j8g7-88vv-rggv
The report
Hi Team,
Hope you are doing great.
Note: IoS APP Vs.: 4.9.1
I got a vulnerability in your applications via which an attacker is able to bypass the PIN. The attacker just need to bruteforce the 4 digit PIN as unlimited tries is accepted by the application, the attacker can simply do a bruteforce and access the application.
PoC:
Impact
Authentication Bypass leading to application access
What the report shows
The target is the Nextcloud iOS app, version 4.9.1, and the feature under test is the app's PIN lock. The researcher reports that the PIN can be bypassed because the application accepts an unlimited number of attempts at the four digit code. Because the application accepts unlimited attempts at the four digit code, an attacker who has the device in hand can brute force the PIN and get into the app.
The proof of concept is a screen recording of the brute force in progress:
The impact the researcher states is an authentication bypass leading to application access. The report does not include the number of attempts needed, any timing measurements, or the exact behaviour of the app between attempts. The program rated the issue low severity with a CVSS score of 2.3, classified it as improper authentication, and paid a bounty of 100.00 USD. The report was disclosed on 2023-12-18, and the program links to a security advisory.
Root cause
The report does not describe the implementation, so the root cause is not stated. A four digit PIN has only 10,000 possible values, so the only thing that makes it a meaningful secret is a limit on how many guesses an attacker gets. If the app accepts every attempt, the search space is small enough to walk through by hand or with automation. The report does not describe the implementation, so whether the counter is missing entirely or merely resets when the app restarts is not stated.
Impact
An attacker with access to an unlocked or stolen device, or one who can otherwise reach the app's PIN screen, can recover the PIN and open the application. That gives access to the application, which the researcher frames as authentication bypass leading to application access. The report frames the outcome as authentication bypass leading to application access and does not claim remote exploitation or access to other users' data.
How this kind of bug works
A PIN is a low entropy secret. Four digits give 10,000 combinations; six digits give a million. Neither is enough to resist an attacker who can make guesses quickly, so the security of the mechanism rests entirely on rate limiting and on the cost of each guess. When the check happens locally, the attacker controls the environment: they can retry as fast as the interface allows, restart the app to reset any in-memory counter, or automate input. When the check happens on a server, the server can count failures per account and per device, add increasing delays, and lock or wipe after a threshold.
The bug class is a missing or ineffective restriction on authentication attempts. It appears wherever a short secret guards a local resource: app PINs, screen locks, vault passwords, parental controls and backup encryption. The defences are straightforward: a persistent counter stored somewhere the attacker cannot trivially reset, exponential backoff, a hard limit followed by lockout or data wipe, and, where feasible, moving verification to a component the attacker does not control.
How to test for it
- Identify every place a short secret is checked: app launch PIN, re-authentication prompts, hidden sections, export or backup passwords.
- Enter a wrong value and note the response: error message, delay, counter display, any warning about remaining attempts.
- Repeat the wrong value many times in a row and watch for a threshold. A positive result is that the app keeps returning the same "incorrect" response indefinitely, with no growing delay and no lockout.
- Restart the app, force stop it, and, if you have a test device, reboot it. Then try again. A counter that resets on restart is a weaker but still valid finding.
- If the app stores state locally, inspect it on a test device you own to see whether the attempt count is persisted and whether it can be edited.
- Record the whole sequence on video, showing the wrong attempts and the eventual successful entry, so the reviewer can see the absence of a limit.
Common false positives: a delay that is present but short enough to miss in a quick manual test; a lockout that only triggers after a threshold you did not reach; a counter that is enforced server side but only after the device reconnects; and test builds or debug configurations that disable protections. Confirm the behaviour on a release build before reporting.
How it is fixed
The standard fix is a persistent attempt counter with a policy: after a small number of failures, introduce an increasing delay; after a larger number, lock the PIN entry or wipe local data, depending on the product's threat model. The counter must survive app restarts and must not be stored somewhere the attacker can reset without authentication. Where the architecture allows, verification should happen against a server that enforces the policy, with the client only displaying state. Fixes should also cover the re-authentication path, not just the launch screen, and should be tested against automation that enters guesses quickly.
Hunting notes
This bug class hides in client side security features: app PINs, screen locks, vaults, private browsing modes, parental controls and encrypted backups. Recon signals include any prompt that asks for a short numeric or alphanumeric code, any setting described as a "passcode" or "PIN", and any feature that claims to protect data locally. Mobile apps are a good hunting ground because the check often lives entirely in the client, and the platform's own lock screen may be the only thing standing between an attacker and the app.
A video is persuasive because it shows the absence of a lockout directly. Tie the impact to what the PIN protects, such as files or account sessions, and avoid overstating it as remote access when physical access is required.
What happened, in plain words
Nextcloud is a service for storing and sharing files, and it has a mobile app for iPhone and iPad. That app can be protected with a PIN: a short numeric code, four digits long, that you type when you open the app. The idea is that even if someone picks up your phone while it is unlocked, they still cannot read your files without knowing the PIN.
The researcher looked at version 4.9.1 of the iOS app and found that this protection can be defeated. The app accepts an unlimited number of PIN attempts, so nothing stops the person guessing. So an attacker holding the device can simply try codes one after another until the right one comes up, and then the app opens.
A PIN is a very small secret. Four digits means there are only 10,000 possible codes, from 0000 to 9999. If nothing limits how many guesses someone gets, walking through those combinations is not a serious obstacle. The PIN only works as a lock because of the limit on attempts, and here that limit is missing.
The proof of concept is a screen recording of the brute force in progress:
The impact the researcher states is an authentication bypass leading to application access. In plain terms: the check that is supposed to prove who you are can be skipped, and the person gets into the app. The report does not include the number of attempts needed, any timing measurements, or the exact behaviour of the app between attempts.
The program rated the issue low severity with a CVSS score of 2.3, classified it as improper authentication, and paid a bounty of 100.00 USD. The report was disclosed on 2023-12-18, and the program links to a security advisory.
In general, how this kind of bug works
A PIN is a low entropy secret. "Entropy" here just means how much guessing it takes to find the value. Four digits give 10,000 combinations; six digits give a million. Neither is enough to resist an attacker who can make guesses quickly, so the security of the mechanism rests entirely on rate limiting, meaning a cap on how often someone may try, and on the cost of each guess.
When the check happens locally, on the device itself, the attacker controls the environment: they can retry as fast as the interface allows, restart the app to reset any counter kept in memory, or automate the input. When the check happens on a server, the server can count failures per account and per device, add increasing delays, and lock or wipe after a threshold.
The bug class is a missing or ineffective restriction on authentication attempts. Authentication is simply the process of proving you are who you claim to be, like showing a passport at a border. It appears wherever a short secret guards a local resource: app PINs, screen locks, vault passwords, parental controls and backup encryption. The defences are straightforward: a persistent counter stored somewhere the attacker cannot trivially reset, exponential backoff (each wrong guess makes the next wait longer), a hard limit followed by lockout or data wipe, and, where feasible, moving verification to a component the attacker does not control.
How to test for it
- Identify every place a short secret is checked: app launch PIN, re-authentication prompts, hidden sections, export or backup passwords.
- Enter a wrong value and note the response: error message, delay, counter display, any warning about remaining attempts.
- Repeat the wrong value many times in a row and watch for a threshold. A positive result is that the app keeps returning the same "incorrect" response indefinitely, with no growing delay and no lockout.
- Restart the app, force stop it, and, if you have a test device, reboot it. Then try again. A counter that resets on restart is a weaker but still valid finding.
- If the app stores state locally, inspect it on a test device you own to see whether the attempt count is persisted and whether it can be edited.
- Record the whole sequence on video, showing the wrong attempts and the eventual successful entry, so the reviewer can see the absence of a limit.
Common false positives: a delay that is present but short enough to miss in a quick manual test; a lockout that only triggers after a threshold you did not reach; a counter that is enforced server side but only after the device reconnects; and test builds or debug configurations that disable protections. Confirm the behaviour on a release build before reporting.
How it is fixed
The standard fix is a persistent attempt counter with a policy: after a small number of failures, introduce an increasing delay; after a larger number, lock the PIN entry or wipe local data, depending on the product's threat model. The counter must survive app restarts and must not be stored somewhere the attacker can reset without authentication. Where the architecture allows, verification should happen against a server that enforces the policy, with the client only displaying state. Fixes should also cover the re-authentication path, not just the launch screen, and should be tested against automation that enters guesses quickly.
Hunting notes
This bug class hides in client side security features: app PINs, screen locks, vaults, private browsing modes, parental controls and encrypted backups. Recon signals include any prompt that asks for a short numeric or alphanumeric code, any setting described as a "passcode" or "PIN", and any feature that claims to protect data locally. Mobile apps are a good hunting ground because the check often lives entirely in the client, and the platform's own lock screen may be the only thing standing between an attacker and the app.
A video is persuasive because it shows the absence of a lockout directly. Tie the impact to what the PIN protects, such as files or account sessions, and avoid overstating it as remote access when physical access is required.
Glossary
- Authentication: the process of proving you are who you claim to be, such as entering a password or PIN.
- Authentication bypass: getting past an authentication check without supplying the correct secret.
- Brute force: trying many possible values one after another until the right one is found.
- Client: the software running on the user's own device, here the iOS app, as opposed to a server.
- Server: a computer run by the service provider that the app talks to over the internet.
- PIN: a short numeric code used as a secret, here four digits.
- Rate limiting: a cap on how many attempts or requests are allowed in a period of time.
- Lockout: blocking further attempts after a set number of failures.
- Exponential backoff: making the wait after each wrong guess grow, so guessing becomes slower and slower.
- Entropy: a measure of how much guessing is needed to find a secret; more entropy means a larger search space.
- Search space: the full set of possible values an attacker might try, such as the 10,000 four digit codes.
- Persistent counter: an attempt count that is saved and survives an app restart, rather than living only in memory.
- CVSS: a standard scoring system that rates the severity of a security issue, usually from 0 to 10.
- Improper authentication: a weakness category for flaws in how a system verifies identity.
- Proof of concept (PoC): a demonstration, often a video or set of steps, showing that the issue is real.
- False positive: a finding that looks like a bug but is not, for example because a protection exists but was missed during testing.
- Release build: the version of an app shipped to ordinary users, as opposed to a test or debug build.
- Threat model: the description of who might attack a product and what they could do, used to decide how strong a defence needs to be.