Breaking
SecurityConfirmed

TeamCity build agents hijacked a day after patch

watchTowr says attackers began probing a critical TeamCity On-Premises auth bypass within a day of disclosure, aiming to seize build agents.

··19 hours ago·6 min read
Yellow and green cables are neatly connected
Photo by Albert Stoynov on Unsplash

A critical flaw in JetBrains TeamCity On-Premises drew attempted exploitation almost immediately after it became public, according to the offensive security firm watchTowr, whose researchers say attackers are trying to seize control of the worker software that sits at the heart of enterprise build pipelines. The vulnerability is tracked as CVE-2026-136858, and the targeting is reported to have begun just one day after disclosure.

The detail matters because of what a build agent is and what passes through it. TeamCity On-Premises is the self-hosted edition of JetBrains' platform for software build and release automation — the server-side system developers use to compile code, run tests, and deploy software automatically. A build agent is the worker software that carries out whatever job the TeamCity server hands it. Whoever impersonates an agent can sit inside that relationship.

What the flaw lets an attacker do

According to the reporting, CVE-2026-136858 lets an attacker impersonate a worker the TeamCity server already trusts and receive jobs that were intended for that worker. The server, in other words, believes it is talking to a legitimate agent and dispatches work to the impostor.

That position carries consequences beyond simply seeing a task list. Job payloads can include credentials passed to those jobs, so an attacker occupying an agent's slot could obtain secrets that were never meant to leave the pipeline. The impersonator could also report false build results back to the server, or return modified output files that would execute attacker-supplied code when those artifacts are consumed in later builds.

The guidance says exploitation requires guessing a build agent ID. That requirement is described as an easy one to clear, since these IDs typically start at "1" and are relatively easy to predict — the namespace is small and sequential, not random.

A single day between disclosure and probes

watchTowr, which monitors for exploitation across its client base, said the activity appeared roughly 24 hours after the vulnerability became publicly known. The company described its own response as immediate.

“The watchTowr team is rapidly reacting to CVE-2026-136858 across our client base, a recently disclosed Authentication Bypass vulnerability affecting JetBrains TeamCity,” the security company warned.

— watchTowr, offensive security company

The firm went further in a second statement describing what its telemetry picked up once the details were out.

“Only one day after initial disclosure, watchTowr Intel is already observing attempted in-the-wild exploitation, trying to take over build agents.”

— watchTowr, offensive security company

The researchers' explanation of why the attacks are feasible rests on that predictable ID scheme rather than on any sophisticated technique. An attacker who can enumerate or guess agent identifiers can present itself to the server as an existing, trusted worker.

The patch arrives at speed

JetBrains published a bulletin on December 2 that strongly recommends all users update to versions 2026.1.7, 2026.2.3, and 2026.3, which address the issue. Every TeamCity On-Premises release before those versions is affected.

For administrators who cannot move immediately, JetBrains offers a security patch plugin for 2021.2 and later that can be installed without restarting the server. On 2026.2.2 and later, TeamCity can install the patch unattended if automatic security patch installation is enabled — a path that avoids a maintenance window entirely.

TeamCity Cloud customers are already covered; the vendor says the fix has been applied there and cloud users need to take no action.

The vendor's bulletin states that JetBrains itself has observed no active exploitation of the flaw. That position differs from watchTowr's client-side observations, which describe attempted exploitation in the wild a day after disclosure.

Two log signals to check first

Because a hijacked agent can be made to look like normal operation, the bulletin points administrators at two specific artifacts worth inspecting. The first is a line in teamcity-server.log reading ‘of the existing agent, but different authorization token <token>.’ Its presence suggests the server encountered a worker claiming an existing identity while presenting a token that doesn't match.

The second is the presence of a non-empty token in that context, which may indicate a takeover attempt rather than routine noise.

If such a token turns up, JetBrains recommends checking the agent's connection history, its source IP, and the builds recorded around that timestamp — the sequence needed to judge whether the attempt actually succeeded or was merely refused.

What to do if a takeover is suspected

The bulletin lays out a response sequence for administrators who believe exploitation may have occurred. The first step is to preserve logs and build results before anything is changed, since patching in place can destroy the very evidence needed to scope the incident.

Next comes patching the server, followed by rotating the credentials that were passed to potentially affected builds. The final instruction is to treat the artifacts produced by those builds as untrusted until they have been verified — a direct response to the risk that a hijacked agent returned modified output files capable of executing attacker code downstream.

JetBrains offers an additional mitigation in the same bulletin: restrict ‘/app/agents’ and its subpaths to the expected source IPs of legitimate build agents. Narrowing that endpoint to known addresses makes it harder for an uninvited party to present itself as a worker, regardless of whether it guesses an ID correctly.

What's at stake for the pipeline

The specific risk here lands on credentials that get handed to build jobs, on the integrity of reported build outcomes, and on the provenance of the files those builds emit. Those are the three things the source material says an impersonating agent can touch.

  • CVE-2026-136858 is the identifier assigned to the affected TeamCity On-Premises vulnerability.
  • Exploitation attempts were reported one day after initial disclosure.
  • Fixed versions are 2026.1.7, 2026.2.3, and 2026.3; all earlier On-Premises releases are affected.
  • The security patch plugin is available for 2021.2 and later and installs without a server restart.
  • Unattended patch installation is possible on 2026.2.2 and later when automatic security patch installation is enabled.
  • Build agent IDs typically start at "1", which the researchers describe as easy to predict.
  • The JetBrains bulletin was published on December 2.

The earlier TeamCity warning

This is not the first time a TeamCity On-Premises flaw has drawn attention to the build server's exposure. In September 2026, CISA warned federal agencies that ransomware operators were targeting a different TeamCity On-Premises vulnerability, CVE-2026-63077, to execute arbitrary OS commands on victims' systems.

That earlier episode involved command execution against the server itself. The current one is narrower in mechanism — impersonating a trusted worker — but the target is the same class of system: the infrastructure that compiles and ships an organization's code.

Why this matters for build infrastructure

The practical weight of this report falls on teams running self-hosted TeamCity, and it splits into two questions they can answer quickly. The first is version: whether the server has moved to 2026.1.7, 2026.2.3, or 2026.3, or has at minimum received the security patch plugin that installs without a restart. The second is observation: whether teamcity-server.log contains the token-mismatch line the bulletin describes, and whether any agent's connection history shows an unfamiliar source IP.

Because the flaw requires only a guessed agent ID — and those IDs are described as predictable — this suggests that exposure here is less about whether an attacker can mount a sophisticated campaign and more about whether a given server is still on an affected version while someone is looking for one. The reported one-day gap between disclosure and attempted exploitation suggests patching windows for this class of system may need to be measured in hours rather than weeks, particularly for internet-reachable servers that accept agent connections.

For administrators who suspect an attempt succeeded, the response sequence in the bulletin is the part worth having on hand before an incident: preserve logs and build results, patch, rotate credentials passed to affected builds, and treat those builds' artifacts as untrusted until verified. The rotation step and the artifact-verification step are the ones that address what an impersonating agent could actually have taken or altered.

Restricting ‘/app/agents’ to expected agent IPs is the mitigation that can be applied alongside a patch rather than instead of one. For organizations that cannot enforce IP allowlisting on that path, the log signals and the credential-rotation step remain the available checks.

#jetbrains#teamcity#cve-2026-136858#build agents#authentication bypass#exploitation

Sources

Iliyas

Founder & Editor, Xploitwire

This article was written and reviewed against the sources listed above before publication, under editorial policies set by Iliyas. Read our Editorial Policy →

← Back to all stories