Skip to content
Access control Write-up Advanced

StateFilter Arbitrary Forward Authentication Bypass Vulnerability

The StateFilter in ManageEngine Desktop Central allowed an unauthenticated attacker to forward requests to internal servlets, bypassing authentication. This could be chained with a directory traversal in AgentLogUploadServlet to write a malicious file and achieve remote code execution, or with ChangeAmazonPasswordServlet to reset the admin password.

Steven Seeley Follow

Published on srcincite.io

On December 3, 2021, Zoho released a security advisory under CVE-2021-44515 for an authentication bypass in its ManageEngine Desktop Central and Desktop Central MSP products. On December 17, 2021, the FBI published a flash alert, including technical details and indicators of compromise (IOCs) used by threat actors.

Steven Seeley (@steventseeley), on srcincite.io

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 StateFilter forwards requests to internal paths without enforcing authentication, and the forwarded request bypasses subsequent security filters.

Impact

An unauthenticated attacker could write a malicious file to the server's library directory and achieve remote code execution after a restart, or reset the administrator password; however, the StateFilter bypass alone only reaches servlet endpoints, not REST APIs, and the file upload is limited to zip, 7z, or gz extensions.

What the attacker needed

No authentication required; Server must be restarted for RCE chain; File extension must be zip, 7z, or gz

The fix

Zoho fixed the arbitrary forward by adding /STATE_ID/* to a secured context requiring authentication, and fixed the directory traversal by validating the computerName and other parameters; the password reset issue was also fixed and assigned CVE-2022-23863.

How it was found

  1. Craft a request to a URL under /STATE_ID/ with a STATE_COOKIE cookie containing a valid state map to pass StateParserGenerator.processState.
  2. Set the request URI so that getForwardPath returns the path of a target servlet, such as /agentLogUploader.
  3. The StateFilter forwards the request to the target servlet, bypassing authentication.
  4. For the AgentLogUploadServlet chain, send a POST request with a computerName parameter containing directory traversal and a filename ending in .zip, .7z, or .gz, and a body containing a malicious file.
  5. The file is written to a directory such as C:\Program Files\DesktopCentral_Server\lib, and upon server restart, the malicious code executes.
  6. Alternatively, forward to ChangeAmazonPasswordServlet with loginName and newUserPassword parameters to reset the admin password.

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.

A filter is a piece of code that checks requests before they reach the main application. Here, the filter could be tricked into forwarding a request to a sensitive part of the application without checking if the user is logged in. This let an attacker reach dangerous functions, like uploading files or changing passwords, without any credentials.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Steven Seeley

View all

6 more disclosed reports, best first.

More from Zoho

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.