Microsoft Windows Task Scheduler ‘.job’ Stack Overflow

July 13th, 2004

NGSSoftware Insight Security Research Advisory

Name: Microsoft Windows Task Scheduler ‘.job’ Stack Overflow
Confirmed Systems Affected:  Microsoft Windows XP
Systems Reportedly Affected: Microsoft Windows XP, Windows 2000 and
Windows NT SP6 with Microsoft Internet
Explorer 6.
Severity: High Risk
Vendor URL: http://www.microsoft.com/
Author: Peter Winter-Smith [ peter@ngssoftware.com ]
Date Vendor Notified: 6th May 2004
Date of Public Advisory: 13th July 2004
Advisory number: #NISR13072004
Advisory URL: http://www.ngssoftware.com/advisories/mstaskjob.txt

Description
***********

The Microsoft Windows operating system provides a service which is
designed to run a particular application at a given time or date - The
Task Scheduler. When a new task is added through the control panel
application, a ‘.job’ file containing this information is created and
stored in the ‘Tasks’ folder in the Windows directory.

It has been found that it is possible to create a specially crafted ‘.job’
file which could allow local or remote code execution using a number of
different common place applications as the attack vectors.

Details
*******

By crafting a ‘.job’ file which contains overly long parameters, stack
based buffers can be overflowed, resulting in critical information,
including a saved return address or a structured exception handler
structure being completely overwritten, allowing an attacker to direct
the code execution flow to an address of their choosing. If the file
contains arbitrary executable code, the process can be forced to execute
this allowing, in worst cases, complete control over the target system.

The actual vulnerability arises from a lack of boundary checking performed
when copying the information out of memory containing the contents of the
file into the stack based buffers.

In some circumstances the overflow is triggered automatically when
viewing the directory that contains the job file in an explorer window
due to the fact that ’shell32.dll’ will detect the ‘.job’ file extension,
and load ‘mstask.dll’ allowing the module to examine the file, which
is when the overflow occurs.

Due to the fact that the overflow is triggered by a module loaded within
the process space of another running executable, any code which would be
executed by exploiting this flaw will be run with the privileges of the
user running that application, in the most common cases this would be the
user logged on to the machine.

Several applications which have been successfully tested as vectors for
exploiting this issue are Windows Explorer and Internet Explorer - when
attempting to view network shares containing the ‘.job’ file, and file
sharing through MSN Messenger has also been proven to be an effective
vector for attack. In the case of Internet Explorer, this issue could be
exploited simply by viewing a website containing a frame pointing to a
network share containing the ‘.job’ file. Please note that there are many
other ways of exploiting this issue, this is certainly not an exhaustive
list.

Fix Information
***************

Microsoft have provided a fix for this issue which can be downloaded from
the Microsoft Security website at:

http://www.microsoft.com/technet/security/bulletin/ms04-022.mspx

A check for this vulnerability has been added to Typhon III, NGSSoftware’s
advanced vulnerability assessment scanner. For more information please
visit the NGSSoftware website at http://www.ngssoftware.com/

About NGSSoftware
*****************

NGSSoftware design, research and develop intelligent, advanced application
security assessment scanners. Based in the United Kingdom, NGSSoftware
have offices in the South of London and the East Coast of Scotland.
NGSSoftware’s sister company NGSConsulting, offers best of breed security
consulting services, specialising in application, host and network
security assessments.

http://www.ngssoftware.com/

Telephone +44 208 401 0070
Fax +44 208 401 0076

enquiries@ngssoftware.com

Section Navigation


SC Awards 2008


SC Magazine Awards 2008

NGSSoftware wins 'Best Security Company'.

ITA 2008


2008 International Trade Awards

NGSSoftware named as South-East England regional winners at the 2008 International Trade Awards.

SLBA 2008


South London Business Awards 2008

David Litchfield named as 'Entrepreneur of the Year' at the South London Business Awards 2008.

Latest Vacancies

Experienced CLAS consultant

NGSSoftware are seeking an experienced CLAS consultant capable of writing Security Targets and Evaluation Work Plans for CTAS.

Please send us your CV or resume.

NGS Offices

NGS have offices located in London & St Andrews (UK) and Sydney (Australia).

NGS Consulting

Why do companies around the world – and around the corner – turn to NGS?

Discover what we could do for your business »

NGS Security Training

Find out why we have provided training to some of the world's most security conscious organisations.

Learn from the best!

We regularly present and speak at international security conferences throughout the world.

OWASP AppSec Europe 2008

AusCERT 2008

ITWeb Security Summit

Customer Testimonials

Read what some of our satisfied customers are saying about us.

NGS Publications

Web Application Hacker's Handbook

Oracle Hacker's Handbook

Database Hacker's Handbook

The Shellcoder's Handbook

SQL Server Security

Configuring IPCop Firewalls


CHECK