Signs include unexpected child processes, new network connections, abnormal CPU or memory use, web shells, altered class files, and unexplained file writes by the Java process. Review runtime logs, process trees, and outbound traffic for command execution, code injection, or deserialisation abuse. A compromised JVM may also show persistence through scheduled tasks or changed startup parameters.
What exploitation looks like in a Java runtime
A compromised Java runtime often behaves like a living process, not a static application. The most useful signs are process-tree changes, unexpected outbound connections, altered class-loading behaviour, and file activity that does not fit the application’s normal runtime pattern. Those signals matter because Java abuse often blends code execution, in-memory loading, and persistence into ordinary service behaviour.
Look first for what the JVM should not be doing. Unexpected child processes, spawned shells, or helper binaries usually indicate command execution from inside the runtime, while modified class files or unusual writes into application directories can point to dropped payloads or runtime tampering. If the application suddenly starts reaching new internet hosts, downloading content, or beaconing at odd intervals, treat that as a strong compromise indicator rather than a simple application error.
Command execution in Java environments often hides behind deserialisation abuse, reflection, classpath manipulation, or injected bytecode, so the visible symptom may be indirect. That is why runtime logs, application logs, and operating-system telemetry need to be read together: one source may show the trigger, another may show the spawned process, and network telemetry may show the outbound stage that follows. Where possible, preserve the initial logs before restarting the service, because volatile evidence can disappear with a clean shutdown.
What the runtime artefacts usually tell you
Not every anomaly means active exploitation, but the pattern matters. High CPU or memory use on its own can reflect load, yet when it appears alongside unfamiliar child processes, new sockets, or file writes outside the normal deployment path, it suggests the JVM is doing more than serving requests. Similarly, persistence signals such as scheduled tasks, changed startup flags, or altered service wrappers often mean the attacker is trying to survive a restart, not just run one malicious action.
Class-file changes deserve special attention because they can reflect code replacement, agent injection, or tampering with deployed components. If class timestamps, hashes, or directory ownership have changed unexpectedly, compare them to the last known good release and deployment record. A runtime that is still serving requests can still be compromised if the malicious code is injected in memory or loaded from an unexpected path.
For validation, compare process trees, listening ports, recent file writes, and outbound traffic against a known-good baseline for that service. The goal is to separate normal application churn from attacker activity. A single suspicious event may be noise, but a cluster of process, network, and file anomalies usually justifies incident handling rather than routine troubleshooting.
How to investigate without losing evidence
Once exploitation is suspected, avoid the instinct to restart immediately. Restarting can destroy volatile evidence, clear injected memory artefacts, and trigger the attacker’s fallback mechanism if persistence is already in place. Capture the current process list, open connections, command-line arguments, loaded modules or agents, recent file changes, and relevant logs before any remediation step that would alter the live state.
Then check whether the runtime has been used as an execution bridge into the wider host. A Java exploit may begin inside the application but quickly extend to shell execution, credential harvesting, or lateral movement. The most useful question is not only “was the JVM exploited?” but “what did the runtime allow the attacker to do next?” That framing helps distinguish a contained event from a broader host compromise.
Where a Java service runs with elevated rights, inherited secrets, or access to internal systems, the blast radius can extend beyond the JVM itself. In those cases, document any credentials, tokens, keys, or service accounts that the process could reach, because the impact assessment may need to include rotation or revocation if exposure is plausible.
Risk and Threat Considerations
Java runtimes are attractive because they often sit in high-trust application tiers and can load code dynamically. That gives an attacker multiple ways to hide: process injection, malicious class loading, deserialisation chains, or post-exploitation persistence that looks like normal service activity until you correlate the logs.
Failure mechanism: The compromise often succeeds when defenders watch only the application layer and miss the runtime’s secondary behaviours, such as spawned shells, external callbacks, or modified startup state.
Impact: A successful abuse can lead to command execution, data access, persistence, and further movement from the application host into connected systems.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8 sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| MITRE ATT&CK | T1059 — Command and Scripting Interpreter | Java runtime exploitation often leads to spawned shells and command execution. |
| T1055 — Process Injection | Injected code or runtime tampering can present as abnormal in-process behaviour. | |
| T1053 — Scheduled Task/Job | Persistence via scheduled tasks is a common post-compromise sign in Java hosts. | |
| Recommendation — Map spawned shells and command execution from the JVM to T1059 and hunt for follow-on activity. Correlate suspicious JVM memory and process behaviour with T1055 indicators. Check scheduled tasks and startup mechanisms for persistence after JVM compromise. | ||
| CIS Controls v8 | CIS-8 — Audit Log Management | Runtime and OS logs are central evidence for spotting Java exploitation. |
| Recommendation — Centralise and retain JVM, application, and host logs for rapid compromise review. | ||
Practitioner Guidance
What to verify: Confirm whether the suspicious activity is new for that service by comparing current process trees, network destinations, and file writes against a clean baseline. If the same indicators appear across multiple hosts, treat the issue as an attack pattern rather than an isolated anomaly.
Decision rule: If you see child processes, unexplained outbound traffic, and changed class files together, prioritise containment and evidence preservation before trying to “fix” the runtime. If only one signal exists, verify it against deployment history, scheduled jobs, and recent package changes before escalating.
Practitioner takeaway: The strongest Java exploitation indicators are correlated runtime anomalies, not a single noisy metric, so the investigation should focus on process, network, and file evidence as one chain of activity.
Related resources from NHI Mgmt Group
- What signs suggest a framework deserialization flaw is being exploited?
- What signs suggest a privileged access appliance has been exploited?
- What signs suggest a frontend dependency is hiding runtime payloads?
- Is CVE-2012-1723 (Oracle Java SE Runtime Environment (JRE) Arbitrary Code Execution) being exploited in the wild?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org