Prologue
An unauthenticated RMI method in SAP J2EE Engine allowed reading and exporting configuration data, including keystores used to sign SAP Logon Tickets. An attacker could use the exported keystore to forge an administrator ticket and gain full administrative access.
This blog post describes the research on SAP J2EE Engine 7.50 I did between October 2020 and January 2021. The first part describes how I set off to find a pure SAP deserialization gadget, which would allow to leverage SAP's P4 protocol for exploitation, and how that led me, by sheer coincidence, to an entirely…
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 JUpgradeIF.openCfg() method lacked an authorization check, allowing unauthenticated users to read and export configuration data.
What the attacker needed
Network access to the P4 port; No authentication required
How it was found
- Connect to the P4 port of the SAP J2EE Engine.
- Use the JNDI context to look up the MigrationService and obtain a JUpgradeIF_Stub.
- Call openCfg() on the stub to get a Configuration object.
- Navigate the configuration tree to the desired node, such as the TicketKeystore.
- Export the node to an archive file on the server's file system.
- Download the archive via HTTP from a web application root folder.
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.
The SAP J2EE Engine had a remote administration service that let anyone call a method to read configuration settings without logging in. One of those settings was a file containing the secret key used to create login tickets. By stealing that key, an attacker could make a fake ticket for the administrator and log in as them.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.