Maltego CVE-2020-24656 Analysis
Maltego versions 4.2.11 and below are vulnerable to XML external entity (XXE) injection when processing MTZ and MTGL files, allowing an attacker to exfiltrate local files from a victim's computer. The attacker must convince the victim to open a malicious file.
hackersforchange.com
Published on hackersforchange.com
"Maltego is software used for open-source intelligence and forensics, developed by Paterva from Pretoria, South Africa. Maltego focuses on providing a library of transforms for discovery of data from open sources, and visualizing that information in a graph format, suitable for link analysis and data mining." -…
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
Likely the XML parser used by Maltego does not disable external entity resolution, allowing an attacker to define entities that read local files and exfiltrate them.
Impact
An attacker could exfiltrate local files from the victim's computer, which may contain secrets such as private keys; in targeted scenarios, SSRF could lead to code execution on the victim's computer or another computer on the victim's network, though this is typically limited to specific network configurations.
What the attacker needed
Victim opens a malicious MTZ or MTGL file; Attacker can host a malicious DTD
The fix
The issue was fixed in Maltego version 4.2.12.
How it was found
- Create an empty graph file in Maltego and drag an entity into the view, then save it.
- Extract the MTGL archive (it is a ZIP file).
- Modify an entity XML file to include an external entity that fetches a remote DTD.
- Host a malicious DTD on a server that defines entities to read a local file and exfiltrate it via an HTTP request.
- Repackage the modified files into a new MTGL file.
- Send the malicious MTGL file to the victim and convince them to open it in Maltego.
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.
Maltego is a tool for visualising connections between data. The files it uses to save projects are actually ZIP archives containing XML files. XML has a feature called 'external entities' that lets a file pull in content from elsewhere, including local files. The vulnerability is that Maltego processes these external entities without restriction, so a malicious project file can read local files and send them to an attacker's server.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.