nicolasf
Posts: 15
Joined: Mon Mar 02, 2015 4:17 pm

DLL Hijacking still occurring

We were able to hijack a EXE installer created with Advanced Installer 13.5 on Windows 7 Service Pack 1 despite http://www.advancedinstaller.com/dll-hijacking.html claiming "Advanced Installer 12.7 contains a security release for this problem.".

We created a Visual C++ Win32 project of type DLL, exported every function exported by version.dll (GetFileVersionInfoA, GetFileVersionInfoByHandle, GetFileVersionInfoExW, etc.) and displayed a message box in DllMain and the EXE installer loaded the DLL and displayed the message.

We received a security incident because of this that we need to resolve as soon as possible.

Thanks,
Nicolás.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: DLL Hijacking still occurring

Hello Nicolás,

I apologize for our delayed reply, we are pretty busy during the beginning of this year.

I've tested the reported scenario and replicated the issue on a Windows 7 SP1 x64 machine. Thank you for bringing this to our attention. We will start working on a fix right away. As soon as we have a fix I'll let you know the resolution.

Thank you once again for pinpointing this breach.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
nicolasf
Posts: 15
Joined: Mon Mar 02, 2015 4:17 pm

Re: DLL Hijacking still occurring

Thanks, Daniel. I am glad you were able to reproduce the issue and look forward to getting a build with a fix.
-Nicolás.
kywil0327
Posts: 1
Joined: Sat Feb 11, 2017 1:17 am

Re: DLL Hijacking still occurring

Hello - Can we get an update on the timeline for resolution? This is a very high priority item on our end.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: DLL Hijacking still occurring

Hello,

Can you please let me know if you still can replicate the issue when using a setup package with a different name than setup.exe?

I was able to replicate the issue only when using a setup named setup.exe. After debating the test case with our development team it seems there is no possible fix for this case. This is because the previously Windows systems always preload a predefined list of DLLs (e.g. version.dll) when a "setup.exe" file is launched. The DLL load happens before the EXE execution and this is why there is no fix we can apply for this case. However, the solution for this case is just to make sure you use a different name for your package than setup.exe.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sraj
Posts: 2
Joined: Thu Mar 09, 2017 7:12 pm

Re: DLL Hijacking still occurring

Hello Daniel.

I was playing around with the newly built installer (with AI 13.5) and observed that during the installation the installer tries to access a bunch of DLLs from local user's app data folder on windows. In process monitor these show up as "Create File". I was wondering if these access requests are just checks for DLLs, or if the installer actually loads them or something else. Technically since this is still a "user writable" space, if the installer is reading these DLLs it can be used to perform DLL hijacking.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: DLL Hijacking still occurring

Hello and welcome to our forums,

The installation process extracts the installation files in the specified user location at install time and then copy them to their target installation folder. However the extracted installation files (e.g. DLLs) are not loaded during this process.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sraj
Posts: 2
Joined: Thu Mar 09, 2017 7:12 pm

Re: DLL Hijacking still occurring

Hey Daniel

Thank you for the response. I was wondering can you give me an example of "specified user folder" and "Target installation folder" ? You can assume a default Windows setup, with the installer (exe) in the user's Downloads folder at C:\Users\me\Downloads.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: DLL Hijacking still occurring

Hello,

The target installation folders are folders from "Files and Folders" page which contain files to be installed.

Also, if your setup package is an EXE you can configure the installation file extraction folder from "Builds page -> Configuration tab -> Extraction location" field.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”