This website uses cookies

To provide the highest level of service we use cookies on this site.
Your continued use of the site means that you agree to their use in accordance with our terms and conditions.

Pentest Chronicles

XXE using J4LFOPServer leading to Remote Code Execution

Jakub Żoczek

June 13, 2025

Introduction While testing the LAN infrastructure of one of our clients I discovered that one of the applications is handling XML input which led to finding critical vulnerabilities. By allowing the definition of custom entities within XML input better known as XML External Entity (XXE) the application exposed itself to a range of serious threats, including local file disclosure, external network interactions resulting in NTLMv2 hash leakage, and most notably, Remote Code Execution through the use of XSLT templates.
Technical Details The first step was identification of open services for the server using nmap:
Jetty instance on port 8087/tcp shows two deployed applications (including their full path in the system):
The J4LFOPServer - based on information published over the Internet - is an application / component being part of Oracle Application Express / Apex reporter and used to generate PDF files based on XML input and Apache FOP templates. Accessing application from the browser revealed directory listing with two files - Example.html and FOP.html:
The first one - Example.html shows a simple form with XML input:
By clicking Convert to PDF button - a PDF document based on XML input is generated:
One of the abilities of XML is to define entities, which can be external references to files in the filesystem or network resources. To confirm that, auditor created external entity reference to controlled HTTP server:
After converting such input to PDF, it was possible to see HTTP interaction in Burp Collaborator tool: As an alternative payload instead of URL, it was possible to use network share in format: \\10.27.20.41\anything Server under IP 10.27.20.41 was the machine controlled by the auditor and running application Responder - a special tool used to poison LLMNR / NBT / MDNS and DNS answers and try to collect NTLMv2 hashes from the network. Forcing the application through XXE vulnerability to request this network share, resulted in interception of attacked server NTLMv2 hash: Cracking this password allowed the execution of code on this and other servers and was a base for a lot of sensitive information disclosure and privilege escalations. However, there is also a second way to achieve code execution using J4LFOPServer and it is under FOP.html file: There is also a simple form that expects uploading two files - XSL-FO template and XML file. Digging through the Apache FOP documentation, the auditor was able to find FOP file examples that show that it partially uses XML and XSLT structures to give the final PDF a certain style. There are known methods of using XSLT to execute code in different programming languages. Below is an example implementation of FOP file that allows code execution: Now we have a sample valid XML file: Uploading those two on FOP.html and clicking on convert button will show such output: We can also notice DNS interaction which is proof of remote code execution achieved: Final Notes As part of our recommendations, we advised the client to assess whether the vulnerable application, likely installed over a decade ago is still actively in use. If it no longer serves a functional purpose, the safest course of action would be to remove it entirely. Given the lack of an available changelog and uncertainty around whether J4LFOPServer is still maintained, we also recommended considering alternative, well-supported solutions that offer similar functionality but with ongoing security updates and vendor support.





Next Pentest Chronicles

When Usernames Become Passwords: A Real-World Case Study of Weak Password Practices

Michał WNękowicz

9 June 2023

In today's world, ensuring the security of our accounts is more crucial than ever. Just as keys protect the doors to our homes, passwords serve as the first line of defense for our data and assets. It's easy to assume that technical individuals, such as developers and IT professionals, always use strong, unique passwords to keep ...

SOCMINT – or rather OSINT of social media

Tomasz Turba

October 15 2022

SOCMINT is the process of gathering and analyzing the information collected from various social networks, channels and communication groups in order to track down an object, gather as much partial data as possible, and potentially to understand its operation. All this in order to analyze the collected information and to achieve that goal by making …

PyScript – or rather Python in your browser + what can be done with it?

michał bentkowski

10 september 2022

PyScript – or rather Python in your browser + what can be done with it? A few days ago, the Anaconda project announced the PyScript framework, which allows Python code to be executed directly in the browser. Additionally, it also covers its integration with HTML and JS code. An execution of the Python code in …

Any questions?

Happy to get a call or email
and help!