what you don't know can hurt you
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:

May 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close