Gallery: No feedback for invalid password
When the Gallery plugin is used together with the Password Policy plugin, setting a password that breaks the policy silently fails, yet the interface gives the same feedback as a successful password set. A user could therefore believe a shared file is password-protected when it is actually publicly accessible.
- Paid in 8 months
- Disclosed after 9 months
CVSS
Low 3.1 CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N
Description
The Gallery plugin does not inform a user when password-protecting a file failed in combination with the Password Policy plugin. Because of this, files that the user will rightfully assume to be password-protected are actually publicly accessible.
POC
Prerequisite: Enable Gallery and Password Policy plugins & upload an image
View the image in the Gallery:
http://192.168.0.103/nextcloud/nextcloud/index.php/apps/gallery/#dummy_192x192.png
Now click on "Share" -> "Share link" -> "Password protect" and enter a password that is in violation of the password policy (for example vjhtdf68).
The password will not actually be applied, as it violates the policy. However, the feedback is exactly the same as when a password is successfully set; there is no error message.
A user will now think that the file is password-protected while it is actually publicly accessible.
Solution
The error should be visibly shown, so that a user is aware that no password is set (the same way as is currently already happening in the main file view when setting a password).
Impact
accidental disclosure of files which should be password protected.
Context
Nextcloud is a self-hosted file sync and sharing platform. Its Gallery plugin adds a browsing interface for images, and from that interface a user can share a file by link and protect the link with a password. The Password Policy plugin enforces rules on passwords, including the password set on a share link.
The report describes what happens when those two plugins meet: the Gallery interface does not tell the user that applying a password failed because the password violated the policy. The share is then left without a password while the user believes it is protected.
The weakness is classified as a business logic error, rated Low with a CVSS 3.0 vector of CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N, and was disclosed on 27 July 2019 with a 50.00 USD bounty.
Setup
The prerequisites are stated directly in the proof of concept:
- Enable the Gallery plugin.
- Enable the Password Policy plugin.
- Upload an image.
No accounts, roles, versions or tools beyond that are described. The proof of concept uses a local Nextcloud installation reached at [redacted] under the path /nextcloud/nextcloud/.
Finding it
The researcher combined the Gallery and Password Policy plugins. The Password Policy plugin rejects a password that does not meet the policy, and the main file view already shows an error when that happens. The Gallery view, however, gives the same feedback whether the password was applied or rejected. A user who sets a weak password in the Gallery therefore has no way to know that the file is still publicly accessible.
Exploitation
Step 1: open the image in the Gallery
With both plugins enabled and an image uploaded, the researcher viewed the image in the Gallery at:
http://[redacted]/nextcloud/nextcloud/index.php/apps/gallery/#dummy_192x192.png
Step 2: start a password-protected share link
In the Gallery, the researcher clicked "Share", then "Share link", then "Password protect".
Step 3: enter a password that violates the policy
The password entered was vjhtdf68, which is in violation of the password policy. The report does not state which specific policy rule it breaks.
Step 4: observe the missing feedback
The password is not actually applied because it violates the policy. The feedback shown, however, is exactly the same as when a password is successfully set: there is no error message. The user is left believing the file is password-protected while it is publicly accessible.
Root cause
The Gallery interface does not surface the failure returned when the password policy rejects the password. The report frames this as a missing error message rather than a failure of the policy itself: the policy does reject the password, but the Gallery view does not communicate that outcome. The report notes the main file view already shows the error when setting a password. Why the Gallery view discards or fails to display that result is not described in the report.
Impact
The impact is accidental disclosure of files that should be password protected. A user who sets a weak password in the Gallery reasonably assumes the share is protected, but the file remains publicly accessible to anyone with the link. The CVSS vector reflects this: network attack vector, high attack complexity, no privileges required, user interaction required, unchanged scope, low confidentiality impact, and no integrity or availability impact.
Fix
The report's proposed solution is that the error should be visibly shown, so that a user is aware that no password is set, in the same way as is currently already happening in the main file view when setting a password. The report does not state what change was actually made.
Variants to test
- Other share dialogs and plugins: set a policy-violating password from any interface that can protect a share, and check whether an error is shown. A positive result is a share that appears protected but opens without a password.
- Other validation failures: trigger any other rejection during share creation (for example a rejected password for a different reason) and check whether the interface reports it. A positive result is a silent failure that leaves the share in a less protected state than the UI suggests.
- Consistency between views: compare the same action in the main file view and in alternative views. A positive result is one view reporting the error and another staying silent.
Hunting notes
This kind of bug hides where two features are combined: a policy or validation component and a separate UI that calls it. During recon, look for installations with multiple plugins enabled and compare how each interface reports the same failure. The signal is a UI that gives identical feedback for success and failure.
What happened, in plain words
Nextcloud is a piece of software you can install on your own server to store and share files, a bit like running your own private version of Google Drive or Dropbox. It has extra features called plugins (also called apps) that add new abilities. Two of those plugins are involved here:
- The Gallery plugin adds a photo-browsing view for your images.
- The Password Policy plugin enforces rules about what passwords are allowed.
When you share a file in Nextcloud, you can create a share link: a web address that anyone can open to see the file. You can also put a password on that link, so only people who know the password can open it.
The bug is simple to describe. In the Gallery view, when you try to put a password on a share link and the password breaks the Password Policy rules, the password is not actually applied. But the Gallery gives you exactly the same feedback as if it had worked: no error message at all. So you walk away thinking the file is protected by a password, when in fact anyone with the link can open it.
The report calls this a business logic error. That is a category of security problem where the software does what it is programmed to do, but the rules of the real-world process it is meant to support are broken. Nothing crashes and no technical barrier is bypassed; the application simply lets a situation arise that should not be possible, here a share that looks protected but is not.
The issue was rated Low severity, with a CVSS 3.0 score of 3.1. CVSS is a standard way of scoring how serious a security issue is; a vector string like CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N is just a compact record of the individual judgements that produced the score. The report was disclosed on 27 July 2019 and the researcher received a bounty of 50.00 USD.
Setup
The proof of concept lists three prerequisites, and nothing else:
- Enable the Gallery plugin.
- Enable the Password Policy plugin.
- Upload an image.
The report does not mention any particular Nextcloud version, user role, account type or extra tool. The test was run on a local Nextcloud installation, reached at the address [redacted] under the path /nextcloud/nextcloud/.
Finding it
The researcher noticed that two features each work correctly on their own, but behave inconsistently when combined.
- The Password Policy plugin does its job: it rejects a password that does not meet the rules.
- The main file view already shows an error message when setting a password.
- The Gallery view does not. It shows the same result whether the password was accepted or rejected.
That difference is the whole finding. A user who sets a weak password from the Gallery has no way to learn that the file is still open to anyone with the link.
Exploitation
Step 1: open the image in the Gallery
With both plugins enabled and an image uploaded, the researcher opened the image in the Gallery using this address:
http://[redacted]/nextcloud/nextcloud/index.php/apps/gallery/#dummy_192x192.png
Reading the address piece by piece:
http://is the protocol, the set of rules a browser uses to talk to a web server.[redacted]is the address of the machine running Nextcloud on the local network./nextcloud/nextcloud/is the folder path where Nextcloud is installed on that machine./index.php/apps/gallery/tells Nextcloud to load the Gallery app.index.phpis the main entry script that many web applications use to handle requests.#dummy_192x192.pngis the part after the#symbol, called the fragment. Browsers do not send the fragment to the server; it is used by the page itself. Here it tells the Gallery which image to show, the uploaded filedummy_192x192.png.
Opening this address simply displays the image inside the Gallery interface, which is where the sharing controls live.
Step 2: start a password-protected share link
Inside the Gallery, the researcher clicked Share, then Share link, then Password protect. These are ordinary buttons in the interface: the first opens the sharing options, the second creates a link that anyone can use, and the third is meant to add a password to that link.
Step 3: enter a password that violates the policy
The password entered was:
vjhtdf68
This password breaks the rules enforced by the Password Policy plugin. The report does not say which specific rule it breaks, only that it is in violation of the policy.
Step 4: observe the missing feedback
Because the password breaks the policy, it is not actually applied to the share. The important part is what the user sees: the feedback is exactly the same as when a password is successfully set. There is no error message, no warning, nothing to suggest that anything went wrong.
The user therefore believes the file is password-protected, while in reality it is publicly accessible to anyone who has the link.
Root cause
The Gallery interface does not show the failure that comes back when the Password Policy plugin rejects the password. The report treats this as a missing error message, not as a failure of the policy itself: the policy does reject the password, but the Gallery view does not pass that outcome on to the user. The main file view already shows the error in the same situation, so the Gallery view is the part that behaves inconsistently.
Impact
The impact is accidental disclosure of files that should be password protected. A user who sets a weak password in the Gallery reasonably assumes the share is protected, but the file stays publicly accessible to anyone with the link.
The CVSS vector records the same picture in shorthand:
AV:Nmeans the attack can happen over a network.AC:Hmeans attack complexity is high: success depends on conditions outside the attacker's control.PR:Nmeans no privileges are required on the target system.UI:Rmeans user interaction is required: a user has to perform the actions that create the unprotected share.S:Umeans the scope is unchanged: the impact stays within the same security authority.C:Lmeans a low confidentiality impact: some information may be exposed.I:NandA:Nmean no impact on integrity (data being changed) and no impact on availability (the service being usable).
In practice, exploitation depends on a user choosing a password that breaks the policy in the Gallery and then sharing the link.
Fix
The report's proposed solution is that the error should be visibly shown, so that a user is aware that no password is set, in the same way as is currently already happening in the main file view when setting a password.
Variants to test
- Other share dialogs and plugins. Set a policy-violating password from any interface that can protect a share, and check whether an error is shown. A positive result is a share that appears protected but opens without a password.
- Other validation failures. Trigger any other rejection during share creation, for example a rejected password for a different reason, and check whether the interface reports it. A positive result is a silent failure that leaves the share in a less protected state than the interface suggests.
- Consistency between views. Compare the same action in the main file view and in alternative views. A positive result is one view reporting the error and another staying silent.
Hunting notes
This kind of bug hides where two features are combined: a policy or validation component and a separate interface that calls it. During reconnaissance, look for installations with multiple plugins enabled and compare how each interface reports the same failure. The signal is an interface that gives identical feedback for success and failure.
Glossary
- Nextcloud: self-hosted software for storing and sharing files, similar in purpose to cloud storage services.
- Plugin (app): an optional add-on that gives a piece of software extra features.
- Gallery plugin: a Nextcloud add-on that provides a photo-browsing view.
- Password Policy plugin: a Nextcloud add-on that enforces rules on what passwords are allowed.
- Share link: a web address that lets anyone who has it open a file or folder.
- Password-protected share: a share link that requires a password before the content can be opened.
- Business logic error: a security weakness where the software follows its code but breaks the intended real-world rules of a process.
- CVSS: a standard scoring system for the severity of security issues.
- CVSS vector: a compact string recording the individual judgements behind a CVSS score.
- Severity: a rating of how serious a security issue is, here Low.
- Bounty: a payment made to a researcher who reports a valid security issue.
- Proof of concept (POC): a set of steps that demonstrates the issue actually happens.
- Prerequisite: something that must be in place before the steps can be carried out.
- Local network: a private network of machines in one place, such as a home or office.
- Protocol: a set of rules for communication between computers, such as HTTP.
- HTTP: the protocol browsers use to request pages and data from web servers.
- URL: the address of a resource on the web.
- Fragment: the part of a URL after the
#symbol, used by the page itself and not sent to the server. - Interface (UI): the part of the software a person sees and interacts with.
- Error message: text shown to the user when an action did not succeed.
- Validation: checking that input, such as a password, meets required rules.
- Root cause: the underlying reason the issue occurs.
- Impact: the harm that can result from the issue.
- Confidentiality: the property that information is only seen by those allowed to see it.
- Integrity: the property that data is not changed improperly.
- Availability: the property that a service remains usable when needed.
- Reconnaissance (recon): the information-gathering phase before testing, looking for targets and their features.
- Attack vector: how an attacker reaches the target, for example over a network.
- Attack complexity: how hard it is to carry out the attack reliably.
- Privileges: the permissions an attacker has on the target system.
- User interaction: whether a real person has to do something for the attack to work.
- Scope: whether the impact stays within the same security boundary or spreads to another.