Nextcloud server software: Content Spoofing
The files app's location bar did not validate the 'dir' parameter, so an attacker could craft a link with a fake directory path and inject their own message into the error page. This allowed an attacker to display arbitrary text to a victim through a URL.
Originally disclosed on HackerOne
- Triaged in 6 hours
- Fixed in 18 days
- Paid in 3 days
- Disclosed after 32 days
Summary by the program
The location bar in the files app was not verifying the passed parameters. An attacker could craft an invalid link to a fake directory structure and use this to display an attacker-controlled error message to the user.
A detailed advisory can be found at https://nextcloud.com/security/advisory/?id=nc-sa-2016-003.
Thanks a lot, @ishahriyar for pointing out this vulnerability!
The report
In Nextcloud the "dir" parameter is vulnerable to content spoofing attack.
If anyone puts a valid directory name in dir parameter then it goes that directory other wise it redirects
to the home directory (/)
By putting ../../ in dir parameter I was able to stop the redirect then I had put some messages after that and that messages reflected with the same given format.
So here an attacker can send his messages directly through url.
Poc link
http://192.168.0.118/nextcloud/index.php/apps/files/?dir=../../Welcome+to+Nexcloud+You+can+get+pro+account+by+navigating+this+example.com
Thanks.
Attachments

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could display an attacker-controlled error message to a user via a crafted link.
What the attacker needed
Victim clicks a crafted link
The fix
The location bar should validate the 'dir' parameter so user-supplied text cannot be displayed.
How it was found
- Put a path traversal sequence in the 'dir' parameter to stop the redirect to the home directory.
- Append an attacker-controlled message after the traversal sequence.
- The message is reflected on the page in the same format as the error message.
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 report has not been written yet. The Original tab links to the source.
A web page sometimes shows an error message when you go to a folder that does not exist. Here, the folder name was taken straight from the link and shown back on the page without checking it. So an attacker could put their own words in the link and make the page show those words, which could be used to trick someone.
What is UI spoofing?
The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.