XXE with Auto-Update in install4j
The install4j auto-update feature parsed XML from the update server without properly disabling external entities, so an attacker who could control the update response could read local files or leak Windows credentials. The vendor fixed the entity resolver in version 10.0.5.
Published on frycos.github.io
In this blog post I describe a vulnerability for which I got a little bit too excited in the beginning. It is related to a target of the upcoming Pwn2Own 2023 competition.
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 custom entity resolver only blocked lowercase http and https system identifiers, so uppercase schemes and other protocols such as file and jar still resolved external entities.
Impact
An attacker who controls the update response could read local files or leak hashed Windows credentials, but for the Prosys product a fake TLS inspection component was needed because it is not vulnerable to common DNS hijacking.
What the attacker needed
Control of update server response; product uses install4j auto-update; for Prosys: fake TLS inspection
The fix
The entity resolver was changed in version 10.0.5 so that external entities are blocked for any protocol handler.
How it was found
- Hijack the update server communication, for example by answering DHCPv6 to change DNS and adding a fake TLS inspection component.
- Serve a crafted XML update response that declares an external DTD over HTTP.
- Host a DTD that defines an entity reading a local file and sending it to the attacker server.
- Trigger an automatic or manual update check in the affected product.
- Receive the file content at the attacker server.
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.
When software checks for updates, it downloads a small XML file describing the newest version. XML can be told to include content from other places, such as a file on the computer or a network share. The update code did not block those external references, so someone who could fake the update server could make the program read and send back local files.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.