Skip to content
RCE Disclosed report Beginner

ownCloud 2.2.2.6192 DLL Hijacking Vulnerability

The ownCloud installer loads a DLL from its own directory without validating its origin, allowing an attacker to place a malicious DLL in the user's Downloads folder. If the user runs the installer from that folder, the attacker's DLL executes, leading to arbitrary code execution.

lionheartrox Follow

Originally disclosed on HackerOne

Bounty$50 View original
  • Triaged in 3 days
  • Fixed in 47 days
  • Paid in 47 days
  • Disclosed after 47 days

Summary ownCloud contains a DLL hijacking vulnerability that could allow an unauthenticated, remote attacker to execute arbitrary code on the targeted system. The vulnerability exists due to some DLL file is loaded by 'ownCloud-2.2.2.6192-setup.exe' improperly. And it allows an attacker to load this DLL file of the attacker’s choosing that could execute arbitrary code without the user's knowledge.

Affected Product: ownCloud 2.2.2.6192

Impact Attacker can exploit this vulnerability to load a DLL file of the attacker's choosing that could execute arbitrary code. This may help attacker to Successful exploit the system if user creates shell as a DLL.

Vulnerability Scoring Details The vulnerability classification has been performed by using the CVSSv2 scoring system (http://www.first.org/cvss/). Base Score: 7.2 (AV:L/AC:L/Au:N/C:C/I:C/A:C)

More Details: For software downloaded with a web browser the application directory is typically the user's "Downloads" directory: see https://insights.sei.cmu.edu/cert/2008/09/carpet-bombing-and-directory-poisoning.html, http://blog.acrossecurity.com/2012/02/downloads-folder-binary-planting.html and http://seclists.org/fulldisclosure/2012/Aug/134 for "prior art" about this well-known and well-documented vulnerability.

If an attacker places malicious DLL in the user's "Downloads" directory (for example per "drive-by download" or "social engineering") this vulnerability becomes a remote code execution.

Proof of concept/demonstration:


1. Create a malicious dwmapi.dll file and save it in your "Downloads" directory.

2. Download 'ownCloud-2.2.2.6192-setup' and save it in your "Downloads" directory.

3. Execute 'ownCloud-2.2.2.6192-setup.exe' from your "Downloads" directory.

4. Malicious dll file gets executed.

The original report as published on HackerOne, by lionheartrox. 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. 3 min read.

Context

ownCloud is a file synchronisation and sharing product. The report concerns the Windows installer for ownCloud 2.2.2.6192, ownCloud-2.2.2.6192-setup.exe. The installer is a Windows executable that, when run, loads a DLL improperly. The report describes a DLL hijacking issue: the installer loads a DLL improperly, so an attacker who can place a DLL of their choosing in the directory from which the installer is run can have that DLL executed.

Setup

The affected product is ownCloud 2.2.2.6192. The report does not describe any account, role or server-side configuration. The precondition is that the user downloads ownCloud-2.2.2.6192-setup.exe and runs it from a directory that an attacker can write to, typically the user's Downloads directory. The report notes that for software downloaded with a web browser the application directory is typically the user's Downloads directory, and cites prior art on this well-known and well-documented vulnerability:

No tools are named beyond the installer and a malicious DLL. The report does not give the name of the DLL that the installer loads improperly; the proof of concept uses dwmapi.dll as the malicious DLL.

Finding it

The researcher states that the vulnerability exists because some DLL file is loaded by ownCloud-2.2.2.6192-setup.exe improperly. The report attributes the issue to the installer loading some DLL file improperly.

Exploitation

The report gives a proof of concept in four steps. The steps are reproduced exactly as written:

Step 1

Create a malicious dwmapi.dll file and save it in your Downloads directory.

The report does not include the contents of the DLL. It only says that the DLL is malicious and that it is named dwmapi.dll. The report later says that the attacker can create a shell as a DLL, but it does not provide that code.

Step 2

Download ownCloud-2.2.2.6192-setup and save it in your Downloads directory.

The report writes the file name without the .exe extension in this step, while the other steps use ownCloud-2.2.2.6192-setup.exe. The installer is placed in the same directory as the malicious DLL.

Step 3

Execute ownCloud-2.2.2.6192-setup.exe from your Downloads directory.

The report's point is that the installer loads a DLL improperly, and the proof of concept runs it from the Downloads directory.

Step 4

Malicious dll file gets executed.

It states the result as the final step.

Root cause

In Windows, when an executable loads a DLL by name, the search order can include the directory of the executable. The report also does not describe any mitigation that was present or absent in the installer.

Impact

The report states that an unauthenticated, remote attacker could execute arbitrary code on the targeted system. The vulnerability allows an attacker to load a DLL file of the attacker's choosing that could execute arbitrary code without the user's knowledge. The report says this may help an attacker successfully exploit the system if the user creates a shell as a DLL.

The report explains the condition for remote code execution: if an attacker places a malicious DLL in the user's Downloads directory, for example via a drive-by download or social engineering, the vulnerability becomes a remote code execution. The report says that if an attacker places a malicious DLL in the user's Downloads directory, the vulnerability becomes a remote code execution.

The report gives a CVSSv2 base score of 7.2 with the vector AV:L/AC:L/Au:N/C:C/I:C/A:C. The platform lists the weakness as Code Injection and a bounty of 50.00 USD.

Fix

It only documents the vulnerability.

Variants to test

The report does not list variants. The report does not list variants. The report does not provide a list of DLL names to try; the only name in the report is dwmapi.dll.

Hunting notes

The report's argument for impact rests on the Downloads directory being the application directory for browser-downloaded software, and on the attacker being able to place a DLL there through drive-by download or social engineering. The report does not include any further evidence, such as a video or a log, and no images or videos are referenced.

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. 9 min read.

What happened, in plain words

ownCloud is a product for synchronising and sharing files, a bit like a private Dropbox that you or your company can run on your own server. To use it on a Windows computer, you download a program called an installer. An installer is a single file that, when you double-click it, sets up the software for you: it copies files into the right places and prepares everything so the program can run.

The installer in this report is called ownCloud-2.2.2.6192-setup.exe, and it belongs to ownCloud version 2.2.2.6192. The report is about a problem with that installer on Windows.

Here is the idea in everyday terms. Imagine you hire a cook who is told to fetch a recipe card from "the folder on the kitchen counter". If a stranger has slipped their own card into that folder, the cook will pick up the stranger's card and follow it, because the cook only looked at the folder, not at who put the card there. Windows programs work in a similar way: when a program needs a helper file called a DLL, it looks for it by name, and the search can include the folder the program itself sits in. If an attacker can drop a file with the right name into that folder, the program may load the attacker's file and run it.

That is what this report describes. The installer loads a DLL improperly. An attacker who can put a DLL of their choosing in the folder from which the installer is run can get that DLL executed. The report calls this DLL hijacking.

The report says this could let an unauthenticated, remote attacker execute arbitrary code on the targeted system. "Unauthenticated" means the attacker does not need an account or a password on the machine. "Remote" means the attacker does not need to be sitting at the computer. "Arbitrary code" means any program the attacker wants, not just the intended ownCloud software.

The affected product

The affected product is ownCloud 2.2.2.6192. The report does not describe any account, role or server-side configuration. There is nothing to log into and nothing to configure on a server. The only precondition is on the user's own computer: the user downloads ownCloud-2.2.2.6192-setup.exe and runs it from a folder that an attacker can write to. In practice that folder is usually the user's Downloads folder.

Why the Downloads folder? When you download something with a web browser, the browser saves it in a default folder, and on Windows that is normally Downloads. The report points out that for software downloaded with a web browser, the application directory is typically the user's Downloads directory. The "application directory" is simply the folder the program file lives in. The report notes that for software downloaded with a web browser, the application directory is typically the user's Downloads directory.

The report notes that this is a well-known and well-documented vulnerability and cites prior art, meaning earlier public writing on the same pattern:

No tools are named beyond the installer and a malicious DLL. The report does not give the name of the DLL that the installer loads improperly. The proof of concept uses dwmapi.dll as the malicious DLL.

How the problem was found

The researcher states that the vulnerability exists because some DLL file is loaded by ownCloud-2.2.2.6192-setup.exe improperly. The core issue, as the report puts it, is that some DLL file is loaded by the installer improperly.

The proof of concept

The report gives a proof of concept in four steps. A proof of concept is a small, repeatable demonstration that shows the problem is real, without needing to explain every internal detail. The steps are reproduced exactly as written:

Step 1

Create a malicious dwmapi.dll file and save it in your Downloads directory.

What this means, piece by piece:

  • A DLL is a Dynamic Link Library. It is a file full of ready-made code that other programs can load and use, instead of every program carrying its own copy. Think of it as a shared toolbox that many programs reach into.
  • dwmapi.dll is the name of the file. The name matters because Windows looks for a DLL by its name. If the installer asks for a DLL with this name, a file with this name in the right folder can be picked up.
  • "Malicious" means the file contains code the attacker wants to run, not the legitimate code the program expects.
  • Saving it in Downloads puts it in the same folder where the installer will later be saved, which is the folder the installer may search.

The report does not include the contents of the DLL. It only says the DLL is malicious and is named dwmapi.dll. Later the report says an attacker can create a shell as a DLL, but it does not provide that code. A shell, in this context, is a way for an attacker to run commands on the machine.

Step 2

Download ownCloud-2.2.2.6192-setup and save it in your Downloads directory.

  • This is the normal thing any user does: fetch the installer from the internet.
  • The report writes the file name here without the .exe extension, while the other steps use ownCloud-2.2.2.6192-setup.exe. The .exe ending is what tells Windows the file is a program you can run.
  • The important part is the destination: the installer is placed in the same folder as the malicious DLL. That is the whole trick. The attacker does not need to break into the installer; they only need their file to be sitting next to it.

Step 3

Execute ownCloud-2.2.2.6192-setup.exe from your Downloads directory.

  • "Execute" means run, usually by double-clicking the file.
  • Running it from Downloads means that folder becomes the application directory for the running program. In other words, the program's own folder is Downloads.
  • The report's point is that the installer loads a DLL improperly, and the proof of concept runs it from the Downloads directory.

Step 4

Malicious dll file gets executed.

  • The report states that the malicious DLL file gets executed, without the user's knowledge.
  • It states the result as the final step.

Why it works

On Windows, when a program asks for a DLL by name, the system has to decide which file on disk that name refers to. The search order can include the folder the program itself is in. If the program does not use a fully qualified path, meaning the full, exact location of the DLL, or a safe search order, then a DLL placed next to the program is found and loaded.

It also does not describe any protection that was present or absent in the installer. What the report does say is that some DLL file is loaded by the installer improperly.

Impact

The report states that an unauthenticated, remote attacker could execute arbitrary code on the targeted system. The vulnerability allows an attacker to load a DLL file of the attacker's choosing that could execute arbitrary code without the user's knowledge. The report says this may help an attacker successfully exploit the system if the user creates a shell as a DLL.

The report explains the condition for remote code execution: if an attacker places a malicious DLL in the user's Downloads directory, for example via a drive-by download or social engineering, the vulnerability becomes a remote code execution.

  • A drive-by download is when a file arrives on your computer without you deliberately asking for it, for example because a website or an advert quietly saves it.
  • Social engineering is when someone tricks a person into doing something, such as sending a file or clicking a link, by pretending to be trustworthy.

The report says that if an attacker places a malicious DLL in the user's Downloads directory, the vulnerability becomes a remote code execution.

Severity

The report gives a CVSSv2 base score of 7.2 with the vector AV:L/AC:L/Au:N/C:C/I:C/A:C. CVSS is a standard way of scoring how serious a vulnerability is. The vector is a compact string that records the answers to a set of questions:

Part Meaning in plain words
AV:L Attack Vector: Local. The attacker needs a foothold on the machine or its surroundings, such as the ability to write a file into the user's folder.
AC:L Attack Complexity: Low. No special conditions or lucky timing are needed.
Au:N Authentication: None. The attacker does not need an account.
C:C Confidentiality: Complete. Data on the machine could be fully exposed.
I:C Integrity: Complete. Data on the machine could be fully changed.
A:C Availability: Complete. The machine or its software could be fully disrupted.

The platform lists the weakness as Code Injection and a bounty of 50.00 USD.

Fix

It only documents the vulnerability.

Other programs to check

The report does not list variants. The report does not list variants. The report does not provide a list of DLL names to try; the only name in the report is dwmapi.dll.

Notes on the investigation

The report's argument for impact rests on the Downloads folder being the application directory for browser-downloaded software, and on the attacker being able to place a DLL there through drive-by download or social engineering. The report does not include any further evidence, such as a video or a log, and no images or videos are referenced.

Glossary

  • DLL: Dynamic Link Library. A file of shared code that programs load and use, so they do not each need their own copy.
  • DLL hijacking: A weakness where a program loads a DLL by name from a place an attacker can write to, so the attacker's file is loaded instead of the intended one.
  • Installer: A program that sets up other software on your computer when you run it.
  • Application directory: The folder in which the program file itself sits.
  • Downloads directory: The default folder where a web browser saves downloaded files on Windows.
  • Execute: To run a program, usually by double-clicking it.
  • Arbitrary code: Any program or instructions an attacker wants to run, not just the software that was supposed to run.
  • Remote: Done from somewhere other than the affected computer, over a network or the internet.
  • Unauthenticated: Without needing an account, username or password.
  • Remote code execution: A situation where an attacker can make a computer run their code from a distance.
  • Shell: A way to give commands to a computer and see the results.
  • Drive-by download: A file that arrives on your computer without you deliberately asking for it.
  • Social engineering: Tricking a person into doing something, such as opening a file, by pretending to be trustworthy.
  • Proof of concept: A small, repeatable demonstration that shows a problem is real.
  • CVSS: Common Vulnerability Scoring System, a standard way of scoring how serious a vulnerability is.
  • CVSS vector: A compact string such as AV:L/AC:L/Au:N/C:C/I:C/A:C that records the answers behind a CVSS score.
  • Code Injection: A category of weakness where an attacker gets their own code into a place where it will be run.
  • Bounty: A payment made to a researcher for reporting a valid vulnerability.
  • Prior art: Earlier public work on the same topic, used here to show the pattern is already well known.

More from ownCloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.