How to cause a DoS in Windows 8 explorer.exe

ElevenPaths    30 septiembre, 2013

We have discovered by accident how to cause
a Denial of Service (DoS) in Windows 8. It’s a little bug that is present in
the last version of the operating system. Since we alerted Microsoft first and
they didn’t consider it a real security problem that could be attacked we’re
documenting it as an anecdote.
Explorer.exe is a very important service in
Windows. It’s in charge of painting the desktop and gives the security tokens
to the programs that are in the same environment. It’s of vital importance that
it’s running in every moment, hence if the process dies for some reason, the
operating system itself will recover it automatically.
Seemingly, in Windows 8, explorer.exe
doesn’t handle correctly an exception that is thrown when dealing with digital
certificates and it forces it to close and launch again. This problem also
affects other programs that use the same internal API that processes ASN.1
structures.
For example, any program that uses .NET and processes the
“signedInfo” field of a signature.

Normal
0

21

false
false
false

ES
X-NONE
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Tabla normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:””;
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:8.0pt;
mso-para-margin-left:0cm;
line-height:107%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:”Calibri”,”sans-serif”;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:”Times New Roman”;
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}

These are steps to reproduce the problem:
  • Have a signed binary (DLL or
    EXE) at hand. Any binary is valid if it’s signed.
  • Fill the last section of the
    PKCS structure with zeroes or random values. For example 256 bytes of “00”.

Normal
0

21

false
false
false

ES
X-NONE
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Tabla normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:””;
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:8.0pt;
mso-para-margin-left:0cm;
line-height:107%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:”Calibri”,”sans-serif”;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-ansi-language:EN-US;
mso-fareast-language:EN-US;}

A part of the signature filled with 00s

Normal
0

21

false
false
false

ES
X-NONE
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Tabla normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:””;
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:8.0pt;
mso-para-margin-left:0cm;
line-height:107%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:”Calibri”,”sans-serif”;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-ansi-language:EN-US;
mso-fareast-language:EN-US;}

In this example we’ve overwritten part of
the information regarding the countersignature as we can observe when opening
the ASN.1 structure with a different program. We haven’t tested exactly which
part causes the problem when being overwritten.
On the left, altered ASN.1 structure, on the right, unaltered structure.

Normal
0

21

false
false
false

ES
X-NONE
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Tabla normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:””;
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:8.0pt;
mso-para-margin-left:0cm;
line-height:107%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:”Calibri”,”sans-serif”;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-ansi-language:EN-US;
mso-fareast-language:EN-US;}

If we overwrite other kind of information
Windows will simply think that the binary isn’t signed and won’t show the
“Digital signatures” tab in the properties dialog.

  • Using Explorer to access the
    “Digital signatures” tab will crash explorer.exe with an unhandled exception.
    Other programs like “Total commander” also crash in the attempt of showing the
    certificate. This bug is only present in Windows 8. The same proof of concept
    in Windows XP/7 only tricks the system to show the “Digital signatures” tab
    without any info to display. This isn’t normal either (the tab shouldn’t be
    visible) but at least it doesn’t kill the process.

Other programs that check the signature
such as sigcheck or signtool are not affected.
In theory this can be related to the change
of design. In Windows 7 and XP the email of the signer is shown in the “Digital
signatures” information tab. In Windows 8 the hash is being shown. We suppose
that they became aware that very few signers include the email in the
signature, and this field was usually blank.

On the left, properties of a signed file in Windows 7. On the right, in Windows 8.

Normal
0

21

false
false
false

ES
X-NONE
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Tabla normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:””;
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:8.0pt;
mso-para-margin-left:0cm;
line-height:107%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:”Calibri”,”sans-serif”;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-ansi-language:EN-US;
mso-fareast-language:EN-US;}

A quick analysis results in our hypothesis
that it’s difficult to take advantage of the bug to run arbitrary code. MSRT
confirms us that it is more like a bug and not a real security problem.

Sergio de los Santos

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *