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:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    38 Files
  • 24
    Sep 24th
    65 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close