Skip to content
Path traversal Write-up Advanced

[Blog] RCE in Citrix ShareFile Storage Zones Controller (CVE-2021-22941) – A Walk-Through

A relative path traversal in Citrix ShareFile Storage Zones Controller allowed unauthenticated attackers to write files to arbitrary locations, including the web root, by manipulating the uploadid parameter. This could be exploited to overwrite an existing Razor view file and achieve remote code execution.

code-white.com

Published on code-white.com

Citrix ShareFile Storage Zones Controller uses a fork of the third party library NeatUpload. Versions before 5.11.20 are affected by a relative path traversal vulnerability (CTX328123/CVE-2021-22941) when processing upload requests.

The author, on code-white.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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application failed to validate the uploadid parameter before using it in a file path, allowing directory traversal.

What the attacker needed

Unauthenticated access to the upload endpoint; ability to send multipart POST requests

How it was found

  1. Send a multipart POST request to upload.aspx with query parameters id, bp, and accountid, and a part with name and filename attributes.
  2. Ensure the multipart part is larger than 4096 bytes to trigger the vulnerable code path.
  3. Set the id parameter to a traversal sequence like ../foo to write a file outside the intended directory.
  4. Overwrite an existing Razor view file such as ConfigService\Views\Shared\Error.cshtml with malicious content.
  5. Access the overwritten view via /ConfigService/Home/Error to execute the payload.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The software took a user-supplied value and used it directly to build a file path without checking for '..' sequences, which let an attacker write files outside the intended folder. Because the attacker could write into the web server's root directory, they could replace a page template with malicious code that runs on the server.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.