Detection rules › Splunk

JetBrains TeamCity RCE Attempt

Status
production
Severity
medium
Group by
Web.src, Web.status, Web.url_length, c-uri, c-useragent, cs-host, cs-method
Author
Michael Haag, Splunk
Source
github.com/splunk/security_content

The following analytic detects attempts to exploit the CVE-2023-42793 vulnerability in JetBrains TeamCity On-Premises. It identifies suspicious POST requests to /app/rest/users/id:1/tokens/RPC2, leveraging the Web datamodel to monitor specific URL patterns and HTTP methods. This activity is significant as it may indicate an unauthenticated attacker attempting to gain administrative access via Remote Code Execution (RCE). If confirmed malicious, this could allow the attacker to execute arbitrary code, potentially compromising the entire TeamCity environment and leading to further unauthorized access and data breaches.

Known false positives

  • Requests to this specific endpoint via this method should not be common. Investigate further to determine if the request is legitimate, and apply appropriate filters to reduce false positives.

MITRE ATT&CK coverage

TacticTechniques
Initial Access

Rule body

name: JetBrains TeamCity RCE Attempt
id: 89a58e5f-1365-4793-b45c-770abbb32b6c
version: 11
creation_date: '2023-10-01'
modification_date: '2026-05-13'
author: Michael Haag, Splunk
status: production
type: TTP
description: |-
    The following analytic detects attempts to exploit the CVE-2023-42793 vulnerability in JetBrains TeamCity On-Premises.
    It identifies suspicious POST requests to /app/rest/users/id:1/tokens/RPC2, leveraging the Web datamodel to monitor specific URL patterns and HTTP methods.
    This activity is significant as it may indicate an unauthenticated attacker attempting to gain administrative access via Remote Code Execution (RCE).
    If confirmed malicious, this could allow the attacker to execute arbitrary code, potentially compromising the entire TeamCity environment and leading to further unauthorized access and data breaches.
data_source:
    - Suricata
search: |-
    | tstats `security_content_summariesonly`
      count min(_time) as firstTime
            max(_time) as lastTime
    
    FROM datamodel=Web WHERE
    
    Web.url="*/app/rest/users/id:1/tokens/RPC2*"
    Web.status=200
    Web.http_method="POST"
    
    BY Web.http_user_agent Web.status Web.http_method
       Web.url Web.url_length Web.src Web.dest
    
    | `drop_dm_object_name("Web")`
    | `security_content_ctime(firstTime)`
    | `security_content_ctime(lastTime)`
    | `jetbrains_teamcity_rce_attempt_filter`
how_to_implement: |-
    The following analytic requires the Web datamodel. Ensure data source is mapped correctly or modify and tune for your data source.
known_false_positives: |-
    Requests to this specific endpoint via this method should not be common. Investigate further to determine if the request is legitimate, and apply appropriate filters to reduce false positives.
references:
    - https://blog.jetbrains.com/teamcity/2023/09/critical-security-issue-affecting-teamcity-on-premises-update-to-2023-05-4-now/
    - https://www.sonarsource.com/blog/teamcity-vulnerability/
    - https://github.com/rapid7/metasploit-framework/pull/18408
    - https://attackerkb.com/topics/1XEEEkGHzt/cve-2023-42793/rapid7-analysis
finding:
    title: Potential JetBrains TeamCity RCE Attempt detected against URL $url$ on $dest$.
    entity:
        field: dest
        type: system
        score: 50
threat_objects:
    - field: src
      type: ip_address
analytic_story:
    - JetBrains TeamCity Unauthenticated RCE
    - CISA AA23-347A
    - JetBrains TeamCity Vulnerabilities
asset_type: Web Server
cve:
    - CVE-2023-42793
mitre_attack_id:
    - T1190
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: web
security_domain: network

Stages and Predicates

Stage 1: tstats

| tstats `security_content_summariesonly`
  count min(_time) as firstTime
        max(_time) as lastTime

FROM datamodel=Web WHERE

Web.url="*/app/rest/users/id:1/tokens/RPC2*"
Web.status=200
Web.http_method="POST"

BY Web.http_user_agent Web.status Web.http_method
   Web.url Web.url_length Web.src Web.dest

Stage 2: search

| `drop_dm_object_name("Web")`

Stage 3: search

| `security_content_ctime(firstTime)`

Stage 4: search

| `security_content_ctime(lastTime)`

Stage 5: search

| `jetbrains_teamcity_rce_attempt_filter`

Indicators

These rows show field, operator, and value matches.