IBM Db2 Mirror for i: pre-auth RCE and the road to QSECOFR
The Db2 Mirror web interface had an authentication filter that could be bypassed with a semicolon path parameter, and a pre-auth switch that disabled input validation. Chaining these with a trace-file write primitive let an unauthenticated attacker write a JSP into the expanded WAR and get Java code execution in the Liberty server.
This is a write-up of a bug chain in the IBM Db2 Mirror for i web interface. The chain starts without authentication, reaches arbitrary Java/JSP execution in the Liberty application server, and can then cross into QSECOFR on the local IBM i system.
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 authentication filter compared a raw URI segment to the servlet name without accounting for path parameters, and a pre-auth debug flag disabled validation for the whole session.
Impact
An unauthenticated attacker could achieve arbitrary Java/JSP execution in the Liberty application server, and the text claims this can then cross into QSECOFR on the local IBM i system.
What the attacker needed
Network access to the web interface; no credentials needed
How it was found
- Start an unauthenticated session and send a request with skipVald=true so the filter stores it in the session.
- Reuse the same session cookie and call protected action methods through the semicolon path parameter.
- Call updateLogSetting to enable Toolbox tracing and point the trace file at a new JSP under the expanded WAR.
- Call SetupAction.verifyConnection with the JSP text in the hostname parameter so trace data is written to the JSP.
- Disable tracing or restore the previous log setting.
- Request the generated JSP and look for the marker and server-side Java properties.
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 web app had a security check that looked at the URL in a naive way. By adding a small extra piece to the URL, an attacker could make the check think the request was for something else, so it skipped the login check. A second flaw let anyone turn off input checking, and a logging feature could then be abused to write a file that the server later runs as code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.