Skip to content
Vulnerabilities

Detecting Apache Struts Vulnerabilities: Log Patterns and Blind Spots

Hidden file uploads and unusual content types in web server logs reveal Struts exploitation attempts before payload execution occurs on the server.

Illustration: A blank computer monitor sits on a cluttered desk, displaying a web browser window with abstract gray bars representing hidden file uploads.
AI-generated illustration: TechWire Beat
Quick answer

Monitor web server logs for multipart form data with unexpected content types or file extensions. Check for short-lived processes that spawn shells. Use software composition analysis to identify vulnerable versions. Look for encoded payloads in query strings that bypass standard input validation.

HTTP Header Anomalies in Access Logs

Web application firewalls often miss attacks that exploit the deserialization logic within Apache Struts. You must examine raw access logs for specific header manipulations. Attackers modify the Content-Type header to trick the server into processing malicious data. Look for headers that claim to be XML or JSON but contain serialized Java objects. This technique bypasses basic input validation rules that check for standard web formats.

The Accept header may also contain unusual values designed to trigger specific parsing routines. Some attacks rely on the server attempting to parse a response in a format it does not expect. This causes the application to dereference null pointers or execute arbitrary code during the parsing phase. You should flag any request where the Accept header includes complex nested structures or unusual media types.

Multipart Form Data Inspection

File upload functionality is a common vector for Struts exploitation. The server processes multipart form data to handle file submissions. Attackers inject malicious payloads into the boundary strings or file names within these requests. You need to inspect the raw request body for multipart data that contains executable code or script fragments. Standard web logs often truncate the request body, hiding the malicious content.

Enable full request logging on your reverse proxy or web server. This captures the entire HTTP request, including the body. Look for multipart boundaries that contain unusual characters or encoded strings. These boundaries may carry commands that the Struts framework executes during the parsing process. The file name in the multipart header may also contain path traversal sequences designed to overwrite system files.

SignalWhere to lookWhat it may mean
Unusual Content-TypeHTTP headersAttempt to bypass input validation
Encoded multipart boundaryRequest bodyPayload injection in file upload
Short-lived shell processSystem process listSuccessful remote code execution

Query String Encoding Patterns

Attackers often encode malicious payloads within query strings to evade detection. Multiple layers of encoding can confuse simple string matching filters. You must decode these strings to their original form before analysing them for threats. A single layer of decoding may not reveal the full payload.

Look for sequences that resemble Java expression language syntax. These expressions allow the attacker to interact with the application's internal objects. The syntax often includes curly braces and dot notation. When decoded, these strings may attempt to access sensitive environment variables or execute system commands. You should treat any query parameter containing complex nested expressions as suspicious.

System Process Monitoring

Post-exploitation activity leaves traces in the operating system process table. When an attacker gains command execution, they often spawn a shell. This shell process may have a short lifespan if the attacker uses it only to download additional tools. You should monitor for processes that spawn from the web server user context. These processes often have unusual parent-child relationships.

Look for processes that connect to external IP addresses immediately after creation. This behaviour indicates data exfiltration or command-and-control communication. The process name may be generic, such as bash or cmd, to blend in with normal system activity. However, the command-line arguments may reveal the malicious intent. You can correlate these processes with the timestamps in your web server logs.

Dependency Chain Analysis

Vulnerabilities in Apache Struts often stem from outdated dependencies. The framework relies on numerous third-party libraries for functionality. A vulnerability in one library can affect the entire application. You must use software composition analysis to identify all dependencies and their versions. This tool scans your project's dependency tree for known vulnerabilities.

Regularly update your dependency inventory. New vulnerabilities are discovered frequently in widely used libraries. Keeping your inventory current allows you to respond quickly to emerging threats. Do not rely on manual checks for dependencies. Automated tools provide a more accurate and comprehensive view of your software supply chain. This approach helps you identify hidden risks that are not visible in the application code.

See also: Cross-Site Scripting Explained: 8 Questions Answered for Secure Code

Common Detection Blind Spots

Many security teams focus on the application layer and miss lower-level indicators. Network traffic analysis may not reveal encrypted payloads. Attackers use encryption to hide their communications from network sensors. You must decrypt traffic at the endpoint to inspect the content. Endpoint detection and response tools can monitor file system changes and registry modifications.

Another blind spot is the assumption that only web-facing applications are at risk. Internal applications may use Struts components without external exposure. These applications are often less monitored and more vulnerable to insider threats or lateral movement. You should include internal applications in your vulnerability scanning routine. Ignoring internal assets creates a significant gap in your security posture.

Infographic: Detecting Apache Struts Vulnerabilities: Log Patterns and Blind Spots. Log analysis reveals exploitation attempts through unusual HTTP headers and multipart data patterns. Process monitoring catches post-exploitation activity when attackers spawn shells or download tools. Software compo
Infographic: Detecting Apache Struts Vulnerabilities: Log Patterns and Blind Spots. Free to share with a link to TechWire Beat.

Correlating Log Sources

Effective detection requires correlating data from multiple sources. Web server logs provide the initial request data. System logs show the resulting process activity. Network logs reveal external communications. You must align the timestamps from these sources to build a complete picture of the attack. Time synchronization across all systems is critical for accurate correlation.

Use a security information and event management system to aggregate these logs. This platform allows you to create custom correlation rules. These rules can trigger alerts when specific patterns appear across different log sources. For example, an alert may fire when a suspicious HTTP request is followed by a new process spawning on the server. This multi-layered approach reduces false positives and improves detection accuracy.

Key takeaways

  • Log analysis reveals exploitation attempts through unusual HTTP headers and multipart data patterns.
  • Process monitoring catches post-exploitation activity when attackers spawn shells or download tools.
  • Software composition analysis identifies vulnerable libraries before they are exploited in production.
Bottom line

Struts exploitation leaves distinct traces in HTTP headers and system processes. Implement software composition analysis to identify vulnerable dependencies before they are exploited.

Frequently asked questions

How do I distinguish between a legitimate file upload and a Struts exploit?

Legitimate uploads contain standard file data and expected content types. Exploits often use unusual content types or encoded payloads within the multipart boundary strings.

Can web application firewalls prevent all Struts attacks?

No. WAFs rely on signature matching and may miss novel attack vectors. They do not fix the underlying framework vulnerability.

What is the role of software composition analysis in this context?

It identifies vulnerable libraries within your application's dependency tree, allowing you to patch or replace them before exploitation.

Should I monitor internal applications for Struts vulnerabilities?

Yes. Internal applications may use vulnerable components and are often less monitored, making them attractive targets for lateral movement.

How this guide was produced: written by the TechWire Beat editorial team with AI assistance, checked against the public references listed below, and reviewed when the facts change. See our editorial policy or report an error.

Further reading

  1. MITRE CWE
  2. CISA Known Exploited Vulnerabilities Catalog
  3. National Vulnerability Database
Apache Struts vulnerabilitiesapache strutsweb securitylog analysis

Related stories