Two Lines Of JScript For $20,000 – Pwn2Own Miami 2022
A GraphWorX64 template file (.tdfx) contained a ScriptCodeManager tag that allowed JScript.NET code to execute when the file was opened, without authentication. An attacker could run arbitrary code by crafting a malicious template file.
Published on trenchant.io
In 2022, Pwn2Own returned to Miami and was again targeting industrial control systems (ICS) software. I had participated in the inaugural Pwn2Own Miami in 2020 and was eager to participate again this year.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Pwn2Own Miami is ZDI's contest aimed at industrial control systems software. In 2022 the contest returned to Miami, and one of the targets was ICONICS Genesis64, specifically the Genesis64 Control Server. The author had competed at the inaugural Miami event in 2020, where he had found a vulnerability in the same product that let a remote attacker run arbitrary SQL commands through a custom WCF client. This time the result was a $20,000 award for running arbitrary JScript.NET code.
The important change for 2022 was in the contest rules. In 2020 a successful entry against the Genesis64 target had to be launched against the exposed network services. The 2022 rules added a second valid scenario: opening a file on the contest laptop. The rules quoted in the write-up read:
An attempt in this category must be launched against the target’s exposed network services from the contestant’s laptop within the contest network or by opening a file within the target on the contest laptop. The files that are eligible to be opened must be file types that are handled by default by the target application.
https://www.zerodayinitiative.com/Pwn2OwnMiami2022Rules.html
That second scenario was new attack surface which had not been explored at the previous event, and the author expected it to contain plenty of issues. The feature at the centre of the finding is the scripting support in GraphWorX64: files can carry embedded JScript.NET code in ScriptCode elements, and a template file with such code ran it when opened.
Setup
- Download the ICONICS Genesis64 installation ISO.
- Run
setup.exefrom theICONICS_Suitedirectory. - Accept the default configuration for everything, but make sure the demo programs are installed.
- Restart when the installer asks; it asks several times while dependencies are installed and configuration begins.
The author describes installation as the most tedious aspect of the whole effort. The GenDemo package matters because it ships the example files used later, including the AlarmWorX64_Examples folder.
Finding it
The starting point was a survey of the file types that Genesis64 handles by default. The author searched the file system for examples of those types and then did a quick visual scan of each file, looking for interesting data and keywords, with the aim of getting a high-level overview of what each file is used for. The ideal outcome would be something like a serialised object stored in a file that gets deserialised when the file is opened. Some of the formats are binary and some are compressed; at this stage the scan was for interesting strings and features, with no real expectations.
One of the default types is .awxx, an XML format. Example files live in the AlarmWorX64_Examples folder of the GenDemo package, and they look like this:
<?xml version="1.0" encoding="utf-8"?>
<AwxViewControl FileVersion="10.60.063.00" Width="Auto" Height="Auto" xmlns="clr-namespace:Ico.Awx;assembly=AwxViewControl" xmlns:iws="clr-namespace:Ico.WPF.Specialized;assembly=IcoWPFSpecialized" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:iwc="clr-namespace:Ico.Windows.Controls;assembly=IcoWPF" xmlns:iad="clr-namespace:Ico.Awx.DataGrid;assembly=AwxViewControl" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:iwm="clr-namespace:Ico.Windows.Media;assembly=IcoWPF">
<AwxViewControl.Items>
<iwc:MultipleTabItem IsSelected="True" Header="Tab">
<iad:AwxGridView>
<iad:AwxGridView.SavedColumns>
<iad:AwxColumn Key="AckRequiredBaseConditionType" Index="6" IsVisible="False" Text="AckRequired" />
<iad:AwxColumn Key="ActiveTimeBaseConditionType" Text="Time / Date" Width="145" />
<iad:AwxColumn Key="ConditionNameBaseConditionType" Index="7" IsVisible="False" Text="ConditionName" />
...
The scan of .gdfx files turned up tags named ScriptCode and ScriptCodeManager, which the author found very interesting:
<gwx:GwxDocument.GwxDocument>
<gwx:GwxDocument FileVersion="[redacted]" ScanRate="500">
<gwx:GwxDocument.ScriptCodeManager>
<script:ScriptCodeManager>
<script:ScriptCodeManager.Scripts>
<script:ScriptCode Name="ThisDisplayCode" Type="JScriptNet">
<x:XData><![CDATA[
function DebugDump(sender : System.Object, cmdArgs : Ico.Gwx.CommandExecutionEventArgs)
{
var callback : Ico.Fwx.ClientWrapper.MethodCallDoneDelegate = ThisDocument.CreateDelegate(Ico.Fwx.ClientWrapper.MethodCallDoneDelegate, this, "CallDone");
ThisWindow.FwxClientWrapper.MethodCallAsync(":", "DebugDump", new Object[0], callback, null);
}
function CallDone(result : Ico.Fwx.ClientWrapper.MethodCallDoneResult)
{
message : String;
message = String.Format("Result: {0}", result.Status.ToString());
if ((result.OutputArguments != null)
&& (result.OutputArguments.Count > 0))
{
path = result.OutputArguments[0].ToString();
message += String.Format("\n\nDump file: {0}", path);
}
MessageBox.Show(message, "Debug Dump Result", MessageBoxButton.OK);
}
]]></x:XData>
</script:ScriptCode>
<script:ScriptCode Name="JScriptDotNetGlobalVariablesCode" Type="JScriptNet" EditorBrowsable="Never">
<x:XData><![CDATA[
var ThisWindow : Ico.Gwx.GwxRuntimeViewControl;
var ThisDocument : Ico.Gwx.GwxDocument;
var ThisConfiguration : Ico.Gwx.GwxConfiguration;
]]></x:XData>
</script:ScriptCode>
</script:ScriptCodeManager.Scripts>
</script:ScriptCodeManager>
</gwx:GwxDocument.ScriptCodeManager>
</gwx:GwxDocument>
</gwx:GwxDocument.GwxDocument>
This is JScript.NET code embedded in the file, which is a documented feature for adding scripts to projects. Opening the .gdfx file, however, produced a "File Access Denied" message. An ICONICS user apparently has to be logged in before this file will open. The author noted this behaviour and made a note to check whether the JScript code could run before the authentication check, or whether the authentication could be bypassed, then carried on with the survey of default file types.
Exploitation
Step 1: find a file type that carries scripts and opens without authentication
A GraphWorX64 Template file, .tdfx, contains the same ScriptCodeManager tag, and it opened without requiring authentication.
Step 2: put code in a ScriptCode tag
Adding the following code into a ScriptCode tag in the template file causes calc to be executed when the file is opened:
var objShell = new ActiveXObject("Shell.Application");
objShell.ShellExecute("calc.exe", "", "calc.exe", "open", 0);
The script creates a Shell.Application ActiveX object and calls ShellExecute on it with calc.exe as the file, the parameters and the working directory, and open as the verb. The final argument, 0, is the window style. Because the script runs inside the application when the document is loaded, the calculator is started when the file is opened.
Step 3: decide whether to submit
The author is explicit that this is a shallow bug and a weak entry for Pwn2Own. The main risk was collision: other researchers were likely to find the same thing. At that point only a couple of hours of effort had gone into it, so the alternative was to report it to ZDI immediately and keep looking for better bugs. The decision was complicated further when the contest was delayed by a few months because of the Omicron surge in Florida. In the end the author took his chances with the weak bug. Despite being the fifth of seven researchers to target Iconics Genesis64, the bug did not collide with the earlier attempts and the entry was successful.
Root cause
Genesis64's document formats support embedded JScript.NET through ScriptCode elements, and the application executes that script when the document is opened. The .tdfx template file opened without requiring an ICONICS login, so the script ran with no authentication step in front of it. The script creates a Shell.Application ActiveX object and uses it to launch a process. The login required for .gdfx was absent for .tdfx.
Impact
An attacker who can get a victim to open a crafted .tdfx file can run arbitrary JScript.NET code in the context of the Genesis64 application, and from there execute programs on the host, as demonstrated with calc.exe. The attack requires the file to be opened on the target machine, which the 2022 contest rules accept as a valid scenario for file types handled by default by the target application. The author characterises the bug as shallow and weak, and notes that finding attack surface which has not seen significant scrutiny is often all that is needed to find and exploit critical vulnerabilities.
Fix
ZDI assigned CVE-2022-33317 to the vulnerability, and ICONICS fixed it in version 10.97.2. The write-up credits the vendor for the timely fix.
Variants to test
- Other default-handled document types that embed script or serialised objects. Search the installation for example files of each type and grep them for script, serialisation and class-instantiation markers. A positive result is a file that opens without authentication and whose embedded content runs or is deserialised.
- Formats that require authentication, such as
.gdfxhere. Check whether the embedded script runs before the login check, or whether the check can be bypassed. A positive result is code execution from a file opened while logged out. - Template and example files shipped with the product. These are often opened without the restrictions applied to project files, as with
.tdfx. A positive result is a template that accepts aScriptCodeelement and executes it on open. - Script hosts inside the application that expose COM or .NET objects. Try instantiating objects such as
Shell.Applicationfrom the embedded language. A positive result is a process spawned by the target application when the document loads.
What happened, in plain words
A security researcher entered a hacking contest called Pwn2Own Miami in 2022. The contest is run by ZDI (Zero Day Initiative) and focuses on software used in factories and industrial facilities, known as industrial control systems (ICS). One of the products in the contest was ICONICS Genesis64, a program that industrial operators use to monitor and control machinery and processes. The researcher found that a template file, when opened in Genesis64, would run embedded JScript code, which he used to launch the Windows calculator. He demonstrated this by making the file open the Windows calculator. That was enough to win $20,000.
The interesting part is how little code it took: two lines of a scripting language called JScript.NET, placed inside a template file. This article walks through the whole story from the beginning, explaining every term as it comes up, so you can follow it even if you have never done security work before.
The contest and the rule change
Pwn2Own is a recurring event where researchers try to break into specific products in front of judges. If they succeed, they win money and the vendor gets a chance to fix the problem. The Miami edition in 2022 targeted industrial software.
The researcher had already competed at the first Miami event in 2020. Back then he found a different flaw in the same ICONICS product: a remote attacker could send commands to a service over the network and get the program to run arbitrary SQL. SQL is the language used to talk to databases; "arbitrary SQL" means the attacker could run any database command he liked, not just the ones the program intended. That attack used a custom WCF client. WCF (Windows Communication Foundation) is a Microsoft framework that lets two programs talk to each other over a network, a bit like a standardised telephone line between software components. A "client" is the program that makes the call.
For 2022 the rules changed in a way that mattered a lot. In 2020, to count as a successful entry against the Genesis64 target, the attack had to come in over the network, against the services the product exposes to other machines. The 2022 rules added a second acceptable scenario: simply opening a file on the contest laptop. The rules quoted in the write-up say:
An attempt in this category must be launched against the target’s exposed network services from the contestant’s laptop within the contest network or by opening a file within the target on the contest laptop. The files that are eligible to be opened must be file types that are handled by default by the target application.
https://www.zerodayinitiative.com/Pwn2OwnMiami2022Rules.html
In plain words: you can attack the product either over the network, or by getting the product to open a file, as long as the product handles that file type out of the box. "Handled by default" means the program already knows how to open that kind of file without any extra plugin or configuration.
Why did this matter? Because opening files is a completely different way into a program than talking to it over a network. It is like the difference between someone shouting at your house through the letterbox and someone handing you a letter to read. The letter route had not been explored at the previous event, so the researcher expected it to be full of problems. That expectation turned out to be right.
The feature at the centre of the finding is scripting support in GraphWorX64, one of the components of Genesis64. GraphWorX64 is the part that draws the visual displays operators look at: gauges, diagrams, alarm panels. It lets files carry small programs written in JScript.NET, and a template file with such a program ran it when opened. JScript.NET is Microsoft's older scripting language, a cousin of JavaScript, designed to run inside .NET applications. A "script" here is just a short program stored as text inside the file.
Setting up the software
To study the product, the researcher installed it on his own machine. The steps were:
- Download the ICONICS Genesis64 installation ISO. An ISO is a single file that contains a complete disc image, the way a DVD used to hold an installer.
- Run
setup.exefrom theICONICS_Suitedirectory.setup.exeis the standard name for a Windows installer program. - Accept the default configuration for everything, but make sure the demo programs are installed. "Default configuration" means clicking Next through the options without changing them. The demo programs matter because they ship with example files, and those examples are what the researcher later examined.
- Restart when the installer asks. It asks several times while dependencies are installed and configuration begins. A "dependency" is another piece of software that the main program needs in order to work, like a recipe needing ingredients before you can cook.
The researcher calls installation the most tedious aspect of the whole effort. That is worth noting for beginners: a large part of real security work is simply getting the software running so you can look at it. The GenDemo package is the part that matters here, because it includes a folder called AlarmWorX64_Examples full of sample files.
Finding the problem
The researcher started by surveying the file types that Genesis64 handles by default. He searched the file system for examples of each type, then did a quick visual scan of each file, looking for interesting data and keywords. The goal was to get a high-level overview of what each file is used for, not to understand every detail.
The ideal outcome would be something like a serialised object stored in a file that gets deserialised when the file is opened. Those two terms need explaining. "Serialisation" is turning a live object in a program's memory into a stream of bytes so it can be saved to a file or sent over a network. "Deserialisation" is the reverse: reading those bytes back and rebuilding the object. The danger is that if an attacker controls the bytes, they may be able to control what object gets rebuilt, and some objects do powerful things when they are created. It is a bit like a form that says "fill in your name" but the attacker writes instructions instead, and the clerk follows them.
Some of the formats are binary, meaning the file is made of raw bytes rather than readable text. Some are compressed, meaning the contents are packed to save space. At this stage the scan was just for interesting strings and features, with no real expectations.
One of the default types is .awxx, which is an XML format. XML is a way of writing structured data using tags in angle brackets, similar to HTML but for data rather than web pages. Example files live in the AlarmWorX64_Examples folder of the GenDemo package, and they look like this:
<?xml version="1.0" encoding="utf-8"?>
<AwxViewControl FileVersion="10.60.063.00" Width="Auto" Height="Auto" xmlns="clr-namespace:Ico.Awx;assembly=AwxViewControl" xmlns:iws="clr-namespace:Ico.WPF.Specialized;assembly=IcoWPFSpecialized" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:iwc="clr-namespace:Ico.Windows.Controls;assembly=IcoWPF" xmlns:iad="clr-namespace:Ico.Awx.DataGrid;assembly=AwxViewControl" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:iwm="clr-namespace:Ico.Windows.Media;assembly=IcoWPF">
<AwxViewControl.Items>
<iwc:MultipleTabItem IsSelected="True" Header="Tab">
<iad:AwxGridView>
<iad:AwxGridView.SavedColumns>
<iad:AwxColumn Key="AckRequiredBaseConditionType" Index="6" IsVisible="False" Text="AckRequired" />
<iad:AwxColumn Key="ActiveTimeBaseConditionType" Text="Time / Date" Width="145" />
<iad:AwxColumn Key="ConditionNameBaseConditionType" Index="7" IsVisible="False" Text="ConditionName" />
...
Line by line, in plain words:
- The first line is the standard XML declaration. It says this is XML, version 1.0, encoded as UTF-8 (a common way of storing text characters).
<AwxViewControl ...>opens the main element. The attributes inside it, likeFileVersion="10.60.063.00", record which version of the software wrote the file. Thexmlnsattributes are namespace declarations: they tell the XML parser which software library each tag name belongs to, so two libraries can both have a tag calledColumnwithout confusion. Think of them as surnames for tags.<AwxViewControl.Items>starts a list of things the view contains.<iwc:MultipleTabItem ...>is one tab in the display, marked as selected.<iad:AwxGridView>is a grid, a table-like layout.<iad:AwxGridView.SavedColumns>starts the list of columns saved in that grid.- Each
<iad:AwxColumn ...>describes one column: its internal key, its position, whether it is visible, and the text shown to the user. - The
...at the end means the file continues in the same pattern; the write-up only shows the beginning.
This file is mostly layout information. Nothing here runs code. But it told the researcher what a Genesis64 document looks like, and that made the next discovery easier to spot.
The scan of .gdfx files turned up tags named ScriptCode and ScriptCodeManager, which the researcher found very interesting:
<gwx:GwxDocument.GwxDocument>
<gwx:GwxDocument FileVersion="[redacted]" ScanRate="500">
<gwx:GwxDocument.ScriptCodeManager>
<script:ScriptCodeManager>
<script:ScriptCodeManager.Scripts>
<script:ScriptCode Name="ThisDisplayCode" Type="JScriptNet">
<x:XData><![CDATA[
function DebugDump(sender : System.Object, cmdArgs : Ico.Gwx.CommandExecutionEventArgs)
{
var callback : Ico.Fwx.ClientWrapper.MethodCallDoneDelegate = ThisDocument.CreateDelegate(Ico.Fwx.ClientWrapper.MethodCallDoneDelegate, this, "CallDone");
ThisWindow.FwxClientWrapper.MethodCallAsync(":", "DebugDump", new Object[0], callback, null);
}
function CallDone(result : Ico.Fwx.ClientWrapper.MethodCallDoneResult)
{
message : String;
message = String.Format("Result: {0}", result.Status.ToString());
if ((result.OutputArguments != null)
&& (result.OutputArguments.Count > 0))
{
path = result.OutputArguments[0].ToString();
message += String.Format("\n\nDump file: {0}", path);
}
MessageBox.Show(message, "Debug Dump Result", MessageBoxButton.OK);
}
]]></x:XData>
</script:ScriptCode>
<script:ScriptCode Name="JScriptDotNetGlobalVariablesCode" Type="JScriptNet" EditorBrowsable="Never">
<x:XData><![CDATA[
var ThisWindow : Ico.Gwx.GwxRuntimeViewControl;
var ThisDocument : Ico.Gwx.GwxDocument;
var ThisConfiguration : Ico.Gwx.GwxConfiguration;
]]></x:XData>
</script:ScriptCode>
</script:ScriptCodeManager.Scripts>
</script:ScriptCodeManager>
</gwx:GwxDocument.ScriptCodeManager>
</gwx:GwxDocument>
</gwx:GwxDocument.GwxDocument>
Line by line, in plain words:
<gwx:GwxDocument.GwxDocument>opens the document element. Thegwx:prefix is a namespace, the surname that says this tag belongs to the GraphWorX library.<gwx:GwxDocument FileVersion="[redacted]" ScanRate="500">records the file version and a scan rate of 500, which is how often the display refreshes its data.<gwx:GwxDocument.ScriptCodeManager>starts the section that manages scripts.<script:ScriptCodeManager>and<script:ScriptCodeManager.Scripts>open the list of scripts.<script:ScriptCode Name="ThisDisplayCode" Type="JScriptNet">is the first script. Its name isThisDisplayCodeand its type is JScript.NET.<x:XData><![CDATA[starts the actual code. CDATA is an XML trick that says "everything until the closing marker is raw text, do not try to parse it as XML". Without it, the angle brackets and ampersands inside code would confuse the XML parser.- The first function,
DebugDump, takes two arguments and creates a callback, which is a function to be called later when some work finishes. It then callsMethodCallAsynconThisWindow.FwxClientWrapper, asking the display to run a method namedDebugDumpand to callCallDonewhen it is done. The":"is the target, andnew Object[0]is an empty list of arguments. - The second function,
CallDone, receives the result. It builds a message string withString.Format, checks whether there are output arguments, and if so appends the path of a dump file. Finally it shows the message in aMessageBox, a pop-up dialog. ]]></x:XData>closes the raw text section, and</script:ScriptCode>closes the first script.- The second script,
JScriptDotNetGlobalVariablesCode, is markedEditorBrowsable="Never", meaning the editor hides it from the user. It declares three global variables:ThisWindow,ThisDocumentandThisConfiguration. A global variable is one that any part of the script can see. These three give the script a handle on the window, the document and the configuration, which is exactly the kind of access an attacker would want. - The remaining closing tags close the lists and sections in reverse order, the way you close nested boxes.
This is JScript.NET code embedded in the file. It is a documented feature for adding scripts to projects, not a bug in itself. The feature exists so that project authors can automate displays: for example, to react to a button press or to fetch a value.
Opening the .gdfx file, however, produced a "File Access Denied" message. An ICONICS user apparently has to be logged in before this file will open. "File Access Denied" is the standard Windows message when a program is not allowed to read something. The researcher noted this behaviour and made a note to check two things later: whether the JScript code could run before the authentication check, or whether the authentication could be bypassed. Authentication here means proving who you are, usually with a username and password. He then carried on with the survey of default file types.
Exploiting it
Step 1: find a file type that carries scripts and opens without authentication
A GraphWorX64 Template file, .tdfx, contains the same ScriptCodeManager tag, and it opened without requiring authentication. A template is a starting point for a new display, the way a word processor has a blank document with styles already set. The .tdfx template file opened without requiring authentication, unlike the .gdfx file. That single difference is what turned a documented feature into a vulnerability.
Step 2: put code in a ScriptCode tag
Adding the following code into a ScriptCode tag in the template file causes calc to be executed when the file is opened:
var objShell = new ActiveXObject("Shell.Application");
objShell.ShellExecute("calc.exe", "", "calc.exe", "open", 0);
Line by line, in plain words:
var objShell = new ActiveXObject("Shell.Application");creates an object.ActiveXObjectis a Windows mechanism that lets a script ask the operating system for a component by name.Shell.Applicationis a built-in Windows component that can open files and start programs. The result is stored in a variable calledobjShell, so the next line can use it.objShell.ShellExecute("calc.exe", "", "calc.exe", "open", 0);calls theShellExecutemethod on that component. The first argument is the file to run,calc.exe, the Windows calculator. The second is the parameters to pass, here empty. The third is the working directory, alsocalc.exein this example. The fourth is the verb,open, which means "open this file with its default program". The fifth,0, is the window style, which controls how the window is shown.
Because the script runs inside the application when the document is loaded, the calculator process is started as a child of the Genesis64 process. A "child process" is a program started by another program; the operating system records the relationship. The calculator is started when the file is opened.
Step 3: decide whether to submit
The researcher is explicit that this is a shallow bug and a weak entry for Pwn2Own. "Shallow" means it was easy to find and easy to trigger, with no clever trick required. The main risk was collision: other researchers were likely to find the same thing. A collision in this context means two contestants submit the same bug, and the rules usually give credit only to the first. At that point only a couple of hours of effort had gone into it, so the alternative was to report it to ZDI immediately and keep looking for better bugs. The alternative was to report it to ZDI immediately and keep looking for better bugs.
The decision was complicated further when the contest was delayed by a few months because of the Omicron surge in Florida. Omicron was a variant of the virus that caused COVID-19, and the delay changed the timing of everything. In the end the researcher took his chances with the weak bug. Despite being the fifth of seven researchers to target Iconics Genesis64, the bug did not collide with the earlier attempts and the entry was successful. Being fifth means four other people had already tried the same product before him, which made a collision more likely, not less. It still worked out.
Why it worked
Genesis64's document formats support embedded JScript.NET through ScriptCode elements, and the application executes that script when the document is opened. The .tdfx template file opened without requiring an ICONICS login, so the script ran with no authentication step in front of it. The script creates a Shell.Application ActiveX object and uses it to launch a process.
The login required for .gdfx was absent for .tdfx. This is a classic pattern in security: a safety check applied in one place but forgotten in another, similar to locking the front door but leaving the kitchen window open.
What an attacker could do
An attacker who can get a victim to open a crafted .tdfx file can run arbitrary JScript.NET code in the context of the Genesis64 application, and from there execute programs on the host, as demonstrated with calc.exe. "Arbitrary code execution" is the security term for this: the attacker, not the program's author, decides what runs. The attack requires the file to be opened on the target machine, which the 2022 contest rules accept as a valid scenario for file types handled by default by the target application.
The researcher characterises the bug as shallow and weak, and notes that finding attack surface which has not seen significant scrutiny is often all that is needed to find and exploit critical vulnerabilities. "Attack surface" means all the ways an attacker can interact with a program: every file it opens, every network port it listens on, every input it accepts. The more surface, the more places to look for mistakes. "Scrutiny" means other people have already looked at it closely. New surface is often soft surface.
The fix
ZDI assigned CVE-2022-33317 to the vulnerability. A CVE is a public catalogue number for a known security flaw, so people around the world can refer to the same bug unambiguously. ICONICS fixed it in version 10.97.2. The write-up credits the vendor for the timely fix. "Vendor" is the company that makes the product.
Other places to look
These are the kinds of follow-up checks the same approach suggests:
- Other default-handled document types that embed script or serialised objects. Search the installation for example files of each type and grep them for script, serialisation and class-instantiation markers. "Grep" means searching text for a pattern. A positive result is a file that opens without authentication and whose embedded content runs or is deserialised.
- Formats that require authentication, such as
.gdfxhere. Check whether the embedded script runs before the login check, or whether the check can be bypassed. A positive result is code execution from a file opened while logged out. - Template and example files shipped with the product. These are often opened without the restrictions applied to project files, as with
.tdfx. A positive result is a template that accepts aScriptCodeelement and executes it on open. - Script hosts inside the application that expose COM or .NET objects. Try instantiating objects such as
Shell.Applicationfrom the embedded language. A positive result is a process spawned by the target application when the document loads.
Glossary
- ActiveXObject: a Windows mechanism that lets a script request a built-in system component by name, such as
Shell.Application. - Arbitrary code execution: a flaw where an attacker, rather than the program's author, decides which code runs on the machine.
- Attack surface: every way an attacker can interact with a program, including files it opens, network ports it listens on and inputs it accepts.
- Authentication: the process of proving who you are, usually with a username and password.
- Binary format: a file made of raw bytes rather than readable text.
- Callback: a function passed along so it can be called later, when some work finishes.
- CDATA: an XML marker that says the enclosed text is raw and should not be parsed as XML.
- Child process: a program started by another program; the operating system records the relationship.
- Collision: two contestants submitting the same bug, where usually only the first gets credit.
- COM (Component Object Model): an older Microsoft system that lets programs use each other's components.
- Compressed: packed to take up less space, and needing to be unpacked before use.
- CVE: a public catalogue number for a known security flaw, so everyone can refer to the same bug unambiguously.
- Dependency: another piece of software that a program needs in order to work.
- Deserialisation: rebuilding a live object in memory from a stream of bytes, such as the contents of a file.
- Global variable: a variable that any part of a script can see and use.
- Grep: searching text for a pattern.
- ICS (industrial control systems): software and hardware used to monitor and control machinery and industrial processes.
- ISO: a single file containing a complete disc image, used to distribute installers.
- JScript.NET: Microsoft's older scripting language, a cousin of JavaScript, designed to run inside .NET applications.
- Method: an action that an object can perform, such as
ShellExecute. - Namespace: a label that groups names so two libraries can use the same tag or name without confusion, like a surname.
- .NET: Microsoft's software platform for running programs.
- Object: a bundle of data and actions inside a program, created from a description called a class.
- Pwn2Own: a recurring hacking contest where researchers try to break into specific products in front of judges for prize money.
- Remote attacker: someone attacking over a network from another machine, rather than sitting at the target computer.
- Script: a short program stored as text, often embedded in a document.
- Serialisation: turning a live object in memory into a stream of bytes so it can be saved or sent.
- Shallow bug: a flaw that is easy to find and easy to trigger, with no clever trick required.
- SQL: the language used to talk to databases.
- Template: a starting point for a new document, with some content or styles already set.
- Vendor: the company that makes a product.
- WCF (Windows Communication Foundation): a Microsoft framework that lets two programs talk to each other over a network.
- XML: a way of writing structured data using tags in angle brackets.
- ZDI (Zero Day Initiative): the organisation that runs Pwn2Own and coordinates disclosure of security flaws to vendors.