The method's name describes the method's behavior
ConnectWise's ManagedITSync was a Kaseya VSA add-on whose job was to keep ConnectWise PSA's customer-asset inventory in sync with what Kaseya's RMM saw on managed endpoints. New machine discovered by Kaseya, new Configuration record in ConnectWise. The integration ran inside the Kaseya VSA web stack and listened on the same port the MSP's technicians used to reach the management console.
The integration's HTTP surface is /KaseyaCwWebService/ManagedIT.asmx, an ASP.NET SOAP service. Alex Wilson's owlky.py, committed to GitHub on November 7, 2017, opens with the URL it points at and the check it uses to confirm a target is exploitable:
BAD_URI = 'KaseyaCwWebService/ManagedIT.asmx'
def check_kaseya(hostname, verbose=None):
for scheme in ('https', 'http'):
try_url = '{}://{}/{}'.format(scheme, hostname, BAD_URI)
res = requests.get(try_url, timeout=5)
if 'ManagedIT.asmx?op=' in res.text:
return try_url
The check is reachability. ManagedIT.asmx?op= is the substring ASP.NET emits in the SOAP service description page. If the page renders, the target is exploitable. There is no auth probe in the script because there is no auth to probe.
The PoC then issues POSTs to four method endpoints. The transport is unceremonious:
def get_kaseya_data(base_url, endpoint, post_data=None, verbose=None):
endpoint_url = '{}/{}'.format(base_url, endpoint)
res = requests.post(endpoint_url, data=post_data)
No cookies, no token, no SOAPAction header that the script bothers to set. The integration's four methods that the PoC walks are ExecuteSQL (takes a sql parameter, runs it), GetDataSet (takes a sql parameter, runs it, returns the row set), GetConnectionString (takes nothing, returns the Kaseya VSA database DSN with credentials), and GetAllMachineIDs (returns a base64-gzipped UTF-16 dump of every machine the Kaseya server is currently managing). Each is an internal API call that ConnectWise's integration documented as something Kaseya-internal code would hit, then bound to an unauthenticated HTTP path on the customer's perimeter.
The RMM was the supply chain
The point is not the SQL. The point is what ExecuteSQL writes to.
Kaseya VSA's administrators table holds the master-list of accounts that can log into the web console. A Kaseya admin can write an Agent Procedure: a script with full Kaseya VSA syntax that the platform pushes to every endpoint the MSP manages, where it runs as SYSTEM. That capability is what the product is for. An MSP buys Kaseya VSA so that one technician can deploy a Windows patch across two thousand machines in fifteen networks without logging into any of them. The Agent Procedure path is the legitimate workflow.
owlky.py's reset-support command writes one row to the administrators table and then exits:
resetuser = 'kaseyasupport'
resetpass = str(uuid.uuid4()).replace('-','')[-8:]
covered = cover_pass_256(resetpass, resetuser)
resetsql = "UPDATE administrators SET forceNewPassword=0,disableUntil='1980-01-01 00:00:00.000'," + \
"adminType=2,adminPassword='cover{}' WHERE adminName='{}'".format(covered, resetuser)
reset = get_kaseya_data(res_url, 'ExecuteSQL', {'sql': resetsql})
kaseyasupport is the account that every Kaseya VSA installs by default for vendor support access. forceNewPassword=0 disarms the reset-on-login prompt. disableUntil='1980-01-01' defeats the lockout policy by predating any plausible disable timestamp. adminType=2 is full master admin. adminPassword is set to the literal string cover concatenated with the hex SHA-256 of (password + username), which is Kaseya VSA's storage format. The attacker logs in through the front door with the password the script just printed, and the front door does not see any difference between this admin and the MSP's own.
What happens next is Kaseya's documented workflow. The attacker writes one Agent Procedure, schedules it against the "All Machines" group, and presses Run. Kaseya VSA pushes the procedure to every endpoint in every customer network the MSP manages. The endpoint runs it as SYSTEM. In MSP hands, this is how Acrobat Reader gets updated. In a GandCrab affiliate's hands, in February 2019, this is how pewdiepie.exe reached two thousand endpoints belonging to one MSP's customers.
This is the canonical security-tool-as-primitive shape. The defender's deploy-everywhere reach is the attacker's deploy-everywhere reach because both are calling the same method on the same agent. The privileged action the RMM ships with is the primitive a ransomware operator wants. The blast radius is the deployment footprint, and the deployment footprint of a Kaseya VSA at an MSP is, by construction, every endpoint that MSP has ever onboarded. Kaseya VSA was the supply chain. ConnectWise hung an unauthenticated SOAP method off it called ExecuteSQL.
It is also the trust-inversion shape one floor up. The Kaseya admin login is the authorizer the customer trusts to decide what code runs on which managed endpoint. ConnectWise's integration issues that authorizer to any HTTP caller who can reach /KaseyaCwWebService/ManagedIT.asmx. The validation lane (the Kaseya VSA web console's login form) was never the relevant gate, because the trusted lane (the Agent Procedure path executing as SYSTEM on every endpoint) was already running whatever the database said the admin had asked for.
The patch was a knowledge base article
Alex Wilson reported the bug to ConnectWise during 2017. ConnectWise's response is documented in his own README, which credits the vendor for two specific actions: pulling the integration from the ConnectWise Marketplace, and publishing a knowledge base article in ConnectWise University titled Kaseya - IP and Domain Restrictions. The article describes how an MSP can configure their Kaseya VSA's IIS site to restrict which source IPs and domains are permitted to reach ManagedIT.asmx.
There was no code change visible to customers. The integration that was already installed on a customer's Kaseya VSA did not receive an update. No runtime banner warned the MSP that the endpoint was reachable from the internet. No automatic configuration disabled the SOAP service. The customer had to log into ConnectWise University, find the article, understand that it applied to them, log into their Kaseya VSA's IIS Manager, and write the IP rule.
The integration had often been installed silently as part of a Kaseya VSA setup that bundled the ConnectWise PSA tie-in. Many MSPs did not know they had it. The advisory ConnectWise sent to existing customers was the document explaining that they did.
For fifteen months, the bug was patched in ConnectWise's mind, in their marketplace listing, and in their knowledge base. It was not patched on any single MSP's Kaseya VSA until that MSP read the article and configured the IP restriction. The customer-side patch rate during that window is the variable that decides whether each individual MSP's two thousand customers got encrypted in February 2019 or did not.
MITRE caught up the week GandCrab did
The CVE number 2017-18362 indicates MITRE reserved the identifier in 2017. The record was not published until February 5, 2019.
The publication date is not a coincidence. The week of February 4, 2019, a GandCrab affiliate ran the chain Alex Wilson had committed to GitHub on November 7, 2017 against publicly-reachable Kaseya VSA servers. Huntress was called in by enough impacted MSPs to recognize the pattern and write up the case. Coveware's incident-response writeup of one Reddit-reported case puts the count at 1,500 to 2,000 endpoints encrypted at a single MSP, with the aggregate ransom demand reportedly over $2.6 million. Huntress published their writeup the same week. MITRE published the CVE record February 5.
The PoC had been runnable on GitHub for fifteen months. For fifteen months a defender searching the CVE database for Kaseya VSA risks would find nothing about this one; a defender searching GitHub for ManagedIT.asmx would find a working exploit script and a README that named the vendor, the endpoint, and the mitigation. The two populations of defender, the ones who watch CVE feeds and the ones who watch GitHub, are not the same population.
This is the disclosure-after-exploitation pattern in its base form. The pipeline ran in reverse: vendor knowledge base article, customer non-update, attacker discovery via Reddit-visible compromise, IR firm pattern match, CVE assignment. The defender's first signal from the CVE infrastructure that the bug had ever existed was the ransom note for the encryption of their customer fleet, not the advisory. Kaseya VSA's place in the catalog joins CrushFTP, FortiManager, and Ivanti as products where the CVE arrives to document a breach record that incident responders have already begun to write. CISA eventually added CVE-2017-18362 to the Known Exploited Vulnerabilities catalog. By the time the federal agency had a remediation directive, the Kaseya VSA on-prem product had been end-of-lifed; the directive was to disconnect the product.
CWE-89 is the wrong label
The NVD record assigns CWE-89, "Improper Neutralization of Special Elements used in an SQL Command." CWE-89 is SQL injection. SQL injection assumes there is a query the developer intended to be parameterized and an attacker who smuggled syntax into a parameter to hijack the query's grammar.
There is no parameterized query here. There is a SOAP method named ExecuteSQL whose contract is to run whatever string the caller sends as a sql parameter. The handler took the parameter and dispatched it to the database. There is no developer intent that the parameter would be sanitized, because the parameter was meant to be the query.
The same is true of GetDataSet, which is ExecuteSQL plus row-formatting; GetConnectionString, which is a method whose entire purpose is to return database credentials to the caller; and GetAllMachineIDs, which dumps the managed-endpoint inventory. None of these are bugs in a parser. They are documented internal API methods that the integration bound to an unauthenticated HTTP path the customer did not know was listening.
CWE-89 was the closest fit in MITRE's vocabulary. It is not the shape of the bug. The shape of the bug is that the integration's authors believed the SOAP endpoint was only reachable from Kaseya-internal code on the same host, and the customer's IIS configuration believed the SOAP endpoint was a normal /KaseyaCwWebService/*.asmx resource that should be served to whoever asked for it. The two beliefs never reconciled, and the document that would have reconciled them lived behind a customer login in ConnectWise University.
PoC: kbni/owlky
The patch removed a marketplace listing. The endpoint kept listening.