Advertisement






7-Zip 16 DLL Hijacking

CVE Category Price Severity
CVE-2018-5996 CWE-426 $5,000 High
Author Risk Exploitation Type Date
N/A High Local 2022-04-22
CVSS
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N

CVSS vector description

Our sensors found this exploit at: https://cxsecurity.com/ascii/WLB-2022040087

Below is a copy:

7-Zip 16 DLL Hijacking
Microsoft Windows Environment Variable Expansion Issue Leads To Remote DLL Hijack 

Attack vector: 7-ZIP v.16 

7-ZIP v.16 and possibly other softwares that utilizes the HTML Help System are prone to a remote DLL hijacking issue which leads to arbitrary code execution. PoC attached.

because the OS fails to expand the "%systemroot%" environment variable and additionally an unsafe search for hhctrl.ocx when the program invokes "HtmlHelp()" to load the HTML Help system

so if the current working directory of the program is set to an attacker controlled location such as WebDAV/SMB shares and the path '.\%systemroot%\system32\hhctrl.ocx' exists, it will be loaded

instead of the legit 'hhctrl.ocx' due to unsafe search order. This allows for arbitrary code execution.


Note: "Notepad.exe" app imported from Windows XP SP3 into a Windows 7/8/10 OS is also vulnerable.


Vulnerable Windows versions: 7 / 8.1 / 10 depending on the patch level. 


Patches up to November 2015 on 8.1 and 10 v.1511 is vulnerable.

Windows 8.1 patches up to January 2020 is assumed vulnerable

Windows 7, fully patched as of January 2020 is vulnerable.


A C (not C++, C# etc) DLL must be created and contain the "DllMain()" fuction which you can use to run arbitrary code.

then create a subdirectory on the WebDAV/SMB share called '7z', then create the tree: '.\%systemroot%\system32' and place the DLL named 'hhctrl.ocx' on the 'system32' folder.

Place a valid ZIP / 7Z archive on '7z' folder and send the UNC path / link to the target.


The target accesses the remote share via Windows Explorer (File Explorer) and opens the archive (with 7-ZIP) then proceeds to click "Help" then "Contents (F1)" or pressing "F1" key to trigger the vulnerability
and run arbitrary code.

exploit complexity: "easy"

reliability: 100%

severity: medium


Video demo on: https://www.youtube.com/watch?v=_muAPMzd9T0

Copyright ©2024 Exploitalert.

All trademarks used are properties of their respective owners. By visiting this website you agree to Terms of Use.