exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

SumatraPDF 3.1.2 DLL Hijacking

SumatraPDF 3.1.2 DLL Hijacking
Posted Feb 8, 2017
Authored by Stefan Kanthak

SumatraPDF version 3.1.2 suffers from a dll hijacking vulnerability.

tags | exploit
systems | windows
SHA-256 | 601ed610ba5925a63dea0564014681b1062e030c87127aba26cfeef6284cedb2

SumatraPDF 3.1.2 DLL Hijacking

Change Mirror Download
Hi @ll,

the executable installer [deg] and the "portable" version
of SumatraPDF 3.1.2 (available from
<https://www.sumatrapdfreader.org/download-free-pdf-viewer.html>)
are vulnerable to DLL hijacking [']:

The executable installers SumatraPDF-3.1.2-install.exe and
SumatraPDF-3.1.2-64-install.exe load and execute (tested on
a fully patched Windows 7 SP1) at least Version.dll, OLEACC.dll,
CryptBase.dll, NTMARTA.dll, LinkInfo.dll, NTSHRUI.dll,
NetUtils.dll, SrvCli.dll, CSCAPI.dll, SLC.dll, PropSys.dll from
the directory they are started from (the "application directory")
instead Windows "system directory", resulting in arbitrary code
execution.

For software downloaded with a web browser the "application
directory" is typically the user's "Downloads" directory: see
<http://seclists.org/fulldisclosure/2015/Nov/101> and
<http://seclists.org/fulldisclosure/2015/Dec/86> plus
<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>,
<http://seclists.org/fulldisclosure/2012/Aug/134> and
<http://blogs.technet.com/b/srd/archive/2014/05/13/load-library-safely.aspx>

Due to an application manifest embedded in the executable
installer which specifies "requireAdministrator" it will be
started with administrative privileges ("protected" administrators
are prompted for consent, unprivileged standard users are prompted
for an administrator password), resulting in an escalation of
privilege!

If (one of) the DLLs named above get(s) planted in the users
"Downloads" directory, for example per "drive-by download",
this vulnerability becomes a remote code execution WITH
escalation of privilege.


Proof of concept/demonstration:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. visit <https://skanthak.homepage.t-online.de/sentinel.html>,
download
<https://skanthak.homepage.t-online.de/skanthak/download/SENTINEL.DLL>
and save it as Version.dll in your "Downloads" directory, then
copy it as OLEACC.dll, CryptBase.dll, NTMARTA.dll, LinkInfo.dll,
NTSHRUI.dll, NetUtils.dll, SrvCli.dll, CSCAPI.dll, SLC.dll and
PropSys.dll;

2. visit <https://www.sumatrapdfreader.org/free-pdf-reader.html>,
download
<https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-3.1.2-install.exe>
and save it in your "Downloads" directory;

3. execute SumatraPDF-3.1.2-install.exe from your "Downloads"
directory;

4. notice the message boxes displayed from the DLLs placed in
step 1: PWNED!


The "portable" SumatraPDF.exe version 3.1.2 loads and executes
at least (tested on a fully patched Windows 7 SP1) WinSpool.drv,
MSImg32.dll, Version.dll, OLEAcc.dll, WindowsCodecs.dll,
AppHelp.dll, SrvCli.dll, CSCAPI.dll, SLC.dll, MSFTEdit.dll,
MSLS31.dll, NTMARTA.dll, XMLLite.dll, LinkInfo.dll, CryptSp.dll,
RPCRTRemote.dll, ShDocVw.dll, IEFrame.dll, MPR.dll, SAMCli.dll,
SAMLib.dll, WksCli.dll, NetUtils.dll and WinMM.dll from its
"application directory" (which is typically writable by the user)
instead Windows' "system directory", resulting in arbitrary code
execution.


Mitigation(s):
~~~~~~~~~~~~~~

0. DON'T USE EXECUTABLE INSTALLERS [deg]!

DON'T USE PORTABLE APPLICATIONS!

If your favourite applications are not distributed in the native
installer package format of the resp. target platform: ask^WURGE
their vendors/developers to provide native installation packages.
If they don't: dump these applications, stay away from such cruft!

1. Turn off UAC's privilege elevation for standard users and installer
detection for all users:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"ConsentPromptBehaviorUser"=dword:00000000 ; Automatically deny elevation requests
"EnableInstallerDetection"=dword:00000000

See <https://technet.microsoft.com/en-us/library/dd835564.aspx#BKMK_RegistryKeys>

2. NEVER execute files in UNSAFE directories (like "Downloads" and
and "%TEMP%")!

3. Deny execution (at least) in the "Downloads" directories and all
"%TEMP%" directories and their subdirectories:

* Add the NTFS ACE "(D;OIIO;WP;;;WD)" meaning "deny execution of
files in this directory for everyone, inheritable to all files
in all subdirectories" (use CACLS.EXE /S:<SDDL> for example);

* Use "software restriction policies" resp. AppLocker.

Consider to apply either/both to every "%USERPROFILE%" as well as
"%ALLUSERSPROFILE%" alias %ProgramData%" and "%PUBLIC%": Windows
doesn't place executables in these directories and beyond.

See <https://skanthak.homepage.t-online.de/SAFER.html> as well as
<http://www.mechbgon.com/srp/index.html>.


stay tuned
Stefan Kanthak


[deg] Self-extracting archives and executable installers are flawed^W
b(rainde)ad in concept and dangerous in practice: see
<https://skanthak.homepage.t-online.de/!execute.html>


['] A well-known (trivial, easy to exploit and easy to avoid) and
well-documented vulnerability: see
<https://cwe.mitre.org/data/definitions/426.html>,
<https://cwe.mitre.org/data/definitions/427.html>,
<https://capec.mitre.org/data/definitions/471.html>,
<https://technet.microsoft.com/en-us/library/2269637.aspx>,
<https://msdn.microsoft.com/en-us/library/ff919712.aspx> and
<https://msdn.microsoft.com/en-us/library/ms682586.aspx>


Timeline:
~~~~~~~~~

2017-01-21 sent vulnerability report regarding the installer
to author

NO ANSWER, not even an acknowledgement of receipt

2017-01-24 sent vulnerability report regarding the "portable"
version to author

NO ANSWER, not even an acknowledgement of receipt

2017-01-28 resent first vulnerability report to author

NO ANSWER, not even an acknowledgement of receipt

2017-01-31 resent second vulnerability report to author

NO ANSWER, not even an acknowledgement of receipt

2017-02-07 report published



Login or Register to add favorites

File Archive:

January 2023

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jan 1st
    0 Files
  • 2
    Jan 2nd
    13 Files
  • 3
    Jan 3rd
    5 Files
  • 4
    Jan 4th
    5 Files
  • 5
    Jan 5th
    9 Files
  • 6
    Jan 6th
    5 Files
  • 7
    Jan 7th
    0 Files
  • 8
    Jan 8th
    0 Files
  • 9
    Jan 9th
    18 Files
  • 10
    Jan 10th
    31 Files
  • 11
    Jan 11th
    30 Files
  • 12
    Jan 12th
    33 Files
  • 13
    Jan 13th
    25 Files
  • 14
    Jan 14th
    0 Files
  • 15
    Jan 15th
    0 Files
  • 16
    Jan 16th
    7 Files
  • 17
    Jan 17th
    25 Files
  • 18
    Jan 18th
    38 Files
  • 19
    Jan 19th
    6 Files
  • 20
    Jan 20th
    21 Files
  • 21
    Jan 21st
    0 Files
  • 22
    Jan 22nd
    0 Files
  • 23
    Jan 23rd
    24 Files
  • 24
    Jan 24th
    68 Files
  • 25
    Jan 25th
    22 Files
  • 26
    Jan 26th
    20 Files
  • 27
    Jan 27th
    17 Files
  • 28
    Jan 28th
    0 Files
  • 29
    Jan 29th
    0 Files
  • 30
    Jan 30th
    20 Files
  • 31
    Jan 31st
    31 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By
Rokasec
close