CVE-2024-50379: Critical RCE Vulnerability in Apache Tomcat

July 25, 2025

CVE-2024-47950: Stored XSS Vulnerability in JetBrains TeamCity

July 25, 2025

CVE-2024-47951: JetBrains TeamCity Stored XSS Vulnerability Analysis

by CyRisk

    Comprehensive Analysis of CVE-2024-47951: JetBrains TeamCity Stored XSS Vulnerability


    1. Vulnerability Overview

    CVE-2024-47951 is a stored Cross-Site Scripting (XSS) vulnerability in JetBrains TeamCity CI/CD platform, affecting versions prior to 2024.07.3. This medium-severity vulnerability (CVSS 5.4) enables attackers to inject malicious scripts through server global settings, potentially hijacking user sessions or altering UI behavior[1][14][16].


    2. Technical Deep Dive

    Root Cause Analysis

    The vulnerability arises from insufficient input validation in server global settings configurations. When these settings are modified, user-input data is stored without proper sanitization or escaping. This allows attackers to inject arbitrary HTML/JavaScript, which executes in the context of authenticated users’ browsers when they interact with the affected settings[14][16].

    Exploitation Workflow

    1. Attack Prerequisites:
      1. Access to a TeamCity instance with permissions to modify server global settings (e.g., admin or granted roles)[14].
      2. Ability to craft malicious scripts targeting browser contexts.
      3. Injection Vector:
      4. Modify a server global setting, such as backup configurations or build-related parameters, embedding XSS payloads like .
      5. Example payload: alert('XSS');
      6. Execution Triggers:
      7. Victims interact with the affected settings page, causing the injected script to execute in their browser.
      8. Impact: Session hijacking, unauthorized actions, malware distribution, or defacement of TeamCity interfaces[1][16].

      Attack Limitations

    1. User Interaction Required: Exploitation depends on the victim accessing a tainted page, reducing the vulnerability’s reach compared to stored XSS in more frequently visited areas[16].
    2. Mitigation Barriers: Proper Content Security Policies (CSP) and input validation best practices can block script execution in modern browsers.

    3. Threat Intelligence and Active Exploitation

    As of July 2025, no public reports of exploitation or organized campaigns targeting CVE-2024-47951 have surfaced. Key observations:

    1. No Known PoC: Unlike other CVEs (e.g., CVE-2024-49112 in Windows LDAP), no proof-of-concept exploits or proof-of-exploits have been released for this vulnerability[5][12].
    2. Low Priority for Threat Actors: Medium-severity XSS vulnerabilities are often deprioritized compared to critical RCE flaws (e.g., CVE-2024-49112, CVSS 9.8).
    3. Monitoring Gaps: Limited references in public threat feeds (e.g., no mentions in CISA alerts or Rapid7’s Metasploit updates)[9][13].

    Recommendation: While exploitation is unlikely, organizations should still treat this vulnerability with caution due to the potential for sophisticated attackers to chain it with other flaws (e.g., authentication bypass)[11].


    4. Vendor Response and Patching Guidance

    JetBrains’ Remediation Efforts

    1. Patch Distribution: The vulnerability was addressed in TeamCity 2024.07.3, released on October 1, 2024[3][7].
    2. Upgrade Path:
      1. Direct Update: Use TeamCity’s automatic update feature or download the patched version from JetBrains’ website.
      2. Docker Images: Pull updated TeamCity Docker containers (Linux agent and server images).
      3. Version Compatibility: The 2024.07.x line shares the same data format, enabling seamless upgrades/downgrades within this branch[3].

      Critical Advisory for Unpatched Users

      JetBrains did not release a standalone security patch plugin for this CVE—unlike their response to CVE-2024-23917, a critical authentication bypass[11]. Organizations must upgrade to 2024.07.3+ to resolve the issue.


      5. Supply Chain and CI/CD Pipeline Implications

      Key Risks

    1. Build Workflows Compromise: While stored XSS in global settings doesn’t directly affect build processes, a compromised environment could be manipulated to inject malicious scripts into build agents (e.g., via tampered environment variables).
    2. Access to Sensitive Data: Attackers could exploit session hijacking to access credentials, build artifacts, or dependencies.

    Detection and Prevention

    | Strategy | Implementation | Example Tools/Methods |
    |———————————-|————————————|—————————————-|
    | Input Validation | Enforce Sanitization via Plugins | OWASP ESAPI, Custom WAF Rules |
    | Audit Logs | Monitor Server Settings Modifications | TeamCity Audit Logs, SIEM Alerts |
    | CI/CD Pipeline Hardening | Restrict Build Agent Permissions | Least-Privilege Runner Configurations |

    Best Practice: Isolate sensitive CI/CD environments from untrusted users and enforce strict role-based access control (RBAC) for server settings[3][8].


    6. Detection and Monitoring Strategies

    SIEM Detection Rules

    Query TeamCity logs for:

    event_type="config_change" AND parameter_name="server.global.settings" AND (XSSPayloadMatch OR inject_CT)

    Adapted from generic XSS detection patterns. Replace with exact field names from TeamCity logs.

    Network Monitoring Signatures

    1. HTTP Request Analysis: Detect suspicious scripts injected into application/x-www-form-urlencoded payloads targeting TeamCity’s backend APIs[17].
    2. Juniper Signature: Detects attempts to exploit Backup History XSS (signature ID HTTP:XSS:JTBRAIN-TM-CTY-BKP-HIS)[17].

    Behavioral Indicators

    1. Unusual SSO Activity: Monitor for unexpected login events or session tokens being triggered from atypical browsers/devices.
    2. Artifact Modifications: Audit suspicious changes to build scripts, environment variables, or pipeline definitions.

    7. Advanced Mitigation and Hardening

    Configuration-Based Mitigations

    | Measure | Implementation Steps |
    |———————————-|————————————————|
    | CSP Headers | Enforce Content-Security-Policy: script-src 'self' to block unauthorized script execution. |
    | User Permissions | Limit access to server global settings to trusted administrators only. |
    | Regular Audits | Conduct routine security audits of TeamCity configurations and logs. |


    Conclusion

    CVE-2024-47951 highlights the importance of maintaining secure configurations within CI/CD tools like JetBrains TeamCity. Organizations should prioritize patching to mitigate potential risks associated with stored XSS vulnerabilities, ensuring robust security practices are in place to protect sensitive data and workflows.


    References

    1. Recorded Future
    2. Red Hat Customer Portal
    3. JetBrains Blog
    4. Rapid7
    5. CISA
    6. Infosecurity Magazine
    7. Juniper Networks
    8. GitHub Advisory

    Leave a Reply

    Discover more from CyRisk

    Subscribe now to keep reading and get access to the full archive.

    Continue reading