Detection: Tomcat Session Deserialization Attempt

Description

This detection identifies potential exploitation of CVE-2025-24813 in Apache Tomcat through the second stage of the attack. This phase occurs when an attacker attempts to trigger deserialization of a previously uploaded malicious session file by sending a GET request with a specially crafted JSESSIONID cookie. These requests typically have specific characteristics, including a JSESSIONID cookie with a leading dot that matches a previously uploaded filename, and typically result in a HTTP 500 error when the exploitation succeeds.

1
2| tstats count min(_time) as firstTime max(_time) as lastTime from datamodel=Web where Web.http_method=GET AND Web.cookie="*JSESSIONID=.*" AND Web.status=500 by Web.src, Web.dest, Web.http_user_agent, Web.uri_path, Web.cookie, Web.status 
3| `drop_dm_object_name("Web")` 
4| where match(cookie, "^JSESSIONID=\.") 
5| rex field=cookie "JSESSIONID=\.(?<cookie_path>[^;]+)" 
6| eval severity="High" 
7| `security_content_ctime(firstTime)` 
8| `security_content_ctime(lastTime)` 
9| `tomcat_session_deserialization_attempt_filter`
spl

Data Source

Name Platform Sourcetype Source
Nginx Access N/A 'nginx:plus:kv' '/var/log/nginx/access.log'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
tomcat_session_deserialization_attempt_filter search *
tomcat_session_deserialization_attempt_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Risk Event True
This configuration file applies to all detections of type anomaly. These detections will use Risk Based Alerting.

Implementation

To successfully implement this search, you need to be ingesting logs from your web servers, proxies, or WAFs that process web traffic to Tomcat instances. The data must be mapped to the Web datamodel in the Web node. Ensure your web servers are logging requests that include HTTP methods, status codes, URI paths, and cookie information. Particularly important is capturing the JSESSIONID cookie values. The detection specifically looks for GET requests with a JSESSIONID cookie that starts with a dot (.) and results in a 500 status code, which is characteristic of successful deserialization attempts.

Known False Positives

Limited false positives should occur as this pattern is highly specific to CVE-2025-24813 exploitation. However, legitimate application errors that use similar cookie patterns and result in 500 status codes might trigger false positives. Review the JSESSIONID cookie format and the associated request context to confirm exploitation attempts.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message:

A Tomcat session deserialization attempt has been detected from IP $src$ targeting $dest$ with a suspicious JSESSIONID cookie. This could indicate exploitation of CVE-2025-24813.

Risk Object Risk Object Type Risk Score Threat Objects
dest system 80 src

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset nginx nginx:plus:kv
Integration ✅ Passing Dataset nginx nginx:plus:kv

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 1