CVE-2026-59795 Overview
CVE-2026-59795 is a stored cross-site scripting (XSS) vulnerability in JetBrains TeamCity versions before 2026.1.2. The flaw resides in the agent registration workflow, which does not require authentication. An unauthenticated attacker can register a malicious build agent with crafted payload data that is later rendered in the TeamCity web interface. When an authenticated user views the affected page, the injected script executes in their browser session.
Critical Impact
Unauthenticated attackers can inject persistent JavaScript into the TeamCity UI, enabling session theft, action hijacking, and lateral movement within CI/CD pipelines.
Affected Products
- JetBrains TeamCity versions prior to 2026.1.2
- Self-hosted TeamCity servers exposing agent registration endpoints
- CI/CD environments relying on TeamCity for build orchestration
Discovery Timeline
- 2026-07-10 - CVE-2026-59795 published to NVD
- 2026-07-13 - Last updated in NVD database
Technical Details for CVE-2026-59795
Vulnerability Analysis
The vulnerability is a stored XSS flaw classified under [CWE-79] Improper Neutralization of Input During Web Page Generation. TeamCity accepts agent registration requests without authentication. Attacker-controlled fields submitted during registration are persisted server-side and later rendered in administrative and monitoring views without adequate output encoding.
When a privileged user browses pages that display agent metadata, the injected script executes in their authenticated session. This yields access to session cookies, CSRF tokens, and any action the victim can perform in TeamCity. Because TeamCity governs build pipelines, deployment credentials, and artifact stores, script execution in an administrator context can enable supply chain compromise.
Root Cause
The root cause is missing output encoding combined with unauthenticated write access to a persistence surface. The agent registration endpoint stores attacker-supplied strings, and downstream views render those strings into HTML without contextual escaping. The absence of authentication on the registration path allows any network-reachable attacker to seed malicious payloads.
Attack Vector
The attack vector is network-based and requires no privileges. Exploitation requires a victim user, typically an administrator or build engineer, to load a TeamCity page that renders the poisoned agent metadata. The scope is changed because script execution occurs in the victim's browser context, crossing the trust boundary between the unauthenticated attacker and the authenticated session.
No verified public proof-of-concept exists at time of publication. Refer to the JetBrains Security Issues Fixed advisory for vendor-supplied technical detail.
Detection Methods for CVE-2026-59795
Indicators of Compromise
- Agent registration events from unexpected source IP addresses or with unusual agent names containing HTML tags, <script> fragments, or JavaScript event handlers
- Unexpected new entries in the TeamCity agents list, particularly with encoded characters such as %3C, <, or javascript: in name or metadata fields
- Outbound requests from administrator browsers to unfamiliar domains shortly after visiting TeamCity agent pages
Detection Strategies
- Review TeamCity server access logs for POST requests to agent registration endpoints originating from unauthenticated or unexpected sources
- Inspect the agents database and configuration for stored strings containing HTML or JavaScript syntax
- Correlate administrator session activity with anomalous XHR or fetch requests initiated from TeamCity pages
Monitoring Recommendations
- Enable and forward TeamCity audit logs to a centralized log platform for retention and search
- Alert on newly registered agents that do not correspond to sanctioned infrastructure change tickets
- Monitor for administrator credential use from geolocations or user agents that deviate from established baselines
How to Mitigate CVE-2026-59795
Immediate Actions Required
- Upgrade TeamCity to version 2026.1.2 or later without delay
- Restrict network access to the TeamCity server, especially the agent registration endpoints, to trusted management networks
- Audit the current agent list and remove any entries with suspicious names or metadata
- Rotate administrator session tokens and credentials that may have been exposed via prior UI visits
Patch Information
JetBrains addressed the vulnerability in TeamCity 2026.1.2. The fix enforces proper output encoding on agent metadata rendering and hardens the registration workflow. Consult the JetBrains Security Issues Fixed page for the authoritative release notes and remediation guidance.
Workarounds
- Place the TeamCity server behind a reverse proxy or VPN and block internet exposure of the agent registration endpoint until patching
- Require mutual TLS or IP allowlisting on the reverse proxy for any request to agent registration paths
- Instruct administrators to avoid the agents overview pages until the upgrade is complete
# Example nginx snippet restricting agent registration to trusted subnets
location /agentAuthorizationInterface/ {
allow 10.0.0.0/8;
deny all;
proxy_pass http://teamcity-backend;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

