CODERED VTA

TeamCity Authentication Bypass Exploited Within a Day to Steal Build Agent Credentials

High
Engineer in a server room aisle
Photo by USDAgov on Flickr

Our earlier advisory VTA-2026-000257, published on 11 September 2026, covered this line of activity against JetBrains TeamCity build infrastructure. What has changed is the disclosure of a new critical authentication bypass, CVE-2026-136858, in the TeamCity CI/CD server, and confirmation that exploitation attempts were captured in the wild less than a day after JetBrains shipped patches. The flaw lets an unauthenticated attacker who can reach a TeamCity server over HTTP or HTTPS impersonate an existing authorised build agent without holding any user account, and in doing so intercept the credentials, access tokens and other secrets the server hands to that agent during a workflow. All on-premises versions of TeamCity are affected; JetBrains fixed the issue in 2026.1.7, 2026.2.3 and 2026.3, published a security patch plugin for servers on 2021.2 or later that cannot be upgraded straight away, and has already patched TeamCity Cloud instances server-side. Any organisation running a self-hosted TeamCity server reachable from an untrusted network should consider itself in scope.

The weakness sits in the agent authorisation path rather than in any user-facing login. Because the server fails to properly verify that a connecting agent is the agent it claims to be, an attacker can present themselves as an already-authorised, long-running build agent and begin receiving the material the server would normally send only to that trusted host. The exploitation attempts observed so far are notably unsophisticated: the attacker simply guesses the identifier numbers of long-running build agents, which typically begin at 1 and count upward, until one matches. Beyond harvesting secrets, an attacker holding a hijacked agent identity can falsify build results and publish tampered artifacts that other pipelines later consume and execute, turning a single exposed server into a pivot into downstream software. JetBrains notes that successful and attempted impersonation leaves a distinctive trace in the server log referencing an existing agent presenting a different authorisation token.

This is the second pre-authentication flaw in TeamCity's agent functionality to be exploited in the wild this year. The first, CVE-2026-63077, was a critical remote code execution issue in the agent polling protocol patched in July; it is listed in the CISA Known Exploited Vulnerabilities catalogue as of 5 August 2026, has known use in ransomware campaigns, and carries a FIRST EPSS score of 93.9 percent probability of exploitation in the next 30 days. By contrast, CVE-2026-136858 currently carries an EPSS probability of 1.4 percent over the same window — but that statistical view is already overtaken by the fact that live exploitation attempts have been recorded against honeypot infrastructure within roughly a day of disclosure. The activity appears to come from a threat actor actively hunting high-impact internet-facing bugs; the same operator was recently seen exploiting the PHP2Shell flaw against a Palo Alto PAN-OS device in the same honeypot network. TeamCity has a history here: in March 2024 two separate flaws were mass-exploited within days of disclosure, with attackers creating hundreds of rogue administrator accounts. The strategic concern is that a build server is a credential concentrator and an artifact publisher at once. Secrets lifted from a hijacked agent are rarely scoped to the build itself — they frequently unlock cloud accounts, container registries, signing infrastructure and source repositories — while tampered artifacts inherit the implicit trust that downstream teams place in their own pipeline output. The compression of the window between disclosure and observed exploitation, now measured in hours rather than weeks, leaves very little room between a vendor advisory landing and an opportunistic scan reaching an exposed server.

Attack Surface

Supply Chain (Third-party vendors), Web Application, Infrastructure

Tactics

Initial Access, Credential Access, Collection, Impact

Techniques

  • T1190 – Exploit Public-Facing Application
  • T1552 – Unsecured Credentials
  • T1195.002 – Supply Chain Compromise: Compromise Software Supply Chain
  • T1565 – Data Manipulation

SuperPRO's Threat Countermeasures Procedures

  1. Upgrade on-premises TeamCity servers to 2026.1.7, 2026.2.3 or 2026.3, the releases in which JetBrains fixed CVE-2026-136858. TeamCity Cloud instances were patched server-side by the vendor and need no customer action.
  2. Where an upgrade cannot be scheduled immediately, install the JetBrains security patch plugin, which is supported on TeamCity servers running version 2021.2 or later, and treat it as an interim control rather than a permanent fix.
  3. Restrict the server's /app/agents/ URL paths at the reverse proxy, load balancer or firewall so that only the IP addresses of known legitimate build agents can reach them, and deny all other sources.
  4. Search teamcity-server.log for entries containing the text 'of the existing agent, but different authorization token' and treat only entries with a non-empty token value as suspicious; use the timestamp of each hit to review that agent's connection history, verifying the hostname and source IP match the expected agent.
  5. Alert on sequential build agent ID enumeration against the TeamCity server, since observed attacks simply guess long-running agent identifiers beginning at 1 and counting upward from a single source address.
  6. Where impersonation is suspected, rotate every credential, access token and secret exposed to the builds assigned to the affected agent around that timestamp, and treat the resulting build artifacts as untrusted until rebuilt and verified against known-good build logs.
  7. Confirm that CVE-2026-63077, the agent polling protocol RCE patched by JetBrains in July, is remediated on every TeamCity server; it is listed in CISA KEV as of 2026-08-05, has known ransomware use, and carries a 93.9% EPSS exploitation probability.

Source

Code Red Cyber / VTA – coderedcyber.ai